X-Git-Url: http://git.grml.org/?a=blobdiff_plain;f=components%2F9990-misc-helpers.sh;h=1b89e59349006fa77f496a419d595b262cfee615;hb=8d2dac82e4d75ef257dda8304eed41b77b20bd07;hp=60709deec6770cb3715ac54a4c83d53aafd79ace;hpb=be43356ae81473996fca970550b5fde40e240ac8;p=live-boot-grml.git diff --git a/components/9990-misc-helpers.sh b/components/9990-misc-helpers.sh index 60709de..1b89e59 100755 --- a/components/9990-misc-helpers.sh +++ b/components/9990-misc-helpers.sh @@ -120,15 +120,32 @@ check_dev () if [ "$ISO_DEVICE" = "/" ] then - echo "Warning: device for bootoption fromiso= ($FROMISO) not found.">>/boot.log + # not a block device, check if it's an iso file, for + # example an ISO when booting on an ONIE system + if echo "${FROMISO}" | grep -q "\.iso$" + then + fs_type=$(get_fstype "${FROMISO}") + if is_supported_fs ${fs_type} + then + mkdir /run/live/fromiso + mount -t $fs_type "${FROMISO}" /run/live/fromiso + if [ "$?" != 0 ] + then + echo "Warning: unable to mount ${FROMISO}." >>/boot.log + fi + devname="/run/live/fromiso" + fi + else + echo "Warning: device for bootoption fromiso= ($FROMISO) not found.">>/boot.log + fi else fs_type=$(get_fstype "${ISO_DEVICE}") if is_supported_fs ${fs_type} then - mkdir /live/fromiso - mount -t $fs_type "$ISO_DEVICE" /live/fromiso + mkdir /run/live/fromiso + mount -t $fs_type "$ISO_DEVICE" /run/live/fromiso ISO_NAME="$(echo $FROMISO | sed "s|$ISO_DEVICE||")" - loopdevname=$(setup_loop "/live/fromiso/${ISO_NAME}" "loop" "/sys/block/loop*" "" '') + loopdevname=$(setup_loop "/run/live/fromiso/${ISO_NAME}" "loop" "/sys/block/loop*" "" '') devname="${loopdevname}" else echo "Warning: unable to mount $ISO_DEVICE." >>/boot.log @@ -1054,7 +1071,7 @@ find_persistence_media () # in one union together. # black_listed_devices="" - for d in /run/live/rootfs/* /live/findiso /live/fromiso + for d in /run/live/rootfs/* /run/live/findiso /run/live/fromiso do black_listed_devices="${black_listed_devices} $(what_is_mounted_on d)" done