On Mon, Oct 19, 2009 at 06:48:57PM +0200, Jean-Pierre Flori wrote: > For the "/lib/udev/vol_id" issue, it's not included in udev anymore so > "/sbin/blockid" should be used instead. > In "/usr/share/initramfs-tool/scripts/live-helpers", "/lib/udev/vol_id > -[t|l]" should be replaced by something like "/sbin/blkid -s [TYPE|LABEL] -o > value" and in "/usr/share/initramfs-tool/scripts/live-bottom/12fstab" > "/lib/udev/vol_id" by "/sbin/blkid -o udev". > It seems to work on my system.
Here's a simple fix along that line that forks for me. I didn't patch live-bottom/12fstab yet, though. -- Tzafrir Cohen icq#16849755 jabber:tzafrir.co...@xorcom.com +972-50-7952406 mailto:tzafrir.co...@xorcom.com http://www.xorcom.com iax:gu...@local.xorcom.com/tzafrir
diff --git a/scripts/live b/scripts/live index ab2db29..1902429 100755 --- a/scripts/live +++ b/scripts/live @@ -611,7 +611,7 @@ is_nice_device () { sysfs_path="${1#/sys}" - if /lib/udev/path_id "${sysfs_path}" | grep -E -q "ID_PATH=(usb|pci-[^-]*-(ide|scsi|usb))" + if /lib/udev/path_id "${sysfs_path}" | grep -E -q "ID_PATH=(usb|pci-)" then return 0 elif echo "${sysfs_path}" | grep -q '^/block/vd[a-z]$' diff --git a/scripts/live-helpers b/scripts/live-helpers index d5ad29f..d618685 100644 --- a/scripts/live-helpers +++ b/scripts/live-helpers @@ -6,6 +6,15 @@ then export PATH="${PATH}:/usr/lib/klibc/bin" fi +if [ -x /lib/udev/vol_id ] +then + vol_id_l="/lib/udev/vol_id -l" + vol_id_t="/lib/udev/vol_id -t" +else + vol_id_l="/sbin/blkid -o value -s LABEL" + vol_id_t="/sbin/blkid -o value -s TYPE" +fi + # handle upgrade path from old udev (using udevinfo) to # recent versions of udev (using udevadm info) if [ -x /sbin/udevadm ] @@ -78,11 +87,12 @@ get_fstype () { local FSTYPE local FSSIZE + local ID_FS_TYPE # fstype misreports LUKS devices if is_luks "${1}" then - /lib/udev/vol_id -t ${1} 2>/dev/null + ${vol_id_t} ${1} # 2>/dev/null return fi @@ -94,7 +104,7 @@ get_fstype () return 0 fi - /lib/udev/vol_id -t ${1} 2>/dev/null + ${vol_id_t} ${1} # 2>/dev/null } where_is_mounted () @@ -357,7 +367,7 @@ find_cow_device () done fi - if [ "$(/lib/udev/vol_id -l ${devname} 2>/dev/null)" = "${pers_label}" ] + if [ "$(${vol_id_l} ${devname} 2>/dev/null)" = "${pers_label}" ] then echo "${devname}" return 0