diff --git a/device.mk b/device.mk
old mode 100644
new mode 100755
index 4c698b7..c635798
--- a/device.mk
+++ b/device.mk
@@ -126,6 +126,8 @@ PRODUCT_COPY_FILES += \
$(call add-to-product-copy-files-if-exists,device/rockchip/common/init.$(TARGET_BOARD_HARDWARE).bootmode.nvme.rc:$(TARGET_COPY_OUT_VENDOR)/etc/init/hw/init.$(TARGET_BOARD_HARDWARE).bootmode.nvme.rc) \
device/rockchip/common/ueventd.rockchip.rc:$(TARGET_COPY_OUT_VENDOR)/ueventd.rc \
device/rockchip/common/rk29-keypad.kl:system/usr/keylayout/rk29-keypad.kl \
+ device/rockchip/common/bin/mywatchdog.sh:vendor/bin/mywatchdog.sh \
+ device/rockchip/common/bin/mywatchdog.sh:system/bin/mywatchdog.sh \
diff --git a/init.root.rc b/init.root.rc
old mode 100644
new mode 100755
index a091424..70893bb
--- a/init.root.rc
+++ b/init.root.rc
@@ -9,3 +9,15 @@ service rootservice /vendor/bin/rootservice
#on property:sys.boot_completed=1
on property:persist.vendor.rootservice=1
start rootservice
+
+service mywatchdog /vendor/bin/sh /vendor/bin/mywatchdog.sh
+ user root
+ group root
+ disabled
+ oneshot
+ seclabel u:r:mywatchdog:s0
+
+
+on property:persist.vendor.rootservice=1
+ start mywatchdog
diff --git a/sepolicy/vendor/file_contexts b/sepolicy/vendor/file_contexts
old mode 100644
new mode 100755
index 3ffc776..7e05e21
--- a/sepolicy/vendor/file_contexts
+++ b/sepolicy/vendor/file_contexts
@@ -97,6 +97,9 @@
# for rootservice
/vendor/bin/rootservice u:object_r:rootservice_exec:s0
+# for mywatchdog
+/vendor/bin/mywatchdog.sh u:object_r:mywatchdog_exec:s0
+
/dev/block/mmcblk[0-9] u:object_r:uboot_block_device:s0
/dev/block/mmcblk[0-9]rpmb u:object_r:rpmb_block_device:s0
生成mywatchdog.te
########################################
# sepolicy rules for mywatchdog
########################################
type mywatchdog, domain;
type mywatchdog_exec, exec_type, vendor_file_type, file_type;
permissive mywatchdog;
init_daemon_domain(mywatchdog) 文章来源:https://www.toymoban.com/news/detail-472389.html
完成重新编译就可以
文章来源地址https://www.toymoban.com/news/detail-472389.html
到了这里,关于RK android 9.0 添加sh脚本开机自动运行的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!