diff --git a/conf/init.gs201.rc b/conf/init.gs201.rc
index 0f46a39e..cb883128 100644
--- a/conf/init.gs201.rc
+++ b/conf/init.gs201.rc
@@ -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
diff --git a/device.mk b/device.mk
index 6c491a80..b7235b41 100644
--- a/device.mk
+++ b/device.mk
@@ -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 += \
@@ -1180,7 +1178,7 @@ PRODUCT_PACKAGES_DEBUG += BatteryStatsViewer
# Install product specific framework compatibility matrix
# (TODO: b/169535506) This includes the FCM for system_ext and product partition.
# It must be split into the FCM of each partition.
-DEVICE_PRODUCT_COMPATIBILITY_MATRIX_FILE := device/google/gs201/device_framework_matrix_product.xml
+DEVICE_PRODUCT_COMPATIBILITY_MATRIX_FILE += device/google/gs201/device_framework_matrix_product.xml
# Preopt SystemUI
PRODUCT_DEXPREOPT_SPEED_APPS += SystemUIGoogle # For internal
diff --git a/device_framework_matrix_product.xml b/device_framework_matrix_product.xml
index c6ea0193..e0a9a602 100644
--- a/device_framework_matrix_product.xml
+++ b/device_framework_matrix_product.xml
@@ -126,38 +126,6 @@
default
-
- hardware.google.bluetooth.bt_channel_avoidance
- 1.0
-
- IBTChannelAvoidance
- default
-
-
-
- hardware.google.bluetooth.sar
- 1.1
-
- IBluetoothSar
- default
-
-
-
- hardware.google.bluetooth.ext
- 1.0
-
- IBluetoothExt
- default
-
-
-
- hardware.google.bluetooth.ewp
- 1.0
-
- IBluetoothEwp
- default
-
-
vendor.google.google_battery
1
diff --git a/init.display.sh b/init.display.sh
new file mode 100755
index 00000000..bb942e3f
--- /dev/null
+++ b/init.display.sh
@@ -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
+
diff --git a/init.insmod.gs201.cfg b/init.insmod.gs201.cfg
deleted file mode 100644
index 1eb29b9a..00000000
--- a/init.insmod.gs201.cfg
+++ /dev/null
@@ -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
diff --git a/init.insmod.sh b/init.insmod.sh
deleted file mode 100755
index 645391af..00000000
--- a/init.insmod.sh
+++ /dev/null
@@ -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