From 41112e3945280cb19dab1fed2b224a763e97fe55 Mon Sep 17 00:00:00 2001 From: Tails developers Date: Mon, 1 Nov 2010 18:30:19 +0100 Subject: [PATCH] Adding support for persistent-media={removable,removable-usb}. This is e.g. needed when one's threat model does not allow her to trust the local hard disks. --- manpages/en/live-boot.7 | 2 ++ scripts/live | 18 ++++++++++++++++++ 2 files changed, 20 insertions(+) diff --git a/manpages/en/live-boot.7 b/manpages/en/live-boot.7 index 0a88d51..c4d4d6a 100644 --- a/manpages/en/live-boot.7 +++ b/manpages/en/live-boot.7 @@ -112,6 +112,8 @@ live\-boot will look for persistent and snapshot partitions or files labeled "li If "nofiles" is specified, only filesystems with matching labels will be searched; no filesystems will be traversed looking for archives or image files. This results in shorter boot times. .br If "cryptsetup" is specified, filesystems stored on Luks\-encrypted devices will be considered as well as others when searching for a persistence filesystem; the user will be prompted for any needed decryption passphrase. +.IP "\fBpersistent\-media\fR={\fIremovable\fR|\fIremovable\-usb\fR}" 4 +If you specify the keyword 'removable', live\-boot will try to find persistent and snapshot partitions on removable media only. Note that if you want to further restrict the media to usb mass storage only, you can use the 'removable\-usb' keyword. .IP "\fBpersistent\-path\fR=\fIPATH\fR" 4 live\-boot will look for persistency files in the root directory of a partition, with this parameter, the path can be configured so that you can have multiple directories on the same partition to store persistency files. .IP "\fBpersistent\-subtext\fR=\fISUFFIX\fR" 4 diff --git a/scripts/live b/scripts/live index 952d479..c2ad14e 100755 --- a/scripts/live +++ b/scripts/live @@ -253,6 +253,11 @@ Arguments () export PERSISTENT ;; + persistent-media=*) + PERSISTENT_MEDIA="${ARGUMENT#*=}" + export PERSISTENT_MEDIA + ;; + persistent-path=*) PERSISTENT_PATH="${ARGUMENT#persistent-path=}" export PERSISTENT_PATH @@ -1324,6 +1329,7 @@ setup_unionfs () # Looking for "${root_persistence}" device or file if [ -n "${PERSISTENT}" ] && [ -z "${NOPERSISTENT}" ] then + if [ -z "${QUICKUSBMODULES}" ] then # Load USB modules @@ -1351,6 +1357,18 @@ setup_unionfs () done fi + case "${PERSISTENT_MEDIA}" in + removable) + whitelistdev="$(removable_dev)" + ;; + removable-usb) + whitelistdev="$(removable_usb_dev)" + ;; + *) + whitelistdev="" + ;; + esac + # search for label and files (this could be hugely optimized) cowprobe=$(find_cow_device "${root_persistence}" "${blacklistdev}" "${whitelistdev}") if [ -b "${cowprobe}" ] -- 2.1.4