Commit 4fbe26dc authored by Evil-God's avatar Evil-God
Browse files

shinano-common: rootdir: Introduce a service to start suntrold

* suntrold is a oneshot service and spawns a subprocess which is required
  for the rear camera. Since [1] oneshot services' process groups are
  killed which prevents suntrold from working correctly.

* To work this issue around create a non-oneshot service, suntrold.sh, which
  never exits, so that suntrold can be started from it and it's subprocesses
  will not be killed.

[1] aosp-mirror/platform_system_core@d89ed13

[Idea of this is from LuK1337]
parent 26c383eb
......@@ -65,6 +65,14 @@ LOCAL_SRC_FILES := bin/credmgrfirstboot.sh
LOCAL_MODULE_PATH := $(TARGET_OUT_VENDOR_EXECUTABLES)
include $(BUILD_PREBUILT)
include $(CLEAR_VARS)
LOCAL_MODULE := suntrold.sh
LOCAL_MODULE_TAGS := optional
LOCAL_MODULE_CLASS := EXECUTABLES
LOCAL_SRC_FILES := bin/suntrold.sh
LOCAL_MODULE_PATH := $(TARGET_OUT_VENDOR_EXECUTABLES)
include $(BUILD_PREBUILT)
include $(CLEAR_VARS)
LOCAL_MODULE := tad_static
LOCAL_MODULE_TAGS := optional
......
#!/vendor/bin/sh
# Start suntrold
/vendor/bin/suntrold
# Sleep infinite to prevent that suntrold's subprocess gets killed
tail -f /dev/null
......@@ -101,6 +101,11 @@ service credmgrd /vendor/bin/credmgrd
socket credmgr stream 0660 system camera
disabled
service suntrold-sh /vendor/bin/suntrold.sh
class main
user system
group system camera
# Secure Config Transfer service
service sct_service /vendor/bin/sct_service
user root
......
......@@ -385,13 +385,6 @@ service ril-daemon1 /vendor/bin/hw/rild -c 2
on property:persist.radio.multisim.config=dsds
start ril-daemon1
# Start suntrold
service suntrold /vendor/bin/suntrold
user system
group system camera
oneshot
class main
# Modem Log QMI service
service mlog_qmi_service /vendor/bin/mlog_qmi_service
class core
......
......@@ -18,4 +18,7 @@ allow credmgrd system_data_root_file:dir { create_dir_perms relabelfrom };
allow credmgrd credmgrd_data_file:dir { create_dir_perms relabelto };
allow credmgrd credmgrd_data_file:file create_file_perms;
# Allow suntrold.sh to start suntrold
allow credmgrd credmgrd_exec:file rx_file_perms;
set_prop(credmgrd, credmgrd_prop)
dontaudit domain credmgrd_exec:file *;
dontaudit { domain -credmgrd } credmgrd_exec:file *;
......@@ -18,6 +18,7 @@
/(vendor|system/vendor)/bin/credmgrd u:object_r:credmgrd_exec:s0
/(vendor|system/vendor)/bin/credmgrfirstboot\.sh u:object_r:credmgrd_exec:s0
/(vendor|system/vendor)/bin/suntrold u:object_r:credmgrd_exec:s0
/(vendor|system/vendor)/bin/suntrold.sh u:object_r:credmgrd_exec:s0
# clean_scratch_files
/(vendor|system/vendor)/bin/clean_scratch_files u:object_r:clean_scratch_files_exec:s0
......
......@@ -137,7 +137,8 @@ PRODUCT_PACKAGES += \
ueventd.qcom.rc
PRODUCT_PACKAGES += \
credmgrfirstboot.sh
credmgrfirstboot.sh \
suntrold.sh
# Sensor file
PRODUCT_COPY_FILES += \
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment