summaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
authorAdam Shih <adamshih@google.com>2020-09-28 10:54:24 +0800
committerAdam Shih <adamshih@google.com>2020-09-28 10:54:24 +0800
commitfb325b836f0a0ca13d0511361df1519201b2edf9 (patch)
tree229f3d4c3407be16aba94383ab62a3599b7e82c2 /common
parent3755dd4d32a8b3413d4a8620b4211ce9253e5340 (diff)
Move init.insmod.sh back to devices
Its permission is related to the module it loads, and they vary from device to device Bug: 168440095 Test: boot with no SELinux error log Change-Id: I0a9438ff776cec91aaf565e3c19d274520a13a51
Diffstat (limited to 'common')
-rwxr-xr-xcommon/init.insmod.sh53
-rw-r--r--common/pixel-common-device.mk3
2 files changed, 1 insertions, 55 deletions
diff --git a/common/init.insmod.sh b/common/init.insmod.sh
deleted file mode 100755
index a222838..0000000
--- a/common/init.insmod.sh
+++ /dev/null
@@ -1,53 +0,0 @@
-#!/vendor/bin/sh
-
-#############################################################
-### init.insmod.cfg format: ###
-### ----------------------------------------------------- ###
-### [insmod|setprop|enable/moprobe|wait] [path|prop name] ###
-### ... ###
-#############################################################
-
-# 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
-}
-
-if [ $# -eq 1 ]; then
- cfg_file=$1
-else
- 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 $(cat /vendor/lib/modules/modules.load)" ;;
- "*" | "")
- arg="$(cat /vendor/lib/modules/modules.load)" ;;
- esac
- modprobe -a -d /vendor/lib/modules $arg ;;
- "wait") wait_for_file $arg ;;
- esac
- done < $cfg_file
-fi
-
-# set property even if there is no insmod config
-# as property value "1" is expected in early-boot trigger
-setprop vendor.all.modules.ready 1
-setprop vendor.all.devices.ready 1
diff --git a/common/pixel-common-device.mk b/common/pixel-common-device.mk
index 827144f..35cd586 100644
--- a/common/pixel-common-device.mk
+++ b/common/pixel-common-device.mk
@@ -1,6 +1,5 @@
PRODUCT_COPY_FILES += \
- hardware/google/pixel/common/init.pixel.rc:$(TARGET_COPY_OUT_VENDOR)/etc/init/init.pixel.rc \
- hardware/google/pixel/common/init.insmod.sh:$(TARGET_COPY_OUT_VENDOR)/bin/init.insmod.sh
+ hardware/google/pixel/common/init.pixel.rc:$(TARGET_COPY_OUT_VENDOR)/etc/init/init.pixel.rc
BOARD_SEPOLICY_DIRS += hardware/google/pixel-sepolicy/common