X-Git-Url: http://git.grml.org/?p=live-boot-grml.git;a=blobdiff_plain;f=components%2F9990-misc-helpers.sh;h=1b89e59349006fa77f496a419d595b262cfee615;hp=e21fceda886965af22c72976a6a210f4c0db062d;hb=0bfbe98e1363a0617b35d528907fbd5cf669a97d;hpb=0d878d3a679820d570a20c0fa1c1a2c5b92ad037 diff --git a/components/9990-misc-helpers.sh b/components/9990-misc-helpers.sh index e21fced..1b89e59 100755 --- a/components/9990-misc-helpers.sh +++ b/components/9990-misc-helpers.sh @@ -95,6 +95,7 @@ is_nice_device () check_dev () { + local force fix sysdev="${1}" devname="${2}" skip_uuid_check="${3}" @@ -119,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 @@ -195,6 +213,33 @@ check_dev () then devuid=$(blkid -o value -s UUID "$devname") [ -n "$devuid" ] && grep -qs "\<$devuid\>" /var/lib/live/boot/devices-already-tried-to-mount && continue + + for _PARAMETER in ${LIVE_BOOT_CMDLINE} + do + case "${_PARAMETER}" in + forcefsck) + FORCEFSCK="true" + ;; + esac + done + + if [ "${PERSISTENCE_FSCK}" = "true" ] || [ "${PERSISTENCE_FSCK}" = "yes" ] || [ "${FORCEFSCK}" = "true" ] + then + force="" + if [ "$FORCEFSCK" = "true" ] + then + force="-f" + fi + + fix="-a" + if [ "$FSCKFIX" = "true" ] || [ "$FSCKFIX" = "yes" ] + then + fix="-y" + fi + + fsck $fix $force ${devname} >> fsck.log 2>&1 + fi + mount -t ${fstype} -o ro,noatime "${devname}" ${mountpoint} || continue [ -n "$devuid" ] && echo "$devuid" >> /var/lib/live/boot/devices-already-tried-to-mount @@ -1026,7 +1071,7 @@ find_persistence_media () # in one union together. # black_listed_devices="" - for d in /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 @@ -1341,7 +1386,7 @@ do_union () get_custom_mounts () { - # Side-effect: leaves $devices with persistence.conf mounted in /live/persistence + # Side-effect: leaves $devices with persistence.conf mounted in /run/live/persistence # Side-effect: prints info to file $custom_mounts local custom_mounts devices bindings links @@ -1372,7 +1417,7 @@ get_custom_mounts () if [ -n "${LIVE_BOOT_DEBUG}" ] && [ -e "${include_list}" ] then - cp ${include_list} /live/persistence/${persistence_list}.${device_name} + cp ${include_list} /run/live/persistence/${persistence_list}.${device_name} fi while read dir options # < ${include_list} @@ -1557,7 +1602,7 @@ activate_custom_mounts () rootfs_dest_backing="" if [ -n "${opt_link}" ] || [ -n "${opt_union}" ] then - for d in /live/rootfs/* + for d in /run/live/rootfs/* do if [ -n "${rootmnt}" ] then