X-Git-Url: http://git.grml.org/?a=blobdiff_plain;f=scripts%2Flive-helpers;h=26414877b782f64046a03f245218acc6c4e17131;hb=1736a26b70a1af93c290cfa9f4e7b593b7554d22;hp=0b9bd5ffecf2f78ec50d971e0f0e3d854d5f61f8;hpb=44ed93e9a7fafb96bd0f4f937ae369e963bd3420;p=live-boot-grml.git diff --git a/scripts/live-helpers b/scripts/live-helpers index 0b9bd5f..2641487 100644 --- a/scripts/live-helpers +++ b/scripts/live-helpers @@ -146,7 +146,7 @@ fs_size () mountp="/mnt/tmp_fs_size" mkdir -p "${mountp}" - mount -t $(get_fstype "${dev}") -o ro "${dev}" "${mountp}" + mount -t $(get_fstype "${dev}") -o ro "${dev}" "${mountp}" || log_warning_msg "cannot mount -t $(get_fstype ${dev}) -o ro ${dev} ${mountp}" doumount=1 fi @@ -163,7 +163,7 @@ fs_size () if [ -n "${doumount}" ] then - umount "${mountp}" + umount "${mountp}" || log_warning_msg "cannot umount ${mountp}" rmdir "${mountp}" fi @@ -341,16 +341,19 @@ find_files () if is_supported_fs ${devfstype} then mkdir -p "${snap_backing}" - try_mount "${devname}" "${snap_backing}" "ro" ${devfstype} - for filename in ${filenames} + if try_mount "${devname}" "${snap_backing}" "ro" "${devfstype}" + then + for filename in ${filenames} do - if [ -f "${snap_backing}/${filename}" ] - then - echo "${devname} ${snap_backing} ${filename}" - return 0 - fi - done + if [ -f "${snap_backing}/${filename}" ] + then + echo "${devname} ${snap_backing} ${filename}" + # return without mounting, it will be umounted later + return 0 + fi + done + fi umount ${snap_backing} fi