[arch-projects] [initscripts][PATCH 1/4] use systemd-remount-fs to remount root
This has the added bonus of scanning /etc/fstab and remounting API filesystems should they be explicitly defined with extra options. Signed-off-by: Dave Reisner <dreisner@archlinux.org> --- rc.sysinit | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/rc.sysinit b/rc.sysinit index 876542a..58f3216 100755 --- a/rc.sysinit +++ b/rc.sysinit @@ -119,8 +119,8 @@ run_hook sysinit_postfsck # Single-user login and/or automatic reboot if needed fsck_reboot $fsckret -status "Remounting Root" \ - mount -o remount / +status "Remounting Root and API filesystems" \ + /usr/lib/systemd/systemd-remount-fs # now mount all the local filesystems run_hook sysinit_premount -- 1.7.10.4
These are shipped as symlinks by filesystem 2012.06, so these checks are no longer needed. Signed-off-by: Dave Reisner <dreisner@archlinux.org> --- functions | 9 --------- 1 file changed, 9 deletions(-) diff --git a/functions b/functions index 735f75f..4a8ba7b 100644 --- a/functions +++ b/functions @@ -590,15 +590,6 @@ umount_all() { remove_leftover() { status -v 'Removing Leftover Files' systemd-tmpfiles --create --remove - # move from static /var/{run,lock} to /run - if [[ ! -L /var/lock ]]; then - rm -rf /var/lock - ln -s /run/lock /var/lock - fi - if [[ ! -L /var/run ]]; then - rm -rf /var/run - ln -s /run /var/run - fi } bootlogd_stop() { -- 1.7.10.4
Explicitly pass "kexec" to the shutdown script if we detect a preloaded kernel already in memory. We mask read errors for custom kernels where kexec is not available. Signed-off-by: Dave Reisner <dreisner@archlinux.org> --- rc.shutdown | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/rc.shutdown b/rc.shutdown index d0d8405..78f56c4 100755 --- a/rc.shutdown +++ b/rc.shutdown @@ -82,7 +82,12 @@ if [[ -x /run/initramfs/shutdown ]]; then if [[ $RUNLEVEL = 0 ]]; then action="poweroff" else - action="reboot" + { read kexec_loaded </sys/kernel/kexec_loaded; } 2>/dev/null + if (( kexec_loaded )); then + action="kexec" + else + action="reboot" + fi fi # make /run/initrafs a mount -- 1.7.10.4
This is a deprecated path in sysfs, and the check is illogical. Signed-off-by: Dave Reisner <dreisner@archlinux.org> --- rc.shutdown | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rc.shutdown b/rc.shutdown index 78f56c4..c708b92 100755 --- a/rc.shutdown +++ b/rc.shutdown @@ -71,7 +71,7 @@ if [[ -f /etc/crypttab ]] && type -p cryptsetup >/dev/null; then stat_done fi -[[ $USELVM = [Yy][Ee][Ss] && -x $(type -P lvm) && -d /sys/block ]] && +[[ $USELVM = [Yy][Ee][Ss] && -x $(type -P lvm) ]] && status "Deactivating LVM2 groups" vgchange --sysinit -a n &>/dev/null run_hook shutdown_poweroff -- 1.7.10.4
Am 08.06.2012 16:58, schrieb Dave Reisner:
This is a deprecated path in sysfs, and the check is illogical.
-[[ $USELVM = [Yy][Ee][Ss] && -x $(type -P lvm) && -d /sys/block ]] && +[[ $USELVM = [Yy][Ee][Ss] && -x $(type -P lvm) ]] &&
History lesson: Back when 2.4 was still supported, we would never know if sysfs was mounted. This check is the "/sys contains something useful, thus sysfs is mounted" check.
participants (2)
-
Dave Reisner
-
Thomas Bächler