In commit
0d878d3a679 of live-boot(-grml)
("Simplify mount point handling by using /run/live instead of /lib/live/mount")
the mountpath of /lib/live/mount/medium was moved towards /run/live/medium.
Commit
c6a17c7b41b of live-boot(-grml) provides a backward compatibility
rbind mount, but occasionally there seems to be a regression somewhere
during boot (see https://github.com/grml/live-boot-grml/issues/10), and
the rbind mount will be deprecated and removed before the bullseye
(Debian 11) release.
Layout changes over time:
* /cdrom for old linuxrc approach
* /live/image for initramfs layout until December 2012
* /lib/live/mount/medium for initramfs layout since December 2012
* /run/live/medium for initramfs layout since December 2018
Drop support for everything but /run/live/medium and
/lib/live/mount/medium, while at it.
# detect cdrom device
if ! $INSTALLED ; then
# detect cdrom device
if ! $INSTALLED ; then
- # live-boot layout since December 2012:
- if [ -d /lib/live/mount/medium ] ; then
- CDROM="$(awk '/ \/lib\/live\/mount\/medium /{print $1;exit 0;}' /proc/mounts)"
- MOUNTPATH="/lib/live/mount/medium"
- # live-boot layout until December 2012:
- elif [ -d /live/image ] ; then
- CDROM="$(awk '/ \/live\/image /{print $1;exit 0;}' /proc/mounts)"
- MOUNTPATH="/live/image"
- else # old layout:
- CDROM="$(awk '/ \/cdrom /{print $1;exit 0;}' /proc/mounts)"
- MOUNTPATH="/cdrom"
- fi
+ if [ -d /run/live/medium ] ; then # live-boot layout since Dec 2018
+ CDROM="$(awk '/ \/run\/live\/medium /{print $1;exit 0;}' /proc/mounts)"
+ MOUNTPATH="/run/live/medium"
+ elif [ -d /lib/live/mount/medium ] ; then # live-boot layout between 2012 and Dec 2018
+ CDROM="$(awk '/ \/lib\/live\/mount\/medium /{print $1;exit 0;}' /proc/mounts)"
+ MOUNTPATH="/lib/live/mount/medium"
+ fi
# try to remove only removable devices
DEVICE=""
# try to remove only removable devices
DEVICE=""
# Prompt for removal of live system device
if ! $INSTALLED && ! $NOPROMPT ; then
# do not prompt for removal when running in grml2ram mode:
# Prompt for removal of live system device
if ! $INSTALLED && ! $NOPROMPT ; then
# do not prompt for removal when running in grml2ram mode:
- if ! mount | grep -qe 'on /cdrom' -qe 'on /live/image' -qe 'on /lib/live/mount/medium' ; then
+ if ! mount | grep -qe 'on /run/live/medium' -qe 'on /lib/live/mount/medium' ; then
echo "Live System not mounted, nothing to eject therefore."
else
[ -d "$MOUNTPATH" ] && umount -l "$MOUNTPATH"
echo "Live System not mounted, nothing to eject therefore."
else
[ -d "$MOUNTPATH" ] && umount -l "$MOUNTPATH"