X-Git-Url: http://git.grml.org/?a=blobdiff_plain;f=scripts%2Flive-helpers;h=314c33f59dd4599c8f60c5cece0f529815e58fd2;hb=e66f79476042794195978ee641aa7ea0d9ca6e0a;hp=1b4286d17fdb3e02ed9346d22744c126dbdd5986;hpb=85e2939c446d0ead490be57d0a0edac9f6a3f772;p=live-boot-grml.git diff --git a/scripts/live-helpers b/scripts/live-helpers index 1b4286d..314c33f 100644 --- a/scripts/live-helpers +++ b/scripts/live-helpers @@ -1,4 +1,4 @@ -# live-initramfs helper functions, used by live-initramfs on boot and by live-snapshot +# live-boot helper functions, used by live-boot on boot and by live-snapshot if [ ! -x "/bin/fstype" ] then @@ -76,16 +76,14 @@ is_supported_fs () get_fstype () { - # udev >=146-1 no longer provides vol_id: + # udev (>= 146) no longer provides vol_id if [ -x /lib/udev/vol_id ] then + # lenny /lib/udev/vol_id -t ${1} 2>/dev/null else - eval $(blkid -o udev "${1}") - if [ -n "$ID_FS_TYPE" ] - then - echo "${ID_FS_TYPE}" - fi + # squeeze + /sbin/blkid -s TYPE -o value $1 2>/dev/null fi } @@ -189,7 +187,11 @@ setup_loop () local encryption=${5} local readonly=${6} - modprobe -q -b "${module}" + # the output of setup_loop is evaluated in other functions, + # modprobe leaks kernel options like "libata.dma=0" + # as "options libata dma=0" on stdout, causing serious + # problems therefor, so instead always avoid output to stdout + modprobe -q -b "${module}" 1>/dev/null udevadm settle @@ -343,17 +345,18 @@ find_cow_device () done fi - # udev >=146-1 no longer provides vol_id: + # udev (>= 146) no longer provides vol_id if [ -x /lib/udev/vol_id ] then + # lenny if [ "$(/lib/udev/vol_id -l ${devname} 2>/dev/null)" = "${pers_label}" ] then echo "${devname}" return 0 fi else - eval $(blkid -o udev "${devname}") - if [ "$ID_FS_LABEL" = "${pers_label}" ] + # squeeze + if [ "$(/sbin/blkid -s LABEL -o value $devname 2>/dev/null)" = "${pers_label}" ] then echo "${devname}" return 0