Files
xen/tools/check/check_udev
T

35 lines
544 B
Bash
Executable File

#!/bin/sh
# CHECK-INSTALL
RC=0
case ${OS} in
OpenBSD|NetBSD|FreeBSD)
TOOL="vnconfig"
which ${TOOL} 1>/dev/null 2>&1 || RC=1
;;
Linux)
TOOL="udevinfo"
UDEV_VERSION="0"
test -x "$(which ${TOOL})" && \
UDEV_VERSION=$(${TOOL} -V | sed -e 's/^[^0-9]* \([0-9]\{1,\}\)[^0-9]\{0,\}/\1/')
if test "${UDEV_VERSION}" -ge 059; then
RC=0
else
TOOL="hotplug"
which ${TOOL} 1>/dev/null 2>&1 || RC=1
fi
;;
*)
TOOL=""
echo "Unknown OS" && RC=1
;;
esac
if test ${RC} -ne 0; then
echo
echo ' *** Check for ${TOOL} FAILED'
fi
exit ${RC}