X-Git-Url: http://git.grml.org/?a=blobdiff_plain;f=components%2F9990-main.sh;h=b9bd71b9febc6269f31a4f606d7ae35d181ec63c;hb=27bc786ffea0c796827b628fb48fcdd755eace9d;hp=20e8c0c9590584a363a05419585c4a7dcb3e5125;hpb=0d878d3a679820d570a20c0fa1c1a2c5b92ad037;p=live-boot-grml.git diff --git a/components/9990-main.sh b/components/9990-main.sh index 20e8c0c..b9bd71b 100755 --- a/components/9990-main.sh +++ b/components/9990-main.sh @@ -111,10 +111,10 @@ Live () then losetup -d /dev/loop0 - if is_mountpoint /live/fromiso + if is_mountpoint /run/live/fromiso then - umount /live/fromiso - rmdir --ignore-fail-on-non-empty /live/fromiso \ + umount /run/live/fromiso + rmdir --ignore-fail-on-non-empty /run/live/fromiso \ >/dev/null 2>&1 || true fi fi @@ -162,7 +162,7 @@ Live () else DNSFILE="${rootmnt}/etc/resolv.conf" fi - if [ -f /etc/resolv.conf ] && [ ! -s ${DNSFILE} ] + if [ -f /etc/resolv.conf ] && ! grep -E -q -v '^[[:space:]]*#|^[[:space:]]*$' ${DNSFILE} then log_begin_msg "Copying /etc/resolv.conf to ${DNSFILE}" cp -v /etc/resolv.conf ${DNSFILE} @@ -174,13 +174,27 @@ Live () panic "A wrong rootfs was mounted." fi + # avoid breaking existing user scripts that rely on the old path + # this includes code that checks what is mounted on /lib/live/mount/* + # (eg: grep /lib/live /proc/mount) + # XXX: to be removed before the bullseye release + mkdir -p ${rootmnt}/lib/live/mount + mount --rbind /run/live ${rootmnt}/lib/live/mount + Fstab - Netbase Swap + if grep -q debian_networking /proc/cmdline ; then + Netbase + else + Grml_Networking + fi + exec 1>&6 6>&- exec 2>&7 7>&- kill ${tailpid} - [ -w "${rootmnt}/var/log/" ] && mkdir -p "${rootmnt}/var/log/live" && cp boot.log "${rootmnt}/var/log/live" 2>/dev/null + [ -w "${rootmnt}/var/log/" ] && mkdir -p "${rootmnt}/var/log/live" && ( \ + cp boot.log "${rootmnt}/var/log/live" 2>/dev/null; \ + cp fsck.log "${rootmnt}/var/log/live" 2>/dev/null ) }