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.
#
# By Chih-Wei Huang <cwhuang@linux.org.tw>
-# Last updated 2016/03/03
+# Last updated 2016/07/21
#
# License: GNU Public License
# We explicitely grant the right to use the scripts
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
}