summaryrefslogtreecommitdiffstats
path: root/modules.d/90mgalive/mgalive-root.sh
diff options
context:
space:
mode:
authorThomas Backlund <tmb@mageia.org>2013-10-19 19:27:20 +0100
committerJybz <j.biernacki@free.fr>2024-04-20 21:21:03 +0200
commit1ed60d25874839c7cc477210754ffd752c2cd797 (patch)
tree69bc601c772d9ed7a8dd9586f80b51beeef8d508 /modules.d/90mgalive/mgalive-root.sh
parentfcfb11e19a88ca8c6ae09bb8c4cc4105c70107dd (diff)
downloadmageia-dracut-conf-1ed60d25874839c7cc477210754ffd752c2cd797.tar
mageia-dracut-conf-1ed60d25874839c7cc477210754ffd752c2cd797.tar.gz
mageia-dracut-conf-1ed60d25874839c7cc477210754ffd752c2cd797.tar.bz2
mageia-dracut-conf-1ed60d25874839c7cc477210754ffd752c2cd797.tar.xz
mageia-dracut-conf-1ed60d25874839c7cc477210754ffd752c2cd797.zip
Updated to eject CD and pause on shutdown.
Signed-off-by: Martin Whitaker <mageia@martin-whitaker.me.uk> - origin: https://svnweb.mageia.org/packages/cauldron/dracut/current/SOURCES/0511-mgalive-A-module-to-mount-Mageia-Live-media.patch?r1=1231609&r2=1326566 - enable pivot back to dracut on shutdown (mga#22516) o see also upstream issue #481 - fix shutdown umount retry loop (upstream issue #483) - mgalive: ensure overlay filesystems are cleanly unmounted on shutdown - mgalive: eject optical media and pause on shutdown
Diffstat (limited to 'modules.d/90mgalive/mgalive-root.sh')
-rwxr-xr-xmodules.d/90mgalive/mgalive-root.sh11
1 files changed, 10 insertions, 1 deletions
diff --git a/modules.d/90mgalive/mgalive-root.sh b/modules.d/90mgalive/mgalive-root.sh
index 584dccc..77a34bd 100755
--- a/modules.d/90mgalive/mgalive-root.sh
+++ b/modules.d/90mgalive/mgalive-root.sh
@@ -18,12 +18,14 @@ mkdir -m 0755 -p /run/mgalive/ovlsize
# Get the base device name
basedev=$(echo $livedev | sed 's,\(/dev/sd[a-z]\)1,\1,g')
+# Make it available to draklive-install and mgalive-shutdown
+echo $basedev > /run/mgalive/basedev
# Get the base directory for locating the loopback file. In normal use this is
# the root directory, but a multi-boot USB stick may want to override this.
basedir=$(getarg mgalive.basedir)
-# Get the device or path used for persistant storage (if it exists). In normal
+# Get the device or path used for persistent storage (if it exists). In normal
# use this is another partition on the same base device, but a multi-boot USB
# stick may want to override this.
overlay=$(getarg mgalive.overlay)
@@ -75,6 +77,13 @@ mount -n -t overlay overlay -o lowerdir=/live/distrib,upperdir=/live/overlay/mem
ln -s /live/union /dev/root
printf '/bin/mount --rbind /live/union %s\n' "$NEWROOT" > $hookdir/mount/01-$$-live.sh
+printf '/bin/umount /live/union\n' >> $hookdir/mount/01-$$-live.sh
+
+# /live will not be visible once we pivot, so schedule its cleanup now.
+# This is needed to allow a persistent overlay to be shutdown cleanly.
+umount -l /live/distrib
+umount -l /live/overlay
+umount -l /live/media
need_shutdown