summaryrefslogtreecommitdiffstats
path: root/liveinit
diff options
context:
space:
mode:
author Eric Hameleers <alien@slackware.com>2016-05-28 22:31:01 +0200
committer Eric Hameleers <alien@slackware.com>2016-05-28 22:31:01 +0200
commitedb6ea93090b10f025551d75c6f53e0389c9348f (patch)
tree733719e37e8dd2157f14503b616088d55fab96df /liveinit
parent017eaba887b33f431e161934a282321f76909d14 (diff)
downloadliveslak-edb6ea93090b10f025551d75c6f53e0389c9348f.tar.gz
liveslak-edb6ea93090b10f025551d75c6f53e0389c9348f.tar.xz
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.
Diffstat (limited to 'liveinit')
-rwxr-xr-xliveinit10
1 files changed, 10 insertions, 0 deletions
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