filesystem should reside. If it did not find something usable, the normal scan
for block devices is performed.
+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.
+
{live-media-encryption|encryption}=**TYPE**::
live-initramfs will mount the encrypted rootfs TYPE, asking the passphrase,
fi
# first look at the one specified in the command line
- if [ ! -z "${LIVE_MEDIA}" ]
- then
- if check_dev "null" "${LIVE_MEDIA}" "skip_uuid_check"
- then
- return 0
- fi
- fi
+ case "${LIVE_MEDIA}" in
+ removable)
+ for sysblock in $(echo /sys/block/* | tr ' ' '\n' | grep -vE "/(loop|ram|dm-|fd)")
+ do
+ if [ "$(cat ${sysblock}/removable)" = "1" ]
+ then
+ for dev in $(subdevices "${sysblock}")
+ do
+ if check_dev "${dev}"
+ then
+ return 0
+ fi
+ done
+ fi
+ done
+ ;;
+
+ *)
+ if [ ! -z "${LIVE_MEDIA}" ]
+ then
+ if check_dev "null" "${LIVE_MEDIA}" "skip_uuid_check"
+ then
+ return 0
+ fi
+ fi
+ ;;
+ esac
# or do the scan of block devices
for sysblock in $(echo /sys/block/* | tr ' ' '\n' | grep -vE "/(loop|ram|dm-|fd)")