OSDN Git Service

0-auto-detect: use MODALIAS in uevent to detect modules
authorQin Shaohui <qinshaohui@phoenixos.com>
Thu, 3 Mar 2016 09:48:34 +0000 (17:48 +0800)
committerChih-Wei Huang <cwhuang@linux.org.tw>
Thu, 3 Mar 2016 09:51:50 +0000 (17:51 +0800)
This method can detect more modules than before.

initrd/scripts/0-auto-detect

index 34be942..8189830 100644 (file)
@@ -1,6 +1,6 @@
 #
 # By Chih-Wei Huang <cwhuang@linux.org.tw>
-# Last updated 2016/01/23
+# Last updated 2016/03/03
 #
 # License: GNU Public License
 # We explicitely grant the right to use the scripts
@@ -17,7 +17,7 @@ auto_detect()
        echo 'esac; done; }' >> $tmp
        sed -i '/brcmfmac/d' $tmp
        source $tmp
-       cat /sys/bus/*/devices/*/modalias | dev2mod
+       cat /sys/bus/*/devices/*/uevent | grep MODALIAS | sed 's/^MODALIAS=//' | sort -u | dev2mod
        cat /sys/devices/virtual/wmi/*/modalias | dev2mod
 }