]> rtime.felk.cvut.cz Git - coffee/buildroot.git/commitdiff
eudev: prevent udev init script nonexistent directory error
authorJoshua Henderson <joshua.henderson@microchip.com>
Thu, 22 Mar 2018 16:20:01 +0000 (09:20 -0700)
committerPeter Korsgaard <peter@korsgaard.com>
Fri, 6 Apr 2018 14:55:11 +0000 (16:55 +0200)
The following error occures in the udev init script because the kernel config
may optionally not include uevent_helper.

/etc/init.d/S10udev: line 47: can't create /proc/sys/kernel/hotplug: nonexistent directory

Work around this by not trying to access the destination if it's not available.

Signed-off-by: Joshua Henderson <joshua.henderson@microchip.com>
Acked-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
(cherry picked from commit cbe725d755006e41a71180b5786fa9f52104f518)
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
package/eudev/S10udev

index 640fec625bbed1456f7f2e37573466b6b9c33e7f..47c715c8863879c363631604be7ebfb875b81622 100755 (executable)
@@ -28,7 +28,7 @@ test -r $UDEV_CONFIG || exit 6
 case "$1" in
     start)
         printf "Populating %s using udev: " "${udev_root:-/dev}"
-        printf '\000\000\000\000' > /proc/sys/kernel/hotplug
+        [ -e /proc/sys/kernel/hotplug ] && printf '\000\000\000\000' > /proc/sys/kernel/hotplug
         $UDEV_BIN -d || { echo "FAIL"; exit 1; }
         udevadm trigger --type=subsystems --action=add
         udevadm trigger --type=devices --action=add