summaryrefslogtreecommitdiff
path: root/aports/busybox/mdev.initd
diff options
context:
space:
mode:
authorPÁLI Gábor János <pali.gabor@gmail.com>2022-12-30 14:47:25 +0100
committerPÁLI Gábor János <pali.gabor@gmail.com>2022-12-30 14:47:25 +0100
commit1c1b02874e1749d61b9b1680f744bf8470147416 (patch)
tree90578f8f7b73792dd41129b71bc73b0eefd81d32 /aports/busybox/mdev.initd
parent1b300a88b562f707ccd1b67229bd878930c9766c (diff)
downloadfreebsd-wifibox-alpine-1c1b02874e1749d61b9b1680f744bf8470147416.zip
Move to Linux 5.15.85 + Alpine 3.17.0.
Diffstat (limited to 'aports/busybox/mdev.initd')
-rw-r--r--aports/busybox/mdev.initd33
1 files changed, 17 insertions, 16 deletions
diff --git a/aports/busybox/mdev.initd b/aports/busybox/mdev.initd
index 9dbb994..630d837 100644
--- a/aports/busybox/mdev.initd
+++ b/aports/busybox/mdev.initd
@@ -1,39 +1,40 @@
#!/sbin/openrc-run
+description="the mdev device manager"
+
depend() {
provide dev
need sysfs dev-mount
before checkfs fsck
- keyword -vserver -lxc
+ keyword -containers -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
-
+_start_service () {
ebegin "Starting busybox mdev"
mkdir -p /dev
-
- # use mdev for hotplug
echo "/sbin/mdev" > /proc/sys/kernel/hotplug
-
+ eend $?
+}
+
+_start_coldplug () {
+ ebegin "Scanning hardware for mdev"
# mdev -s will not create /dev/usb[1-9] devices with recent kernels
- # so we trigger hotplug events for usb for now
+ # so we manually trigger events for usb
for i in $(find /sys/devices -name 'usb[0-9]*'); do
[ -e $i/uevent ] && echo add > $i/uevent
done
-
- # create devices
+ # trigger the rest of the coldplug
mdev -s
eend $?
}
+start() {
+ _start_service
+ _start_coldplug
+}
+
stop() {
ebegin "Stopping busybox mdev"
- echo "" > /proc/sys/kernel/hotplug
+ echo > /proc/sys/kernel/hotplug
eend
}
-