summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorTails developers <amnesia@boum.org>2011-11-08 21:14:59 +0100
committerDaniel Baumann <daniel@debian.org>2011-11-24 09:42:08 +0100
commit959403d20e2259c10de7ef55b9226c40812eabd7 (patch)
treeb773d5fb87e6dea1d10a7098a327999c37cbc90b /scripts
parent5d975eaa4e1bc4094c8d3cca3e9e1087dc0d061b (diff)
downloadlive-boot-959403d20e2259c10de7ef55b9226c40812eabd7.tar.gz
live-boot-959403d20e2259c10de7ef55b9226c40812eabd7.zip
Adding persistent-method=METHOD...
The comma-separated list METHOD... specifies which types of persistent setups we allow. Current possible METHODs are {snapshot, overlay}. The default value is both, i.e. persistent-method=snapshot,overlay.
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/live57
1 files changed, 37 insertions, 20 deletions
diff --git a/scripts/live b/scripts/live
index 24dc468..c3732fe 100755
--- a/scripts/live
+++ b/scripts/live
@@ -253,6 +253,10 @@ Arguments ()
PERSISTENT_MEDIA="${ARGUMENT#*=}"
export PERSISTENT_MEDIA
;;
+ persistent-method=*)
+ PERSISTENT_METHOD="${ARGUMENT#*=}"
+ export PERSISTENT_METHOD
+ ;;
persistent-path=*)
PERSISTENT_PATH="${ARGUMENT#persistent-path=}"
@@ -387,6 +391,12 @@ Arguments ()
export UNIONTYPE
fi
+ if [ -n "${PERSISTENT}" ] && [ -z "${PERSISTENT_METHOD}" ]
+ then
+ PERSISTENT_METHOD="snapshot,overlay"
+ export PERSISTENT_METHOD
+ fi
+
if [ -n "${PERSISTENT}" ] && [ -z "${PERSISTENT_STORAGE}" ]
then
PERSISTENT_STORAGE="filesystem,file"
@@ -1385,30 +1395,37 @@ setup_unionfs ()
;;
esac
- # search for label and files (this could be hugely optimized)
- cowprobe=$(find_cow_device "${root_persistence}" "${blacklistdev}" "${whitelistdev}")
- if [ -b "${cowprobe}" ]
+ if echo ${PERSISTENT_METHOD} | grep -qw overlay
then
- # Blacklist /cow device, to avoid inconsistent setups for overlapping snapshots
- # makes sense to have both persistence for /cow and /home mounted, maybe also with
- # snapshots to be sure to really store some e.g key config files,
- # but not on the same media
- blacklistdev="${cowprobe}"
- PERSISTENCE_IS_ON="1"
- export PERSISTENCE_IS_ON
+ # search for label and files (this could be hugely optimized)
+ cowprobe=$(find_cow_device "${root_persistence}" "${blacklistdev}" "${whitelistdev}")
+ if [ -b "${cowprobe}" ]
+ then
+ # Blacklist /cow device, to avoid inconsistent setups for overlapping snapshots
+ # makes sense to have both persistence for /cow and /home mounted, maybe also with
+ # snapshots to be sure to really store some e.g key config files,
+ # but not on the same media
+ blacklistdev="${cowprobe}"
+ PERSISTENCE_IS_ON="1"
+ export PERSISTENCE_IS_ON
+ fi
+ # homecow just mount something on /home, this should be generalized some way
+ homecow=$(find_cow_device "${home_persistence}" "${blacklistdev}" "${whitelistdev}")
+ if [ -b "${homecow}" ]
+ then
+ PERSISTENCE_IS_ON="1"
+ export PERSISTENCE_IS_ON
+ fi
fi
- # homecow just mount something on /home, this should be generalized some way
- homecow=$(find_cow_device "${home_persistence}" "${blacklistdev}" "${whitelistdev}")
- if [ -b "${homecow}" ]
+
+ if echo ${PERSISTENT_METHOD} | grep -qw snapshot
then
- PERSISTENCE_IS_ON="1"
- export PERSISTENCE_IS_ON
+ root_snapdata=$(find_snap "${root_snapshot_label}" "${blacklistdev}" "${whitelistdev}")
+ # This second type should be removed when snapshot will get smarter,
+ # hence when "/etc/live-snapshot*list" will be supported also by
+ # ext2|ext3|ext4|jffs2 snapshot types.
+ home_snapdata=$(find_snap "${home_snapshot_label}" "${blacklistdev}" "${whitelistdev}")
fi
- root_snapdata=$(find_snap "${root_snapshot_label}" "${blacklistdev}" "${whitelistdev}")
- # This second type should be removed when snapshot will get smarter,
- # hence when "/etc/live-snapshot*list" will be supported also by
- # ext2|ext3|ext4|jffs2 snapshot types.
- home_snapdata=$(find_snap "${home_snapshot_label}" "${blacklistdev}" "${whitelistdev}")
if [ -b "${cowprobe}" ]
then