1 #! /vendor/bin/sh 2 3 ######################################### 4 ### init.insmod.cfg format: ### 5 ### --------------------------------- ### 6 ### [insmod|setprop] [path|prop name] ### 7 ### ... ### 8 ######################################### 9 10 if [[ -e "/vendor/etc/init.insmod_charger.cfg" && "$(getprop ro.boot.mode)" == "charger" ]]; then 11 cfg_file="/vendor/etc/init.insmod_charger.cfg" 12 else 13 cfg_file="/vendor/etc/init.insmod.cfg" 14 fi 15 16 if [ -f $cfg_file ]; then 17 while IFS=" " read -r action name 18 do 19 case $action in 20 "insmod") insmod $name ;; 21 "setprop") setprop $name 1 ;; 22 esac 23 done < $cfg_file 24 fi 25 26 # set property even if there is no insmod config 27 # as property value "1" is expected in early-boot trigger 28 setprop sys.all.modules.ready 1 29