From edb6ea93090b10f025551d75c6f53e0389c9348f Mon Sep 17 00:00:00 2001 From: Eric Hameleers Date: Sat, 28 May 2016 22:31:01 +0200 Subject: Ensure that a PXE-booted Slackware Live will shutdown properly. In case of network boot, do not kill the network, umount NFS prematurely or stop udevd on shutdown. --- liveinit | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/liveinit b/liveinit index 2a58fd4..e9a4485 100755 --- a/liveinit +++ b/liveinit @@ -990,6 +990,16 @@ EOT # Delete ALSA state file, the Live OS may be booted on different computers: rm -f /mnt/overlay/var/lib/alsa/asound.state + # 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)/' + fi + # Copy contents of rootcopy directory (may be empty) to overlay: cp -af /mnt/media/${LIVEMAIN}/rootcopy/* /mnt/overlay/ 2>/dev/null -- cgit v1.2.3