kumquat-buildroot/package/busybox/S10mdev
Titouan Christophe 733ea6bb4b 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>
2019-06-20 16:08:14 +02:00

43 lines
620 B
Bash

#!/bin/sh
#
# Run the mdev daemon
#
DAEMON="mdev"
PIDFILE="/var/run/$DAEMON.pid"
start() {
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 | \
tr '\n' '\0' | \
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|stop|restart)
"$1"
;;
*)
echo "Usage: $0 {start|stop|restart}"
exit 1
esac
exit $?