From 09eb230ea37bd34d4b508d72d1529668e250dd2f Mon Sep 17 00:00:00 2001 From: Chris Jones Date: Wed, 20 Nov 2013 10:01:06 +0000 Subject: [PATCH] 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 --- elements/ramdisk/extra-data.d/scripts/init | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/elements/ramdisk/extra-data.d/scripts/init b/elements/ramdisk/extra-data.d/scripts/init index 509bd9acb..b58168d02 100644 --- a/elements/ramdisk/extra-data.d/scripts/init +++ b/elements/ramdisk/extra-data.d/scripts/init @@ -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