OSDN Git Service

init: avoid using init modprobe
authorChih-Wei Huang <cwhuang@linux.org.tw>
Fri, 23 Oct 2015 08:32:15 +0000 (16:32 +0800)
committerChih-Wei Huang <cwhuang@linux.org.tw>
Fri, 23 Oct 2015 08:32:15 +0000 (16:32 +0800)
The init modprobe should not be used before the porting is finished,
otherwise the system suddenly reboots.

Also remove the obsolete way to load modules.

initrd/init
initrd/scripts/0-auto-detect

index 9f1e1bf..708c049 100755 (executable)
@@ -3,7 +3,7 @@
 # By Chih-Wei Huang <cwhuang@linux.org.tw>
 # and Thorsten Glaser <tg@mirbsd.org>
 #
-# Last updated 2015/10/05
+# Last updated 2015/10/23
 #
 # License: GNU Public License
 # We explicitely grant the right to use the scripts
@@ -169,7 +169,7 @@ if [ -x system/bin/ln -a \( -n "$DEBUG" -o -n "$BUSYBOX" \) ]; then
 fi
 
 # ensure keyboard driver is loaded
-[ -n "$INSTALL" -o -n "$DEBUG" ] && modprobe atkbd
+[ -n "$INSTALL" -o -n "$DEBUG" ] && busybox modprobe atkbd
 
 if [ 0$DEBUG -gt 0 ]; then
        echo -e "\nType 'exit' to continue booting...\n"
index b43afad..ed771dc 100644 (file)
@@ -1,6 +1,6 @@
 #
 # By Chih-Wei Huang <cwhuang@linux.org.tw>
-# Last updated 2015/10/20
+# Last updated 2015/10/23
 #
 # License: GNU Public License
 # We explicitely grant the right to use the scripts
@@ -13,7 +13,7 @@ auto_detect()
        tmp=/tmp/dev2mod
        echo 'dev2mod() { while read dev; do case $dev in' > $tmp
        sort -r /lib/modules/`uname -r`/modules.alias | \
-               sed -n 's/^alias  *\([^ ]*\)  *\(.*\)/\1)modprobe \2;;/p' >> $tmp
+               sed -n 's/^alias  *\([^ ]*\)  *\(.*\)/\1)busybox modprobe \2;;/p' >> $tmp
        echo 'esac; done; }' >> $tmp
        source $tmp
        cat /sys/bus/*/devices/*/modalias | dev2mod
@@ -41,19 +41,12 @@ find_network_dev_name()
 
 load_modules()
 {
-       if [ -n "$FOUND" ]; then
-               [ -n "$PREDEV" ] && modprobe $PREDEV
-               [ -n "$FB0DEV" -a -z "$UVESA_MODE" ] && modprobe $FB0DEV
-               [ -n "$LANDEV" ] && modprobe $LANDEV
-               [ -n "$WIFDEV" ] && modprobe $WIFDEV
-               [ -n "$SNDDEV" ] && modprobe $SNDDEV
-               [ -n "$CAMDEV" ] && modprobe $CAMDEV
-       else
+       if [ -z "$FOUND" ]; then
                auto_detect
        fi
 
        # 3G modules
        for m in $EXTMOD; do
-               modprobe $m
+               busybox modprobe $m
        done
 }