Skip to content

Commit

Permalink
Fixing persistence-media option when no devices are attached.
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
Tails developers authored and daniel-baumann committed Dec 7, 2012
1 parent 389a479 commit 2026ce0
Showing 1 changed file with 29 additions and 22 deletions.
51 changes: 29 additions & 22 deletions scripts/boot/9990-overlay.sh
Expand Up @@ -189,37 +189,44 @@ 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
overlays="${custom_overlay_label}"
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
${custom_overlay_label}=*)
device="${media#*=}"
overlay_devices="${overlay_devices} ${device}"
;;
esac
done
case ${media} in
${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
Expand Down

0 comments on commit 2026ce0

Please sign in to comment.