Skip to content

Commit

Permalink
busybox: mdev: do not daemonize udev
Browse files Browse the repository at this point in the history
Follow the example set by Gentoo and Alpine and register mdev as the
hotplug agent in the beginning and then scan once.
  • Loading branch information
jsbronder committed Dec 2, 2024
1 parent 525cb0e commit a001c5d
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 5 deletions.
2 changes: 1 addition & 1 deletion recipes-appends/oe-core/busybox/busybox-mdev.confd
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
# Extra arguments to pass to the daemon
COMMAND_ARGS="-s -S"
COMMAND_ARGS="-S"
23 changes: 19 additions & 4 deletions recipes-appends/oe-core/busybox/busybox-mdev.initd
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,24 @@ depend() {
before checkfs fsck
}

command_args="-df ${COMMAND_ARGS}"
command_background="true"
pidfile="/var/run/busybox-mdev.pid"
command="/sbin/mdev"
start() {
if [ -e /proc/sys/kernel/hotplug ]; then
ebegin "Registering mdev as hotplug agent"
echo "/sbin/mdev" > /proc/sys/kernel/hotplug
eend $?
fi

ebegin "Populating /dev with mdev"
/sbin/mdev -s ${COMMAND_ARGS}
eend $?
}

stop() {
if [ -e /proc/sys/kernel/hotplug ]; then
ebegin "Removing mdev as hotplug agent"
echo "/sbin/mdev" > /proc/sys/kernel/hotplug
eend $?
fi
}

# vim: noet ft=gentoo-init-d

0 comments on commit a001c5d

Please sign in to comment.