From e0aff96a14865b2bdf43fe29e8970861bf2ac40e Mon Sep 17 00:00:00 2001 From: Brian Behlendorf Date: Fri, 8 Jan 2010 10:20:03 -0800 Subject: [PATCH] Use udevadm if available otherwise use udevtrigger/udevsettle Moving forward udevadm {trigger/settle} replaced udevtrigger/udevsettle as the correct interface to use. However, since we need to work in both environments for testing check and see if udevadm is available. If it is then use it. If it is not fall back to the legacy interface. --- scripts/common.sh | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/scripts/common.sh b/scripts/common.sh index a5cfb53804..9b86507ad4 100755 --- a/scripts/common.sh +++ b/scripts/common.sh @@ -44,6 +44,7 @@ RMMOD=${RMMOD:-/sbin/rmmod} INFOMOD=${INFOMOD:-/sbin/modinfo} LOSETUP=${LOSETUP:-/sbin/losetup} SYSCTL=${SYSCTL:-/sbin/sysctl} +UDEVADM=${UDEVADM:-/sbin/udevadm} die() { echo -e "${PROG}: $1" >&2 @@ -210,8 +211,13 @@ udev_setup() { cp -f ${SRC_PATH} ${DST_PATH} - udevadm trigger - udevadm settle + if [ -f ${UDEVADM} ]; then + ${UDEVADM} trigger + ${UDEVADM} settle + else + /sbin/udevtrigger + /sbin/udevsettle + fi return 0 }