From: Michael Prokop Date: Thu, 21 Mar 2019 08:54:45 +0000 (+0100) Subject: Switch default mount point from /lib/live/mount/medium to /run/live/medium X-Git-Tag: v0.19.0~5 X-Git-Url: https://git.grml.org/?p=grml-autoconfig.git;a=commitdiff_plain;h=b451f8e63d2d6b8bc254f253d1e5a9ff136c8083 Switch default mount point from /lib/live/mount/medium to /run/live/medium 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: 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. Also noticed that save-config wasn't properly handling the location of the rootfs and overlay mount points, adjusted while at it. Closes: grml/live-boot-grml#10 --- diff --git a/autoconfig.functions b/autoconfig.functions index 467c41e..558472b 100755 --- a/autoconfig.functions +++ b/autoconfig.functions @@ -13,12 +13,10 @@ KERNEL="$(uname -r)" ARCH="$(uname -m)" umask 022 -# old linuxrc version: -[ -d /cdrom ] && export LIVECD_PATH=/cdrom -# initramfs layout until around December 2012: -[ -d /live/image ] && export LIVECD_PATH=/live/image -# initramfs layout since around December 2012: -[ -d /lib/live/mount/medium ] && export LIVECD_PATH=/lib/live/mount/medium +# initramfs layout since December 2012, backwards compatibility: +[ -d /lib/live/mount/medium ] && export LIVECD_PATH='/lib/live/mount/medium' +# initramfs layout since December 2018: +[ -d /run/live/medium ] && export LIVECD_PATH='/run/live/medium' # Ignore these signals in non-interactive mode: INT, TERM, SEGV [ -z "$PS1" ] && trap "" 2 3 11 diff --git a/bin/save-config b/bin/save-config index fea435a..63e41c7 100755 --- a/bin/save-config +++ b/bin/save-config @@ -18,21 +18,22 @@ LC_ALL=C [[ $UID != 0 ]] && runas='sudo' # important for /etc - if [ -d /lib/live/mount/overlay ] ; then # since around December 2012 - CHANGE_DIR='/lib/live/mount/overlay' - elif [ -d /live/overlay ] ; then # until around December 2012 - CHANGE_DIR='/live/overlay' - elif [ -d /live/image ] ; then # old version - CHANGE_DIR='/live/image' + if [ -d /run/live/overlay/rw ] ; then # since Dec 2018 + CHANGE_DIR='/run/live/overlay/rw' + elif [ -d /lib/live/mount/overlay/rw ] ; then # 2012 until Dec 2018, backwards compatibility + CHANGE_DIR='/lib/live/mount/overlay/rw' else echo "Error: no overlay directories found (like /lib/live/mount/overlay or /live/overlay)." >&2 bailout; exit 1 fi - if [ -d /live/rofs ] ; then - ORIG_DIR="$(find /live/rofs/ -maxdepth 1 -name \*.squashfs | head -1)" - else # old version - ORIG_DIR="/GRML" + if [ -d /run/live/rootfs ] ; then + ORIG_DIR="$(find /run/live/rootfs/ -maxdepth 1 -name \*.squashfs | head -1)" + elif [ -d /lib/live/mount/rootfs ] ; then + ORIG_DIR="$(find /lib/live/mount/rootfs/ -maxdepth 1 -name \*.squashfs | head -1)" + else + echo "Error: no rootfs directories found in '/run/live/rootfs' or '/lib/live/mount/rootfs'." >&2 + bailout; exit 1 fi check4progs mutt &>/dev/null || echo "Warning, mutt not available for mail handling.">&2 diff --git a/doc/grml-autoconfig.1.txt b/doc/grml-autoconfig.1.txt index 0b49815..ab79e3d 100644 --- a/doc/grml-autoconfig.1.txt +++ b/doc/grml-autoconfig.1.txt @@ -112,7 +112,7 @@ Now create a directory named debs and place foobar.deb in it: mkdir debs/ && cp foobar.deb debs/ -Notice: This directory will be located in /lib/live/mount/medium after burning the second +Notice: This directory will be located in /run/live/medium after burning the second session. Now create the second session containing this directory: diff --git a/doc/grml-autoconfig.current.txt b/doc/grml-autoconfig.current.txt index 71ac363..8fcfa67 100644 --- a/doc/grml-autoconfig.current.txt +++ b/doc/grml-autoconfig.current.txt @@ -10,7 +10,7 @@ Determination of DCS directory ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ The DCS directory defaults to the root directory of the GRML live image -(Note: the directory is known as /lib/live/mount/medium/ on a _running_ +(Note: the directory is known as /run/live/medium/ on a _running_ Grml system then!). If a file system labeled GRMLCFG is found, the DCS directory is the root directory of that file system. Alternatively, the myconfig boot parameter can be used to directly specify a device which @@ -150,7 +150,7 @@ As you probably know you can adjust boot parameters on the bootprompt. You want to set some boot parameters permanently? That's possible via adding a directory named 'bootparams' to the Grml ISO which has to be located at the root-directory /bootparams/ (Note: the directory is known -as /lib/live/mount/medium/bootparams/ on a _running_ Grml system then!). +as /run/live/medium/bootparams/ on a_running_Grml system then!). Place a textfile inside the directory containing the boot parameters which should be appended to default ones (this corresponds to booting without any special parameters). diff --git a/tests/test_dcsdir.sh b/tests/test_dcsdir.sh index 745813c..0285964 100755 --- a/tests/test_dcsdir.sh +++ b/tests/test_dcsdir.sh @@ -5,7 +5,7 @@ test_finddcsdir() { CMDLINE='' INSTALLED='' - EXPECTED_PATH='/lib/live/mount/medium' + EXPECTED_PATH='/run/live/medium' config_finddcsdir &>/dev/null