X-Git-Url: http://git.grml.org/?a=blobdiff_plain;f=components%2F9990-main.sh;h=530cd3b5dd9c6ccc71fc05b42478058e1d9cf183;hb=abfb0596ba63f83a511f797b668b1ecf5de8fca6;hp=bab0bd7a6ba76db3d814804245a93226db4fd675;hpb=a28b96c521b85100e32093b9e65476947a780db3;p=live-boot-grml.git diff --git a/components/9990-main.sh b/components/9990-main.sh index bab0bd7..530cd3b 100755 --- a/components/9990-main.sh +++ b/components/9990-main.sh @@ -57,8 +57,19 @@ Live () if [ $? -eq 0 ] then # We found a memdisk, set up phram - modprobe phram phram=memdisk,${MEMDISK} - modprobe phram phram=memdisk,${MEMDISK} + # Sometimes "modprobe phram" can not successfully create /dev/mtd0. + # Have to try several times. + max_try=20 + while [ ! -c /dev/mtd0 -a "$max_try" -gt 0 ]; do + modprobe phram phram=memdisk,${MEMDISK} + sleep 0.2 + if [ -c /dev/mtd0 ]; then + break + else + rmmod phram + fi + max_try=$((max_try - 1)) + done # Load mtdblock, the memdisk will be /dev/mtdblock0 modprobe mtdblock @@ -111,10 +122,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 @@ -174,6 +185,13 @@ 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 @@ -182,5 +200,7 @@ Live () 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 ) }