Update 9990-misc-helpers.sh to support latest udev version [Closes: issue1278]
authorMichael Prokop <mika@grml.org>
Sat, 28 Sep 2013 09:00:58 +0000 (11:00 +0200)
committerMichael Prokop <mika@grml.org>
Sat, 28 Sep 2013 09:21:16 +0000 (11:21 +0200)
When booting the ISO in hard-disk mode udev's
'udevadm test-builtin' emits this error message:

| calling: test-builtin
| error reading /lib/udev/hwdb.bin: No such file or directory
| load module index
| unload module index

and fails to boot because using udevadm test-builtin in the
is_nice_device function no longer recognizes proper DEVICES.

Including the /lib/udev/hwdb.bin file in the initramfs doesn't
help either as udevadm test-builtin was a debug interface and
never supposed to be used public.

This patch addresses the issue by using udevadm info and checking
if the DEVTYPE of the device is 'disk'. This should work with the
majority of DEVICES.

Closes: https://github.com/grml/live-boot-grml/pull/3

Thanks: Ulrich Dangel <mru@spamt.net> for the initial patch
Thanks: Michael Biebl <biebl@debian.org> for helping in resolve this issue

debian/patches/43_fix_udev_usage_in_is_nice_device.patch [new file with mode: 0644]
debian/patches/series

diff --git a/debian/patches/43_fix_udev_usage_in_is_nice_device.patch b/debian/patches/43_fix_udev_usage_in_is_nice_device.patch
new file mode 100644 (file)
index 0000000..9afca56
--- /dev/null
@@ -0,0 +1,11 @@
+--- a/scripts/boot/9990-misc-helpers.sh
++++ b/scripts/boot/9990-misc-helpers.sh
+@@ -117,7 +117,7 @@
+ {
+       sysfs_path="${1#/sys}"
+-      if /sbin/udevadm test-builtin path_id "${sysfs_path}" | egrep -q "ID_PATH=(usb|pci-[^-]*-(ide|sas|scsi|usb|virtio)|platform-sata_mv|platform-orion-ehci|platform-mmc|platform-mxsdhci)"
++      if /sbin/udevadm info --query=all --path="${sysfs_path}" | egrep -q "DEVTYPE=disk"
+       then
+               return 0
+       elif echo "${sysfs_path}" | grep -q '^/block/vd[a-z]$'
index 4ddef73..adedde3 100644 (file)
@@ -19,3 +19,4 @@
 40_support_multiple_hooks.patch
 41_drop_nameserver_from_ip_option.patch
 42_restore_support_for_old_persistence.patch
+43_fix_udev_usage_in_is_nice_device.patch