aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Titouan Christophe <titouan.christophe@railnova.eu>2019-06-19 18:42:57 +0200
committerGravatar Thomas Petazzoni <thomas.petazzoni@bootlin.com>2019-06-20 16:08:14 +0200
commit733ea6bb4bec6e9ff9ffd8f7444527f91c72033e (patch)
tree5d00d32b019e20c5bf5f0653fa393211de48c1de
parent591adcf6367220d1922069532d1f8ca76e6af916 (diff)
downloadbuildroot-733ea6bb4bec6e9ff9ffd8f7444527f91c72033e.tar.gz
buildroot-733ea6bb4bec6e9ff9ffd8f7444527f91c72033e.tar.bz2
package/busybox: run mdev in daemon mode
- Enable the mdev daemon mode in Busybox default config - Update the S10mdev init script to use the daemon mode Signed-off-by: Titouan Christophe <titouan.christophe@railnova.eu> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
-rw-r--r--package/busybox/S10mdev27
-rw-r--r--package/busybox/busybox.config1
2 files changed, 22 insertions, 6 deletions
diff --git a/package/busybox/S10mdev b/package/busybox/S10mdev
index efef4290ba..3c6f47c18c 100644
--- a/package/busybox/S10mdev
+++ b/package/busybox/S10mdev
@@ -1,13 +1,17 @@
#!/bin/sh
#
-# Start mdev....
+# Run the mdev daemon
#
+DAEMON="mdev"
+PIDFILE="/var/run/$DAEMON.pid"
+
start() {
- echo "Starting mdev..."
- echo /sbin/mdev >/proc/sys/kernel/hotplug
- /sbin/mdev -s
+ echo -n "Starting $DAEMON... "
+ start-stop-daemon -S -b -m -p $PIDFILE -x /sbin/mdev -- -df
+ [ $? -eq 0 ] && echo "OK" || echo "ERROR"
+
# coldplug modules
find /sys/ -name modalias -print0 | \
xargs -0 sort -u | \
@@ -15,12 +19,23 @@ start() {
xargs -0 modprobe -abq
}
+stop() {
+ echo -n "Stopping $DAEMON... "
+ start-stop-daemon -K -p $PIDFILE
+ [ $? -eq 0 ] && echo "OK" || echo "ERROR"
+}
+
+restart() {
+ stop
+ start
+}
+
case "$1" in
- start)
+ start|stop|restart)
"$1"
;;
*)
- echo "Usage: $0 start"
+ echo "Usage: $0 {start|stop|restart}"
exit 1
esac
diff --git a/package/busybox/busybox.config b/package/busybox/busybox.config
index 1d9560d655..c28718a725 100644
--- a/package/busybox/busybox.config
+++ b/package/busybox/busybox.config
@@ -628,6 +628,7 @@ CONFIG_FEATURE_MDEV_RENAME=y
# CONFIG_FEATURE_MDEV_RENAME_REGEXP is not set
CONFIG_FEATURE_MDEV_EXEC=y
# CONFIG_FEATURE_MDEV_LOAD_FIRMWARE is not set
+CONFIG_FEATURE_MDEV_DAEMON=y
CONFIG_MESG=y
CONFIG_FEATURE_MESG_ENABLE_ONLY_GROUP=y
CONFIG_MKE2FS=y