From: Chih-Wei Huang Date: Thu, 21 Jul 2016 15:22:32 +0000 (+0800) Subject: 0-auto-detect: keep module loading order as before X-Git-Tag: android-x86-6.0-r1~5 X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;ds=sidebyside;h=a34ea4cdb6a134ce0c24fe386f11b1121609d852;p=android-x86%2Fbootable-newinstaller.git 0-auto-detect: keep module loading order as before Commit bdf2b690 uses 'sort -u' which changes module loading order. It causes some issues. For example, on a device with two graphic cards, the driver of the discrete graphic card may be loaded first that causes black screen issue. Use the simple awk script to remove duplicate items but keep the order unchanged. --- diff --git a/initrd/scripts/0-auto-detect b/initrd/scripts/0-auto-detect index 8189830..0caa34a 100644 --- a/initrd/scripts/0-auto-detect +++ b/initrd/scripts/0-auto-detect @@ -1,6 +1,6 @@ # # By Chih-Wei Huang -# Last updated 2016/03/03 +# Last updated 2016/07/21 # # 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/*/uevent | grep MODALIAS | sed 's/^MODALIAS=//' | sort -u | dev2mod + cat /sys/bus/*/devices/*/uevent | grep MODALIAS | sed 's/^MODALIAS=//' | awk '!seen[$0]++' | dev2mod cat /sys/devices/virtual/wmi/*/modalias | dev2mod }