Detect udevd version and behave accordingly.

We can no longer rely on the name of the udevd binary as a hint for its
version, so instead we query the binary and behave accordingly.

Change-Id: Id4c869dfeeca5ed970169343b6b5f0f2c4499ca3
This commit is contained in:
Chris Jones 2013-11-20 10:01:06 +00:00
parent 1373ed5374
commit 09eb230ea3
1 changed files with 7 additions and 2 deletions

View File

@ -59,13 +59,18 @@ else
UDEVD="udevd"
fi
if [ "$UDEVD" = "systemd-udevd" ]; then
# devtmpfs is required since udev 176
# udev versions 176 and newer require a different on-disk setup
UDEVD_VERSION=$($UDEVD --version)
if [ "$UDEVD_VERSION" != "" -a $UDEVD_VERSION -gt 175 ]; then
echo "Using new-style udevd setup"
mount -t devtmpfs none /dev
mkdir -p /run
mount -t tmpfs -o "nosuid,size=20%,mode=0755" tmpfs /run
mkdir -p /run/lock
mkdir -p /run/udev
else
echo "Using old-style udevd setup"
mount -t tmpfs none /dev
ln -sf /proc/self/fd /dev/fd
mknod /dev/null c 1 3