diff options
author | Khem Raj <raj.khem@gmail.com> | 2020-12-17 14:54:39 -0800 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2020-12-20 00:03:05 +0000 |
commit | 0aa8f592df9a43a242d5470b983fb55b1469ac69 (patch) | |
tree | db3352ec5f261892dcf9dea5cae149bf9a65f78c /meta/recipes-core/busybox/files | |
parent | 9a52a44a05c9b66e4c39823101b259ea7e28cc19 (diff) | |
download | poky-0aa8f592df9a43a242d5470b983fb55b1469ac69.tar.gz |
busybox: Run mdev as daemon
When busybox is used for device management, kernel needs to support
older/obsolete mechanism via CONFIG_UEVENT_HELPER and
CONFIG_UEVENT_HELPER_PATH to enable /proc/sys/kernel/hotplug but this
would require kernel defconfig change and will always be needed when
mdev is used, intead run it in daemon mode
Update mdev init script to run mdev in daemon mode
(From OE-Core rev: f9e84b31ea4afe566c76dcdea25960478cd36ecc)
Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-core/busybox/files')
-rwxr-xr-x | meta/recipes-core/busybox/files/mdev | 56 |
1 files changed, 39 insertions, 17 deletions
diff --git a/meta/recipes-core/busybox/files/mdev b/meta/recipes-core/busybox/files/mdev index 8c9c06e96c..2fbdfb073e 100755 --- a/meta/recipes-core/busybox/files/mdev +++ b/meta/recipes-core/busybox/files/mdev | |||
@@ -1,21 +1,43 @@ | |||
1 | #!/bin/sh | 1 | #!/bin/sh |
2 | mount -t proc proc /proc | ||
3 | mount -t sysfs sysfs /sys | ||
4 | mount -t tmpfs tmpfs /dev -o size=64k,mode=0755 | ||
5 | mkdir /dev/pts /dev/shm | ||
6 | chmod 777 /dev/shm | ||
7 | mount -t devpts devpts /dev/pts | ||
8 | touch /dev/mdev.seq | ||
9 | #sysctl -w kernel.hotplug=/sbin/mdev | ||
10 | echo "/sbin/mdev" > /proc/sys/kernel/hotplug | ||
11 | mdev -s | ||
12 | |||
13 | # | 2 | # |
14 | # We might have mounted something over /dev, see if /dev/initctl is there. | 3 | # Run the mdev daemon |
15 | # | 4 | # |
16 | if test ! -p /dev/initctl | 5 | |
17 | then | 6 | DAEMON="mdev" |
18 | rm -f /dev/initctl | 7 | PIDFILE="/var/run/$DAEMON.pid" |
19 | mknod -m 600 /dev/initctl p | 8 | |
20 | fi | 9 | |
10 | start() { | ||
11 | echo -n "Starting $DAEMON... " | ||
12 | start-stop-daemon -S -b -m -p $PIDFILE -x /sbin/mdev -- -df | ||
13 | [ $? -eq 0 ] && echo "OK" || echo "ERROR" | ||
14 | |||
15 | # coldplug modules | ||
16 | find /sys/ -name modalias -print0 | \ | ||
17 | xargs -0 sort -u | \ | ||
18 | tr '\n' '\0' | \ | ||
19 | xargs -0 modprobe -abq | ||
20 | } | ||
21 | |||
22 | stop() { | ||
23 | echo -n "Stopping $DAEMON... " | ||
24 | start-stop-daemon -K -p $PIDFILE | ||
25 | [ $? -eq 0 ] && echo "OK" || echo "ERROR" | ||
26 | } | ||
27 | |||
28 | restart() { | ||
29 | stop | ||
30 | start | ||
31 | } | ||
32 | |||
33 | case "$1" in | ||
34 | start|stop|restart) | ||
35 | "$1" | ||
36 | ;; | ||
37 | *) | ||
38 | echo "Usage: $0 {start|stop|restart}" | ||
39 | exit 1 | ||
40 | esac | ||
41 | |||
42 | exit $? | ||
21 | 43 | ||