Do not print misleading debug message if the snapshot was found correctly.
[live-boot-grml.git] / scripts / live
index 6f04b86..3a6094f 100755 (executable)
@@ -51,14 +51,11 @@ Arguments ()
                case "${ARGUMENT}" in
                        skipconfig)
                                NOACCESSIBILITY="Yes"
-                               NOAUTOLOGIN="Yes"
-                               NOCONSOLEKEYBOARD="Yes"
                                NOFASTBOOT="Yes"
                                NOFSTAB="Yes"
                                NONETWORKING="Yes"
-                               NOXAUTOCONFIG="Yes"
 
-                               export NOACCESSIBILITY NOAUTOLOGIN NOCONSOLEKEYBOARD NOFASTBOOT NOFSTAB NONETWORKING NOXAUTOCONFIG
+                               export NOACCESSIBILITY NOFASTBOOT NOFSTAB NONETWORKING
                                ;;
 
                        access=*)
@@ -218,11 +215,6 @@ Arguments ()
                                export NOACCESSIBILITY
                                ;;
 
-                       noautologin)
-                               NOAUTOLOGIN="Yes"
-                               export NOAUTOLOGIN
-                               ;;
-
                        nofastboot)
                                NOFASTBOOT="Yes"
                                export NOFASTBOOT
@@ -243,11 +235,6 @@ Arguments ()
                                export SWAPON
                                ;;
 
-                       noxautoconfig)
-                               NOXAUTOCONFIG="Yes"
-                               export NOXAUTOCONFIG
-                               ;;
-
                        persistent)
                                PERSISTENT="Yes"
                                export PERSISTENT
@@ -351,21 +338,6 @@ Arguments ()
                                UNIONTYPE="${ARGUMENT#union=}"
                                export UNIONTYPE
                                ;;
-
-                       xdebconf)
-                               XDEBCONF="Yes"
-                               export XDEBCONF
-                               ;;
-
-                       xdriver=*)
-                               XDRIVER="${ARGUMENT#xdriver=}"
-                               export XDRIVER
-                               ;;
-
-                       xvideomode=*)
-                               XVIDEOMODE="${ARGUMENT#xvideomode=}"
-                               export XVIDEOMODE
-                               ;;
                esac
        done
 
@@ -992,19 +964,20 @@ try_snap ()
                snapback="$(echo ${snapdata} | cut -f2 -d ' ')"
                snapfile="$(echo ${snapdata} | cut -f3 -d ' ')"
 
-               RES=""
                if ! try_mount "${snapdev}" "${snapback}" "ro"
                then
                        break
                fi
 
+               RES="0"
+
                if echo "${snapfile}" | grep -qs '\(squashfs\|ext2\|ext3\|ext4\|jffs2\)'
                then
                        # squashfs, jffs2 or ext2/ext3/ext4 snapshot
                        dev=$(get_backing_device "${snapback}/${snapfile}")
 
                        do_snap_copy "${dev}" "${snap_mount}" "${snap_type}"
-                       RES=$?
+                       RES="$?"
                else
                        # cpio.gz snapshot
 
@@ -1020,9 +993,12 @@ try_snap ()
                                cpioargs='--unconditional --make-directories'
                        fi
 
-                       if ! (cd "${snap_mount}" && zcat "${snapback}/${snapfile}" | cpio $cpioargs --extract --preserve-modification-time --no-absolute-filenames --sparse 2>/dev/null)
+                       cd "${snap_mount}" && zcat "${snapback}/${snapfile}" | $cpiopath $cpioargs --extract --preserve-modification-time --no-absolute-filenames --sparse 2>/dev/null
+                       RES="$?"
+
+                       if [ "${RES}" != "0" ]
                        then
-                               log_warning_msg "failure to \"zcat ${snapback}/${snapfile} | cpio $cpioargs --extract --preserve-modification-time --no-absolute-filenames --sparse\""
+                               log_warning_msg "failure to \"zcat ${snapback}/${snapfile} | $cpiopath $cpioargs --extract --preserve-modification-time --no-absolute-filenames --sparse\""
                        fi
                fi
 
@@ -1732,6 +1708,20 @@ mountroot ()
                        # Do a local boot from hd
                        livefs_root=${ROOT}
                else
+                       if [ -x /usr/bin/memdiskfind ]
+                       then
+                               MEMDISK=$(/usr/bin/memdiskfind)
+
+                               if [ $? -eq 0 ]
+                               then
+                                       # We found a memdisk, set up phram
+                                       modprobe phram phram=memdisk,${MEMDISK}
+
+                                       # Load mtdblock, the memdisk will be /dev/mtdblock0
+                                       modprobe mtdblock
+                               fi
+                       fi
+
                        # Scan local devices for the image
                        i=0
                        while [ "$i" -lt 60 ]