--- casper_1.330/scripts/casper-helpers.orig 2011-05-05 04:13:38.000000000 -0700 +++ casper_1.330/scripts/casper-helpers 2013-04-11 06:49:14.000000000 -0700 @@ -192,15 +192,10 @@ } find_cow_device() { - pers_label="${1}" + pers_fpath="${1#/}" + pers_label=$(echo "${pers_fpath}" | tr / -) cow_backing="/${pers_label}-backing" - if [ -z "${PERSISTENT_PATH}" ]; then - pers_fpath=${pers_label} - else - pers_fpath=${PERSISTENT_PATH}/${pers_label} - fi - for sysblock in $(echo /sys/block/* | tr ' ' '\n' | grep -v loop); do # do not ever probe floppies, probing nonexistant ones delays the boot to half an hour and longer n=${sysblock##*/} --- casper_1.330/scripts/casper.orig 2012-12-03 06:33:08.000000000 -0800 +++ casper_1.330/scripts/casper 2013-04-11 12:12:39.000000000 -0700 @@ -40,7 +40,11 @@ nopersistent) export PERSISTENT="" ;; persistent-path=*) - export PERSISTENT_PATH="${x#persistent-path=}" ;; + export PERSISTENT_PATH="${x#persistent-path=}" PERSISTENT="Yes" ;; + persistent-root=*) + export PERSISTENT_ROOT="${x#persistent-root=}" PERSISTENT="Yes" ;; + persistent-home=*) + export PERSISTENT_HOME="${x#persistent-home=}" PERSISTENT="Yes" ;; union=*) export UNIONFS="${x#union=}";; ip=*) @@ -347,7 +351,7 @@ fi umount "${snapback}" else - dev=$(find_cow_device "${snap_label}") + dev=$(find_cow_device "${PERSISTENT_PATH%/}/${snap_label}") if [ -b "${dev}" ]; then if echo "${dev}" | grep -qs loop; then # strange things happens, user confused? @@ -450,7 +454,7 @@ # Looking for "${root_persistence}" device or file if [ -n "${PERSISTENT}" ]; then - cowprobe=$(find_cow_device "${root_persistence}") + cowprobe=$(find_cow_device "${PERSISTENT_ROOT:-${PERSISTENT_PATH%/}/${root_persistence}}") if [ -b "${cowprobe}" ]; then cowdevice=${cowprobe} cow_fstype=$(get_fstype "${cowprobe}") @@ -497,7 +501,7 @@ if [ -n "${PERSISTENT}" ]; then # directly mount /home # FIXME: add a custom mounts configurable system - homecow=$(find_cow_device "${home_persistence}" ) + homecow=$(find_cow_device "${PERSISTENT_HOME:-${PERSISTENT_PATH%/}/${home_persistence}}") if [ -b "${homecow}" ]; then mount -t $(get_fstype "${homecow}") -o rw,noatime "${homecow}" "${rootmnt}/home" export HOMEMOUNTED=1 # used to proper calculate free space in do_snap_copy()