qubes-installer-qubes-os/anaconda/dracut/anaconda-pre-shutdown.sh
Marek Marczykowski-Górecki f73b3741f0 Update anaconda to 20.25.16
Apply result of "git diff anaconda-18.37.11-1..anaconda-20.25.16-1" and
resolve conflicts.
2014-04-08 05:50:31 +02:00

22 lines
825 B
Bash

# Fix mount loops that prevent unmount/eject.
#
# During startup, we mount our repo (e.g. the DVD) at $repodir or $isodir.
# We then mount the runtime image from that repo at /newroot and switch into it.
# Switching moves $repodir to /newroot/$repodir, which creates a mount loop:
#
# -> You can't unmount the runtime image because the DVD is mounted under it
# -> You can't unmount the DVD because it holds the mounted runtime image
#
# And now you can't unmount or eject the DVD!
#
# We fix this by moving the repo mounts back out from under the runtime image
# during shutdown. Then everything can be unmounted like normal.
. /lib/anaconda-lib.sh
for mnt in $repodir $isodir; do
# systemd-shutdown puts old root at /oldroot
oldmnt=/oldroot$mnt
grep -qw $oldmnt /proc/mounts && mount --move $oldmnt $mnt
done