mirror of
https://gitlab.alpinelinux.org/alpine/aports.git
synced 2026-02-27 02:31:42 +01:00
As requested, busybox-openrc, busybox-mdev-openrc and busybox-extras-openrc are not defined in separate packages, but are now all subpackages of busybox. Thanks to psykose for the mention of amove! Signed-off-by: Laurent Bercot <ska@appnovation.com>
41 lines
745 B
Bash
41 lines
745 B
Bash
#!/sbin/openrc-run
|
|
|
|
description="the mdev device manager"
|
|
|
|
depend() {
|
|
provide dev
|
|
need sysfs dev-mount
|
|
before checkfs fsck
|
|
keyword -containers -vserver -lxc
|
|
}
|
|
|
|
_start_service () {
|
|
ebegin "Starting busybox mdev"
|
|
mkdir -p /dev
|
|
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 manually trigger events for usb
|
|
for i in $(find /sys/devices -name 'usb[0-9]*'); do
|
|
[ -e $i/uevent ] && echo add > $i/uevent
|
|
done
|
|
# trigger the rest of the coldplug
|
|
mdev -s
|
|
eend $?
|
|
}
|
|
|
|
start() {
|
|
_start_service
|
|
_start_coldplug
|
|
}
|
|
|
|
stop() {
|
|
ebegin "Stopping busybox mdev"
|
|
echo > /proc/sys/kernel/hotplug
|
|
eend
|
|
}
|