From 631e9429e188fb76f9d6b89ed79abd1e1f6b803c Mon Sep 17 00:00:00 2001 From: Eric Hameleers Date: Sun, 17 Sep 2023 21:54:00 +0200 Subject: liveinit: fix shutdown/reboot for PXE clients This needed some changes because the Slackware rc.0 and rc.6 scripts have evolved and my old hacks no longer worked. --- liveinit.tpl | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'liveinit.tpl') diff --git a/liveinit.tpl b/liveinit.tpl index 8f0a957..e00d984 100644 --- a/liveinit.tpl +++ b/liveinit.tpl @@ -1820,11 +1820,14 @@ EOT # In case of network boot, do not kill the network, umount NFS prematurely # or stop udevd on shutdown: if [ -n "$NFSHOST" ]; then - sed -i /mnt/overlay/etc/rc.d/rc.0 \ - -e "/on \/ type nfs/s%grep -q 'on / type nfs'%egrep -q 'on / type (nfs|tmpfs)'%" \ - -e '/umount.*nfs/s/nfs,//' \ - -e 's/rc.udev force-stop/rc.udev stop/' \ - -e 's/$(pgrep mdmon)/& $(pgrep udevd)/' + for RUNLVL in 0 6 ; do + sed -i /mnt/overlay/etc/rc.d/rc.${RUNLVL} \ + -e "/on \/ type nfs/s%grep -q 'on / type nfs'%egrep -q 'on / type (nfs|tmpfs)'%" \ + -e "s%'on / type nfs4'%& -e 'on / type overlay'%" \ + -e '/umount.*nfs/s/nfs,//' \ + -e 's/rc.udev force-stop/rc.udev stop/' \ + -e 's/$(pgrep mdmon)/& $(pgrep udevd)/' + done fi # Copy contents of rootcopy directory (may be empty) to overlay: -- cgit v1.2.3