@Duke3D
Sorry to reply you so late, you can add your script to the system as follows, and you can execute it in adb
- The path is /device/khadas
From e972bdb3c0364ffebecf582d91e0e56012bb2a9b Mon Sep 17 00:00:00 2001
From: Xiong Zhang <xiong.zhang@wesion.com>
Date: Thu, 23 Mar 2023 14:01:46 +0800
Subject: [PATCH] test1
Signed-off-by: Xiong Zhang <xiong.zhang@wesion.com>
---
common/sepolicy/file_contexts | 1 +
common/sepolicy/powermanagement.te | 11 +++++++++++
kvim3/init.amlogic.board.rc | 14 ++++++++++++++
kvim3/kvim3.mk | 6 ++++++
kvim3/powermanagement/powermanagement.sh | 3 +++
5 files changed, 35 insertions(+)
create mode 100644 common/sepolicy/powermanagement.te
create mode 100644 kvim3/powermanagement/powermanagement.sh
diff --git a/common/sepolicy/file_contexts b/common/sepolicy/file_contexts
index b8577c5..c379033 100644
--- a/common/sepolicy/file_contexts
+++ b/common/sepolicy/file_contexts
@@ -296,6 +296,7 @@
/vendor/bin/tee-supplicant u:object_r:tee_exec:s0
/vendor/bin/tee_hdcp u:object_r:tee_exec:s0
/vendor/bin/tee_preload_fw u:object_r:firmload_exec:s0
+/vendor/bin/powermanagement.sh u:object_r:powermanagement_exec:s0
/vendor/bin/tvserver u:object_r:tvserver_exec:s0
/vendor/bin/dtvkitserver u:object_r:dtvkitserver_exec:s0
diff --git a/common/sepolicy/powermanagement.te b/common/sepolicy/powermanagement.te
new file mode 100644
index 0000000..82d7dee
--- /dev/null
+++ b/common/sepolicy/powermanagement.te
@@ -0,0 +1,11 @@
+########################################
+# sepolicy rules for powermanagement
+########################################
+
+type powermanagement, domain, vendor_executes_system_violators, data_between_core_and_vendor_violators;
+
+type powermanagement_exec, exec_type, vendor_file_type, file_type;
+
+permissive powermanagement;
+
+init_daemon_domain(powermanagement)
diff --git a/kvim3/init.amlogic.board.rc b/kvim3/init.amlogic.board.rc
index e36b9f6..64a267b 100755
--- a/kvim3/init.amlogic.board.rc
+++ b/kvim3/init.amlogic.board.rc
@@ -81,6 +81,8 @@ on property:sys.boot_completed=1
#cmdline
chmod 666 /proc/cmdline
+chmod 777 /vendor/bin/powermanagement.sh
+
service preinstall /system/bin/preinstall.sh
user root
group root
@@ -89,3 +91,15 @@ service preinstall /system/bin/preinstall.sh
on property:sys.boot_completed=1
start preinstall
+
+service powermanagement /vendor/bin/powermanagement.sh
+ class main
+ user root
+ group root
+ oneshot
+
+on property:persist.powermanagement.service=1
+ start powermanagement
+
+on property:persist.powermanagement.service=0
+ stop powermanagement
diff --git a/kvim3/kvim3.mk b/kvim3/kvim3.mk
index 6fe7484..cf225a2 100644
--- a/kvim3/kvim3.mk
+++ b/kvim3/kvim3.mk
@@ -44,6 +44,9 @@ $(shell python device/khadas/kvim3/auto_generator.py preinstall)
PRODUCT_COPY_FILES += \
device/khadas/kvim3/preinstall/preinstall.sh:system/bin/preinstall.sh
+
+PRODUCT_COPY_FILES += \
+ device/khadas/kvim3/powermanagement/powermanagement.sh:/vendor/bin/powermanagement.sh
#########################################################################
#
# media ext
@@ -84,6 +87,9 @@ PRODUCT_PROPERTY_OVERRIDES += \
PRODUCT_PROPERTY_OVERRIDES += \
persist.sys.func.key.action=102
+PRODUCT_PROPERTY_OVERRIDES += \
+ persist.powermanagement.service=0
+
#wifi hotpot
PRODUCT_PROPERTY_OVERRIDES += \
persist.sys.softap.band=0
diff --git a/kvim3/powermanagement/powermanagement.sh b/kvim3/powermanagement/powermanagement.sh
new file mode 100644
index 0000000..23b114c
--- /dev/null
+++ b/kvim3/powermanagement/powermanagement.sh
@@ -0,0 +1,3 @@
+#!/system/bin/sh
+#
+echo "just test" >> /sdcard/shelltest
\ No newline at end of file
--
2.17.1
From 58bb3dbc8234c954400954fd5032e9a606fdc5f5 Mon Sep 17 00:00:00 2001
From: Xiong Zhang <xiong.zhang@wesion.com>
Date: Thu, 23 Mar 2023 14:02:03 +0800
Subject: [PATCH] test2
Signed-off-by: Xiong Zhang <xiong.zhang@wesion.com>
---
init/stable_properties.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/init/stable_properties.h b/init/stable_properties.h
index 4972d101f..ca3552c64 100644
--- a/init/stable_properties.h
+++ b/init/stable_properties.h
@@ -25,7 +25,7 @@ namespace init {
static constexpr const char* kPartnerPrefixes[] = {
"init.svc.vendor.", "ro.vendor.", "persist.vendor.", "vendor.", "init.svc.odm.", "ro.odm.",
- "persist.odm.", "odm.", "ro.boot.",
+ "persist.odm.", "odm.", "ro.boot.", "persist.powermanagement.",
};
static const std::set<std::string> kExportedActionableProperties = {
--
2.17.1
This file is the script file you want to execute, and the content inside is DIY according to your actual situation