X-Git-Url: http://git.grml.org/?a=blobdiff_plain;f=scripts%2Flive-helpers;h=47674e659df21cc1236bbbef6c4ad7759fe7f4f8;hb=10819a70f6f196e97d1d0e82caf4f4afb15d6f4b;hp=0cdc7555c9e8fed6a672d71e254770b28e335371;hpb=2ee2da59624d6d328bdd249f13ea680c576d5e34;p=live-boot-grml.git diff --git a/scripts/live-helpers b/scripts/live-helpers index 0cdc755..47674e6 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,11 +76,13 @@ 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 + # squeeze /sbin/blkid -s TYPE -o value $1 2>/dev/null fi } @@ -185,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 @@ -303,7 +309,7 @@ find_cow_device () do devname=$(sys2dev "${dev}") - if echo "${black_listed_devices}" | grep -q "${devname}" + if echo "${black_listed_devices}" | grep -q -w "${devname}" then # skip this device enterely break @@ -339,15 +345,17 @@ 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 + # squeeze if [ "$(/sbin/blkid -s LABEL -o value $devname 2>/dev/null)" = "${pers_label}" ] then echo "${devname}" @@ -400,7 +408,7 @@ find_files () devname=$(sys2dev "${dev}") devfstype="$(get_fstype ${devname})" - if echo "${black_listed_devices}" | grep -q "${devname}" + if echo "${black_listed_devices}" | grep -q -w "${devname}" then # skip this device enterely break