Search for partition labels only (Closes: #486469).
authorMarco Amadori <marco.amadori@gmail.com>
Sat, 27 Sep 2008 09:18:15 +0000 (11:18 +0200)
committerDaniel Baumann <daniel@debian.org>
Wed, 9 Mar 2011 16:48:02 +0000 (17:48 +0100)
* Added new way to call "persistent" at boot:
  "persistent=nofiles" will skip the scan for image files in block
  device and it will only search for partition labels.

docs/parameters.txt
manpages/live-initramfs.en.7.txt
scripts/live
scripts/live-helpers

index e09089d..fd05339 100644 (file)
@@ -38,7 +38,7 @@ live nosudo
 live swapon
 live nouser
 live noxautoconfig
-live persistent
+live persistent[=nofiles]
 live {preseed/file|file}=FILE
 live package/question=VALUE
 live quickreboot
index a66a85c..f42a9ce 100644 (file)
@@ -197,14 +197,16 @@ This parameter disables Xorg auto-reconfiguration at boot time. This is valuable
 if you either do the detection on your own, or, if you want to ship a custom,
 premade xorg.conf in your live system.
 
-  persistent::
+  persistent[=nofiles]::
 
 live-initramfs will look for persistent and snapshot partitions or files labeled
 "live-rw", "home-rw", and files called "live-sn*", "home-sn*" and will try to,
 in order: mount as /cow the first, mount the second in /home, and just copy the
 contents of the latter in appropriate locations (snapshots). Snapshots will be
 tried to be updated on reboot/shutdown. Look at live-snapshot(1) for more
-informations.
+informations. If "nofiles" is specified too, only labels will be searched and no
+filesystems will be mounted for searching file images or archives; this will
+results in improved boot times.
 
   {preseed/file|file}=**FILE**::
 
index 7e0b100..8761138 100755 (executable)
@@ -326,6 +326,15 @@ Arguments ()
                                export PERSISTENT
                                ;;
 
+                       persistent=*)
+                               PERSISTENT="${ARGUMENT#persistent=}"
+                               if [ -z "${PERSISTENT}" ]
+                               then
+                                       PERSISTENT="Yes"
+                               fi
+                               export PERSISTENT
+                               ;;
+
                        nopersistent)
                                NOPERSISTENT="Yes"
                                export NOPERSISTENT
@@ -881,7 +890,13 @@ find_snap ()
 {
        # Look for ${snap_label}.* in block devices
        snap_label="${1}"
-       snapdata=$(find_files "${snap_label}.squashfs ${snap_label}.cpio.gz ${snap_label}.ext2 ${snap_label}.ext3 ${snap_label}.jffs2")
+
+       if [ "${PERSISTENT}" != "nofiles" ]
+       then
+               # search for image files
+               snapdata=$(find_files "${snap_label}.squashfs ${snap_label}.cpio.gz ${snap_label}.ext2 ${snap_label}.ext3 ${snap_label}.jffs2")
+       fi
+
        if [ -z "${snapdata}" ]
        then
                snapdata=$(find_cow_device "${snap_label}")
index 44bb12a..a935001 100644 (file)
@@ -313,6 +313,13 @@ find_cow_device ()
                                return
                        fi
 
+                       if [ "${PERSISTENT}" = "nofiles" ]
+                       then
+                               # do not mount the device to find for image files
+                               # just skip this
+                               break
+                       fi
+
                        case "$(get_fstype ${devname})" in
                                vfat|ext2|ext3|jffs2)
                                        mkdir -p "${cow_backing}"