summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Salyzyn <salyzyn@google.com>2020-05-11 15:51:29 -0700
committerMark Salyzyn <salyzyn@google.com>2020-05-18 18:32:06 -0700
commit90ef3eb2c1e44353ab97161cba7660644bc56a1c (patch)
treeed1377af9f2ad8b2b9983b77a4b545d49dfc470f
parent2b540f840f00bbc81a67dd218393c7ddf71cfd70 (diff)
downloadpixel-90ef3eb2c1e44353ab97161cba7660644bc56a1c.tar.gz
init.insmod.sh: support modprobe with a * matching pattern
If the module list is specified by a *, or empty, then use contents of modules.load as argument to modprobe. Chose this route over enhancing the modprobe tool to accept an argument of * natively. Specifically also support the -b (blacklist) option to limit which modules to load. Signed-off-by: Mark Salyzyn <salyzyn@google.com> Bug: 151950334 Test: second stage modules load with * argument in config Merged-In: Id3b5c43644e465f1327b1a56d11609bab6aad228 Change-Id: Id3b5c43644e465f1327b1a56d11609bab6aad228
-rwxr-xr-xcommon/init.insmod.sh9
1 files changed, 8 insertions, 1 deletions
diff --git a/common/init.insmod.sh b/common/init.insmod.sh
index c7ac0270..29e04c8d 100755
--- a/common/init.insmod.sh
+++ b/common/init.insmod.sh
@@ -20,7 +20,14 @@ if [ -f $cfg_file ]; then
"insmod") insmod $arg ;;
"setprop") setprop $arg 1 ;;
"enable") echo 1 > $arg ;;
- "modprobe") modprobe -a -d /vendor/lib/modules $arg ;;
+ "modprobe")
+ case ${arg} in
+ "-b *" | "-b")
+ arg="-b $(cat /vendor/lib/modules/modules.load)" ;;
+ "*" | "")
+ arg="$(cat /vendor/lib/modules/modules.load)" ;;
+ esac
+ modprobe -a -d /vendor/lib/modules $arg ;;
esac
done < $cfg_file
fi