Use modprobe --all to load all modules in modules.load

Previously, we ran modprobe command for every .ko file listed in
init.insmod.*.cfg. Let's move to a different approach where we call
modprobe with the following command line.

modprobe -b --all=/vendor/lib/modules/modules.load

This will insmod all modules listed in modules.load except for those
that are mentioned in the blocklist at
/vendor/lib/modules/modules.blocklist

A common reason for a module to be on the blocklist is that it must only
be loaded under a certain condition like when a specific service is
launched.

Bug: 190652328
Change-Id: I37dfc83cbc90534243765f6985bc53f3fa83aef0
This commit is contained in:
Daniel Mentz 2021-05-13 15:37:33 -07:00
parent 71bf42f42d
commit fe798d9f4f
2 changed files with 9 additions and 21 deletions

View file

@ -61,7 +61,14 @@ if [ -f $cfg_file ]; then
"insmod") insmod $arg ;;
"setprop") setprop $arg 1 ;;
"enable") echo 1 > $arg ;;
"modprobe") modprobe -a -d "${modules_dir}" $arg ;;
"modprobe")
case ${arg} in
"-b *" | "-b")
arg="-b --all=${modules_dir}/modules.load" ;;
"*" | "")
arg="--all=${modules_dir}/modules.load" ;;
esac
modprobe -a -d "${modules_dir}" $arg ;;
"wait") wait_for_file $arg ;;
"install_display_drivers") install_display_drivers ;;
esac