added mdev

This commit is contained in:
wt committed 2025-07-25 17:17:31 +07:00
1 parent 64a663b672
commit 1db34c6ec6
7 files changed
+224 -18

No files matched your search

+35
View File
@@ -0,0 +1,35 @@
#!/bin/sh
#--- import colors and init-funcs ---
. /usr/lib/init/colors.sh
. /usr/lib/init/init-funcs.sh
#------------------------------------
start() {
notify "Starting mdev"
mkdir -p /dev
echo "/sbin/mdev" > /proc/sys/kernel/hotplug
for i in $(find /sys/devices -name 'usb[0-9]*'); do
[ -e $i/uevent ] && echo add > $i/uevent
done
/usr/bin/mdev -s -S
check $? "start mdev"
return $?
}
stop() {
notify "Stopping mdev"
echo > /proc/sys/kernel/hotplug
check $? "stop mdev"
return $?
}
case "$1" in
start|stop|restart|reload|help)
"$1"
;;
*)
help
return 1
esac
return $?