use gs-common insert module script
Bug: 243763292 Test: boot to home Change-Id: I0c99d0475af3036197413abf9344d343f761d071
This commit is contained in:
parent
f803c049b6
commit
876031a635
5 changed files with 26 additions and 96 deletions
|
@ -240,7 +240,7 @@ on init
|
|||
chown system system /sys/devices/platform/10da0000.hsi2c/i2c-7/7-0050/eeprom
|
||||
|
||||
# Loading common kernel modules in background
|
||||
start insmod_sh_common
|
||||
start init_display
|
||||
|
||||
# Charge stats (write 0)
|
||||
chown system system /sys/class/power_supply/battery/charge_stats
|
||||
|
@ -848,7 +848,7 @@ on property:persist.sys.test_harness=1 && property:persist.vendor.testing_batte
|
|||
on property:ro.debuggable=1
|
||||
write /sys/module/scsi_mod/parameters/scsi_logging_level 63
|
||||
|
||||
service insmod_sh_common /vendor/bin/init.insmod.sh /vendor/etc/init.insmod.gs201.cfg
|
||||
service init_display /vendor/bin/init.display.sh
|
||||
class main
|
||||
user root
|
||||
group root system
|
||||
|
|
|
@ -325,11 +325,9 @@ PRODUCT_COPY_FILES += \
|
|||
|
||||
# Shell scripts
|
||||
PRODUCT_COPY_FILES += \
|
||||
device/google/gs201/init.insmod.sh:$(TARGET_COPY_OUT_VENDOR)/bin/init.insmod.sh \
|
||||
device/google/gs201/init.display.sh:$(TARGET_COPY_OUT_VENDOR)/bin/init.display.sh \
|
||||
|
||||
# insmod files
|
||||
PRODUCT_COPY_FILES += \
|
||||
device/google/gs201/init.insmod.gs201.cfg:$(TARGET_COPY_OUT_VENDOR)/etc/init.insmod.gs201.cfg
|
||||
include device/google/gs-common/insmod/insmod.mk
|
||||
|
||||
# For creating dtbo image
|
||||
PRODUCT_HOST_PACKAGES += \
|
||||
|
|
22
init.display.sh
Executable file
22
init.display.sh
Executable file
|
@ -0,0 +1,22 @@
|
|||
#!/vendor/bin/sh
|
||||
modules_dir=
|
||||
|
||||
for f in /vendor/lib/modules/*/modules.dep /vendor/lib/modules/modules.dep; do
|
||||
if [[ -f "$f" ]]; then
|
||||
modules_dir="$(dirname "$f")"
|
||||
break
|
||||
fi
|
||||
done
|
||||
|
||||
if [[ -z "${modules_dir}" ]]; then
|
||||
echo "Unable to locate kernel modules directory" 2>&1
|
||||
exit 1
|
||||
fi
|
||||
|
||||
panel_drv=`getprop ro.boot.primary_panel_drv`
|
||||
if [[ -z "$panel_drv" ]]; then
|
||||
panel_drv="panel-samsung-emul"
|
||||
fi
|
||||
modprobe -d "${modules_dir}" exynos-drm.ko
|
||||
modprobe -d "${modules_dir}" $panel_drv.ko
|
||||
|
|
@ -1,12 +0,0 @@
|
|||
####################################################
|
||||
# init.insmod.common.cfg #
|
||||
# This file contains common kernel modules to load #
|
||||
# at init time by init.insmod.sh script #
|
||||
####################################################
|
||||
|
||||
# Load common kernel modules
|
||||
# Modules here will be loaded *before* device specific modules
|
||||
install_display_drivers
|
||||
modprobe|-b *
|
||||
# All common modules loaded
|
||||
setprop|vendor.common.modules.ready
|
|
@ -1,78 +0,0 @@
|
|||
#!/vendor/bin/sh
|
||||
|
||||
#############################################################
|
||||
### init.insmod.cfg format: ###
|
||||
### ----------------------------------------------------- ###
|
||||
### [insmod|setprop|enable/moprobe|wait] [path|prop name] ###
|
||||
### ... ###
|
||||
#############################################################
|
||||
|
||||
modules_dir=
|
||||
|
||||
for f in /vendor/lib/modules/*/modules.dep /vendor/lib/modules/modules.dep; do
|
||||
if [[ -f "$f" ]]; then
|
||||
modules_dir="$(dirname "$f")"
|
||||
break
|
||||
fi
|
||||
done
|
||||
|
||||
if [[ -z "${modules_dir}" ]]; then
|
||||
echo "Unable to locate kernel modules directory" 2>&1
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# imitates wait_for_file() in init
|
||||
wait_for_file()
|
||||
{
|
||||
filename="${1}"
|
||||
timeout="${2:-5}"
|
||||
|
||||
expiry=$(($(date "+%s")+timeout))
|
||||
while [[ ! -e "${filename}" ]] && [[ "$(date "+%s")" -le "${expiry}" ]]
|
||||
do
|
||||
sleep 0.01
|
||||
done
|
||||
}
|
||||
|
||||
install_display_drivers()
|
||||
{
|
||||
panel_drv=`getprop ro.boot.primary_panel_drv`
|
||||
if [[ -z "$panel_drv" ]]; then
|
||||
panel_drv="panel-samsung-emul"
|
||||
fi
|
||||
modprobe -d "${modules_dir}" exynos-drm.ko
|
||||
modprobe -d "${modules_dir}" $panel_drv.ko
|
||||
}
|
||||
|
||||
if [ $# -eq 1 ]; then
|
||||
cfg_file=$1
|
||||
else
|
||||
# Set property even if there is no insmod config
|
||||
# to unblock early-boot trigger
|
||||
setprop vendor.common.modules.ready
|
||||
setprop vendor.device.modules.ready
|
||||
setprop vendor.all.modules.ready
|
||||
setprop vendor.all.devices.ready
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ -f $cfg_file ]; then
|
||||
while IFS="|" read -r action arg
|
||||
do
|
||||
case $action in
|
||||
"insmod") insmod $arg ;;
|
||||
"setprop") setprop $arg 1 ;;
|
||||
"enable") echo 1 > $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
|
||||
done < $cfg_file
|
||||
fi
|
Loading…
Add table
Add a link
Reference in a new issue