From 3cd34c818ca9695d0b5a8bab80c0ef08544acfbf Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Tue, 7 Apr 2009 20:39:20 +0200 Subject: [PATCH] Applying patch from Michael Prokop to support udev >= 0.140. --- hooks/live | 5 ++++- scripts/live-helpers | 11 ++++++++++- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/hooks/live b/hooks/live index 32adfb6..4e29226 100755 --- a/hooks/live +++ b/hooks/live @@ -148,7 +148,10 @@ else copy_exec /sbin/udevtrigger /sbin copy_exec /sbin/udevsettle /sbin fi -copy_exec /usr/bin/udevinfo /bin +if [ -x /usr/bin/udevinfo ] +then + copy_exec /usr/bin/udevinfo /bin +fi # Program: wget if [ -x /usr/bin/wget ] diff --git a/scripts/live-helpers b/scripts/live-helpers index 70897d6..59bdb4f 100644 --- a/scripts/live-helpers +++ b/scripts/live-helpers @@ -6,10 +6,19 @@ then export PATH="${PATH}:/usr/lib/klibc/bin" fi +# handle upgrade path from old udev (using udevinfo) to +# recent versions of udev (using udevadm info) +if [ -x /sbin/udevadm ] +then + udevinfo='/sbin/udevadm info' +else + udevinfo='udevinfo' +fi + sys2dev () { sysdev=${1#/sys} - echo "/dev/$(udevinfo -q name -p ${sysdev} 2>/dev/null|| echo ${sysdev##*/})" + echo "/dev/$($udevinfo -q name -p ${sysdev} 2>/dev/null|| echo ${sysdev##*/})" } subdevices () -- 2.1.4