Instead of specifing an actual device name, the keyword 'removable' can be used
to limit the search of acceptable live media to removable type only. Note that
-cdrom devices are not removable, but e.g. usb mass storage is.
+if you want to further restrict the media to usb mass storage only, you can use
+the 'removable-usb' keyword.
{live-media-encryption|encryption}=**TYPE**::
done
;;
+ removable-usb)
+ for sysblock in $(echo /sys/block/* | tr ' ' '\n' | grep -vE "/(loop|ram|dm-|fd)")
+ do
+ if [ "$(cat ${sysblock}/removable)" = "1" ] && readlink ${sysblock}/device | grep -q usb
+ then
+ for dev in $(subdevices "${sysblock}")
+ do
+ if check_dev "${dev}"
+ then
+ return 0
+ fi
+ done
+ fi
+ done
+ ;;
+
*)
if [ ! -z "${LIVE_MEDIA}" ]
then