From 990480f58dde1722f8ab87514b4443c1ea418b85 Mon Sep 17 00:00:00 2001 From: Marco Amadori Date: Sat, 27 Sep 2008 11:18:15 +0200 Subject: [PATCH] Search for partition labels only (Closes: #486469). * 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 | 2 +- manpages/live-initramfs.en.7.txt | 6 ++++-- scripts/live | 17 ++++++++++++++++- scripts/live-helpers | 7 +++++++ 4 files changed, 28 insertions(+), 4 deletions(-) diff --git a/docs/parameters.txt b/docs/parameters.txt index e09089d..fd05339 100644 --- a/docs/parameters.txt +++ b/docs/parameters.txt @@ -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 diff --git a/manpages/live-initramfs.en.7.txt b/manpages/live-initramfs.en.7.txt index a66a85c..f42a9ce 100644 --- a/manpages/live-initramfs.en.7.txt +++ b/manpages/live-initramfs.en.7.txt @@ -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**:: diff --git a/scripts/live b/scripts/live index 7e0b100..8761138 100755 --- a/scripts/live +++ b/scripts/live @@ -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}") diff --git a/scripts/live-helpers b/scripts/live-helpers index 44bb12a..a935001 100644 --- a/scripts/live-helpers +++ b/scripts/live-helpers @@ -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}" -- 2.1.4