diff options
| author | Tails developers <amnesia@boum.org> | 2012-12-07 22:30:27 +0100 |
|---|---|---|
| committer | Daniel Baumann <daniel@debian.org> | 2012-12-07 22:30:27 +0100 |
| commit | 2f02d72b1816c4d8b59c10c56bd747f8f01e4d1e (patch) | |
| tree | 020b145b85b360aa71063102092a1ac61b3cf6ad /scripts/boot | |
| parent | c32e1b2f0f8cbf4a11d198824f463cf7f7455a76 (diff) | |
| download | live-boot-2f02d72b1816c4d8b59c10c56bd747f8f01e4d1e.tar.gz live-boot-2f02d72b1816c4d8b59c10c56bd747f8f01e4d1e.zip | |
Fixing persistence-media option when no devices are attached.
Earlier, if it was set to e.g. 'removable-usb' and no USB storage was
connected, $whitelistdev would be empty, which is interpreted like all
devices are ok by the rest of the code.
Diffstat (limited to 'scripts/boot')
| -rwxr-xr-x | scripts/boot/9990-overlay.sh | 71 |
1 files changed, 39 insertions, 32 deletions
diff --git a/scripts/boot/9990-overlay.sh b/scripts/boot/9990-overlay.sh index b54a2da..96c3331 100755 --- a/scripts/boot/9990-overlay.sh +++ b/scripts/boot/9990-overlay.sh @@ -189,19 +189,23 @@ setup_unionfs () done fi - case "${PERSISTENCE_MEDIA}" in - removable) - whitelistdev="$(removable_dev)" - ;; - - removable-usb) - whitelistdev="$(removable_usb_dev)" - ;; + local whitelistdev="" + if [ -n "${PERSISTENCE_MEDIA}" ] + then + case "${PERSISTENCE_MEDIA}" in + removable) + whitelistdev="$(removable_dev)" + ;; - *) - whitelistdev="" - ;; - esac + removable-usb) + whitelistdev="$(removable_usb_dev)" + ;; + esac + if [ -z "${whitelistdev}" ] + then + whitelistdev="ignore_all_devices" + fi + fi if is_in_comma_sep_list overlay ${PERSISTENCE_METHOD} then @@ -209,29 +213,32 @@ setup_unionfs () fi local overlay_devices="" - for media in $(find_persistence_media "${overlays}" "${whitelistdev}") - do - media="$(echo ${media} | tr ":" " ")" + if [ "${whitelistdev}" != "ignore_all_devices" ] + then + for media in $(find_persistence_media "${overlays}" "${whitelistdev}") + do + media="$(echo ${media} | tr ":" " ")" - case ${media} in - ${old_root_overlay_label}=*) - device="${media#*=}" - fix_backwards_compatibility ${device} / union - overlay_devices="${overlay_devices} ${device}" - ;; + case ${media} in + ${old_root_overlay_label}=*) + device="${media#*=}" + fix_backwards_compatibility ${device} / union + overlay_devices="${overlay_devices} ${device}" + ;; - ${old_home_overlay_label}=*) - device="${media#*=}" - fix_backwards_compatibility ${device} /home bind - overlay_devices="${overlay_devices} ${device}" - ;; + ${old_home_overlay_label}=*) + device="${media#*=}" + fix_backwards_compatibility ${device} /home bind + overlay_devices="${overlay_devices} ${device}" + ;; - ${custom_overlay_label}=*) - device="${media#*=}" - overlay_devices="${overlay_devices} ${device}" - ;; - esac - done + ${custom_overlay_label}=*) + device="${media#*=}" + overlay_devices="${overlay_devices} ${device}" + ;; + esac + done + fi elif [ -n "${NFS_COW}" ] && [ -z "${NOPERSISTENCE}" ] then # check if there are any nfs options |
