diff --git a/make/target-scripts.mk b/make/target-scripts.mk index ccf83a8c..ea697516 100644 --- a/make/target-scripts.mk +++ b/make/target-scripts.mk @@ -16,6 +16,7 @@ init-scripts: \ $(TARGET_DIR)/etc/init.d/fstab \ $(TARGET_DIR)/etc/init.d/hostname \ $(TARGET_DIR)/etc/init.d/inetd \ + $(TARGET_DIR)/etc/init.d/mdev \ $(TARGET_DIR)/etc/init.d/networking \ $(TARGET_DIR)/etc/init.d/partitions-by-name \ $(TARGET_DIR)/etc/init.d/resizerootfs \ @@ -70,6 +71,9 @@ $(TARGET_DIR)/etc/init.d/inetd: $(INSTALL_EXEC) -D $(TARGET_FILES)/scripts/inetd.init $(@) $(UPDATE-RC.D) $(@F) defaults 50 +$(TARGET_DIR)/etc/init.d/mdev: + $(INSTALL_EXEC) -D $(TARGET_FILES)/scripts/mdev.init $(@) + $(TARGET_DIR)/etc/init.d/networking: $(INSTALL_EXEC) -D $(TARGET_FILES)/scripts/networking.init $(@) $(UPDATE-RC.D) $(@F) stop 98 0 6 . diff --git a/skel-root/general/scripts/mdev.init b/skel-root/general/scripts/mdev.init new file mode 100644 index 00000000..ba46298d --- /dev/null +++ b/skel-root/general/scripts/mdev.init @@ -0,0 +1,27 @@ +#!/bin/sh + +. /etc/init.d/functions +. /etc/init.d/globals + +case "$1" in + start) + LOGINFO "mdev coldplug ..." + echo > /dev/mdev.seq + echo $(which mdev) > /proc/sys/kernel/hotplug + mdev -s + + # mdev -s does not poke usb devices, so we need to do it here. + LOGINFO "scanning /sys/bus/usb/devices/ to help mdev with usb-coldplug" + for i in /sys/bus/usb/devices/*; do + case "${i##*/}" in + *-*:1.0) + LOGINFO "usb device $i found" + echo add >$i/uevent + ;; + esac + done + ;; + *) + echo "[$BASENAME] Usage: $0 {start}" + ;; +esac diff --git a/skel-root/hd1/etc/init.d/rcS b/skel-root/hd1/etc/init.d/rcS index 800b7853..789f1526 100755 --- a/skel-root/hd1/etc/init.d/rcS +++ b/skel-root/hd1/etc/init.d/rcS @@ -82,22 +82,8 @@ if [ -x /etc/init.d/sys_update.sh ]; then /etc/init.d/sys_update.sh fi -## mdev coldplug for node permissions -LOGINFO "mdev coldplug ..." -echo >/dev/mdev.seq -echo $(which mdev) > /proc/sys/kernel/hotplug -mdev -s - -# mdev -s does not poke usb devices, so we need to do it here. -LOGINFO "scanning /sys/bus/usb/devices/ to help mdev with usb-coldplug" -for i in /sys/bus/usb/devices/*; do - case "${i##*/}" in - *-*:1.0) - LOGINFO "usb device $i found" - echo add >$i/uevent - ;; - esac -done +# mdev coldplug for node permissions +service mdev start # initialize hardware LOGINFO "init hardware ..." diff --git a/skel-root/hd2/etc/init.d/rcS b/skel-root/hd2/etc/init.d/rcS index b2429601..071e6572 100755 --- a/skel-root/hd2/etc/init.d/rcS +++ b/skel-root/hd2/etc/init.d/rcS @@ -77,22 +77,8 @@ service hostname start # logging as much as possible service syslogd start -## mdev coldplug for node permissions -LOGINFO "mdev coldplug ..." -echo >/dev/mdev.seq -echo $(which mdev) > /proc/sys/kernel/hotplug -mdev -s - -# mdev -s does not poke usb devices, so we need to do it here. -LOGINFO "scanning /sys/bus/usb/devices/ to help mdev with usb-coldplug" -for i in /sys/bus/usb/devices/*; do - case "${i##*/}" in - *-*:1.0) - LOGINFO "usb device $i found" - echo add >$i/uevent - ;; - esac -done +# mdev coldplug for node permissions +service mdev start # load modules / create nodes load_module extra/lnxplatnativeDrv.ko diff --git a/skel-root/hd51/etc/init.d/rcS b/skel-root/hd51/etc/init.d/rcS index 5470384d..644ef2ff 100755 --- a/skel-root/hd51/etc/init.d/rcS +++ b/skel-root/hd51/etc/init.d/rcS @@ -80,22 +80,8 @@ load_module extra/%(BOXMODEL)_4.ko # show bootlogo showiframe.sh bootlogo.m2v -## mdev coldplug for node permissions -LOGINFO "mdev coldplug ..." -echo >/dev/mdev.seq -echo $(which mdev) > /proc/sys/kernel/hotplug -mdev -s - -# mdev -s does not poke usb devices, so we need to do it here. -LOGINFO "scanning /sys/bus/usb/devices/ to help mdev with usb-coldplug" -for i in /sys/bus/usb/devices/*; do - case "${i##*/}" in - *-*:1.0) - LOGINFO "usb device $i found" - echo add >$i/uevent - ;; - esac -done +# mdev coldplug for node permissions +service mdev start service networking start service ntpdate start diff --git a/skel-root/vuduo/etc/init.d/rcS b/skel-root/vuduo/etc/init.d/rcS index 077588ce..4149446b 100755 --- a/skel-root/vuduo/etc/init.d/rcS +++ b/skel-root/vuduo/etc/init.d/rcS @@ -76,22 +76,8 @@ load_module extra/procmk.ko # show bootlogo showiframe.sh bootlogo.m2v -## mdev coldplug for node permissions -LOGINFO "mdev coldplug ..." -echo >/dev/mdev.seq -echo $(which mdev) > /proc/sys/kernel/hotplug -mdev -s - -# mdev -s does not poke usb devices, so we need to do it here. -LOGINFO "scanning /sys/bus/usb/devices/ to help mdev with usb-coldplug" -for i in /sys/bus/usb/devices/*; do - case "${i##*/}" in - *-*:1.0) - LOGINFO "usb device $i found" - echo add >$i/uevent - ;; - esac -done +# mdev coldplug for node permissions +service mdev start service networking start service ntpdate start diff --git a/skel-root/vuplus/etc/init.d/rcS b/skel-root/vuplus/etc/init.d/rcS index 1e79f770..c2a980a3 100755 --- a/skel-root/vuplus/etc/init.d/rcS +++ b/skel-root/vuplus/etc/init.d/rcS @@ -74,22 +74,8 @@ service vuplus-platform-util start # show bootlogo showiframe.sh bootlogo.m2v -## mdev coldplug for node permissions -LOGINFO "mdev coldplug ..." -echo >/dev/mdev.seq -echo $(which mdev) > /proc/sys/kernel/hotplug -mdev -s - -# mdev -s does not poke usb devices, so we need to do it here. -LOGINFO "scanning /sys/bus/usb/devices/ to help mdev with usb-coldplug" -for i in /sys/bus/usb/devices/*; do - case "${i##*/}" in - *-*:1.0) - LOGINFO "usb device $i found" - echo add >$i/uevent - ;; - esac -done +# mdev coldplug for node permissions +service mdev start service networking start service ntpdate start