From d5b20626bc2cab7926097d39e6a8cba146dd361a Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Thu, 22 Jan 2009 17:39:39 +0100 Subject: [PATCH] Adding patch from Thierry Walrant to allow setting a path for the persistence files through persistent-path boot parameter (Closes: #512661). --- scripts/live | 5 +++++ scripts/live-helpers | 11 +++++++++-- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/scripts/live b/scripts/live index d06dd20..bf90781 100755 --- a/scripts/live +++ b/scripts/live @@ -340,6 +340,11 @@ Arguments () export PERSISTENT ;; + persistent-path=*) + PERSISTENT_PATH="${ARGUMENT#persistent-path=}" + export PERSISTENT_PATH + ;; + nopersistent) NOPERSISTENT="Yes" export NOPERSISTENT diff --git a/scripts/live-helpers b/scripts/live-helpers index 8875248..8970834 100644 --- a/scripts/live-helpers +++ b/scripts/live-helpers @@ -299,6 +299,13 @@ find_cow_device () cow_backing="/${pers_label}-backing" black_listed_devices="${2}" + if [ -z "${PERSISTENT_PATH}" ] + then + pers_fpath=${cow_backing}/${pers_label} + else + pers_fpath=${cow_backing}/${PERSISTENT_PATH}/${pers_label} + fi + for sysblock in $(echo /sys/block/* | tr ' ' '\n' | grep -v loop | grep -v ram | grep -v fd) do for dev in $(subdevices "${sysblock}") @@ -332,9 +339,9 @@ find_cow_device () break fi - if [ -f "${cow_backing}/${pers_label}" ] + if [ -f "${pers_fpath}" ] then - echo $(setup_loop "${cow_backing}/${pers_label}" "loop" "/sys/block/loop*") + echo $(setup_loop "${pers_fpath}" "loop" "/sys/block/loop*") return 0 else umount ${cow_backing} -- 2.1.4