X-Git-Url: http://git.grml.org/?a=blobdiff_plain;f=components%2F9990-main.sh;h=7fb7ed367513e392fae554e6568322785920725c;hb=322e57a4a7c972702e93038df009c045286bffbd;hp=b50952fe1af877a9657882ddcc8130f0c3942c12;hpb=9b976b577df4fe25e8affc3d54c0936f96bc0c7f;p=live-boot-grml.git diff --git a/components/9990-main.sh b/components/9990-main.sh index b50952f..7fb7ed3 100755 --- a/components/9990-main.sh +++ b/components/9990-main.sh @@ -52,25 +52,31 @@ Live () else if [ -x /usr/bin/memdiskfind ] then - if MEMDISK=$(/usr/bin/memdiskfind) + if ! dd if=/dev/mem of=/dev/zero bs=1 count=1 >/dev/null 2>&1 then - # We found a memdisk, set up phram - # Sometimes "modprobe phram" can not successfully create /dev/mtd0. - # Have to try several times. - max_try=20 - while [ ! -c /dev/mtd0 ] && [ "$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 + log_begin_msg "access to /dev/mem is restriced, skipping memdiskfind" + log_end_msg + else + if MEMDISK=$(/usr/bin/memdiskfind) + then + # We found a memdisk, set up phram + # Sometimes "modprobe phram" can not successfully create /dev/mtd0. + # Have to try several times. + max_try=20 + while [ ! -c /dev/mtd0 ] && [ "$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 + fi fi fi @@ -205,10 +211,15 @@ Live () 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}