diff options
author | PÁLI Gábor János <pali.gabor@gmail.com> | 2022-04-10 18:17:21 +0200 |
---|---|---|
committer | PÁLI Gábor János <pali.gabor@gmail.com> | 2022-04-10 23:09:31 +0200 |
commit | bcbf7c6c9fc7d8a96b1d5c4cc9247b85fe3da2ad (patch) | |
tree | 46d796182b2249408b0597485462ef1698dc4c13 /aports/busybox/mdev.initd | |
parent | 40d2daea11738408b7bf7b60f14a558ff8c47fb0 (diff) | |
download | freebsd-wifibox-alpine-bcbf7c6c9fc7d8a96b1d5c4cc9247b85fe3da2ad.zip |
Move towards custom packages.
Change the build image process in a way that custom-built packages
can be utilized. This means a simpler `Makefile` since every
modification is implemented on the level of packages. Include the
sources for every customized package.
Diffstat (limited to 'aports/busybox/mdev.initd')
-rw-r--r-- | aports/busybox/mdev.initd | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/aports/busybox/mdev.initd b/aports/busybox/mdev.initd new file mode 100644 index 0000000..9dbb994 --- /dev/null +++ b/aports/busybox/mdev.initd @@ -0,0 +1,39 @@ +#!/sbin/openrc-run + +depend() { + provide dev + need sysfs dev-mount + before checkfs fsck + keyword -vserver -lxc +} + +start() { + # check if udev is specified on cmd line + if get_bootparam "udev"; then + ewarn "Skipping mdev as udev requested in kernel cmdline" + return 0 + fi + + ebegin "Starting busybox mdev" + mkdir -p /dev + + # use mdev for hotplug + echo "/sbin/mdev" > /proc/sys/kernel/hotplug + + # mdev -s will not create /dev/usb[1-9] devices with recent kernels + # so we trigger hotplug events for usb for now + for i in $(find /sys/devices -name 'usb[0-9]*'); do + [ -e $i/uevent ] && echo add > $i/uevent + done + + # create devices + mdev -s + eend $? +} + +stop() { + ebegin "Stopping busybox mdev" + echo "" > /proc/sys/kernel/hotplug + eend +} + |