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.
This commit is contained in:
Brian Behlendorf 2010-01-08 10:20:03 -08:00
parent c824f39f95
commit e0aff96a14
1 changed files with 8 additions and 2 deletions

View File

@ -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
}