OSDN Git Service

initrd: load drivers in debug or installation modes android-x86-6.0-r2
authorChih-Wei Huang <cwhuang@linux.org.tw>
Tue, 10 Jan 2017 03:59:23 +0000 (11:59 +0800)
committerChih-Wei Huang <cwhuang@linux.org.tw>
Tue, 10 Jan 2017 03:59:23 +0000 (11:59 +0800)
On some machines the input devices may not be activated because
their drivers are not loaded yet in debug or installation modes.

The change tries to fix it by calling the auto_detect function.
Skip the display (kms) modules to avoid some potential issues.

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

index a3d1d83..7bb2364 100755 (executable)
@@ -3,7 +3,7 @@
 # By Chih-Wei Huang <cwhuang@linux.org.tw>
 # and Thorsten Glaser <tg@mirbsd.org>
 #
-# Last updated 2017/01/09
+# Last updated 2017/01/10
 #
 # License: GNU Public License
 # We explicitely grant the right to use the scripts
@@ -169,19 +169,19 @@ if [ -x system/bin/ln -a \( -n "$DEBUG" -o -n "$BUSYBOX" \) ]; then
        hash -r
 fi
 
+# load scripts
+for s in `ls /scripts/* /src/scripts/*`; do
+       test -e "$s" && source $s
+done
+
 # ensure keyboard driver is loaded
-[ -n "$INSTALL" -o -n "$DEBUG" ] && busybox modprobe -a atkbd hid-apple
+[ -n "$INSTALL" -o -n "$DEBUG" ] && auto_detect &
 
 if [ 0$DEBUG -gt 0 ]; then
        echo -e "\nType 'exit' to continue booting...\n"
        debug_shell debug-found
 fi
 
-# load scripts
-for s in `ls /scripts/* /src/scripts/*`; do
-       test -e "$s" && source $s
-done
-
 # A target should provide its detect_hardware function.
 # On success, return 0 with the following values set.
 # return 1 if it wants to use auto_detect
index 0b6296a..eda25d4 100644 (file)
@@ -15,7 +15,9 @@ auto_detect()
        sort -r /lib/modules/`uname -r`/modules.alias | \
                sed -n 's/^alias  *\([^ ]*\)  *\(.*\)/\1)busybox modprobe \2;;/p' >> $tmp
        echo 'esac; done; }' >> $tmp
-       sed -i '/brcmfmac/d' $tmp
+       for f in $(grep drm_kms /lib/modules/`uname -r`/modules.dep | cut -d. -f1); do
+               sed -i "/$(basename $f | sed 's/-/_/g')/d" $tmp
+       done
        source $tmp
        cat /sys/bus/*/devices/*/uevent | grep MODALIAS | sed 's/^MODALIAS=//' | awk '!seen[$0]++' | dev2mod
        cat /sys/devices/virtual/wmi/*/modalias | dev2mod