From a8c3c6124b6f4d31ae35d891174dae329421aa3d Mon Sep 17 00:00:00 2001 From: Pierre-Hugues Husson Date: Sun, 5 Apr 2020 00:55:24 +0200 Subject: [PATCH] Add persist.sys.phh.no_vendor_overlay property to ignore vendor overlay --- base.mk | 1 + phh-on-data.sh | 7 +++++++ sepolicy/file_contexts | 1 + vndk.rc | 8 +++++++- 4 files changed, 16 insertions(+), 1 deletion(-) create mode 100644 phh-on-data.sh diff --git a/base.mk b/base.mk index 816b1d6..9fbeaca 100644 --- a/base.mk +++ b/base.mk @@ -56,6 +56,7 @@ PRODUCT_PACKAGES += \ PRODUCT_COPY_FILES += \ device/phh/treble/rw-system.sh:system/bin/rw-system.sh \ + device/phh/treble/phh-on-data.sh:system/bin/phh-on-data.sh \ device/phh/treble/phh-prop-handler.sh:system/bin/phh-prop-handler.sh \ device/phh/treble/fixSPL/getSPL.arm:system/bin/getSPL diff --git a/phh-on-data.sh b/phh-on-data.sh new file mode 100644 index 0000000..40ac0ae --- /dev/null +++ b/phh-on-data.sh @@ -0,0 +1,7 @@ +#!/system/bin/sh + +if getprop persist.sys.phh.no_vendor_overlay |grep -q true;then + for part in odm vendor;do + mount /mnt/phh/empty_dir/ /$part/overlay + done +fi diff --git a/sepolicy/file_contexts b/sepolicy/file_contexts index 5e13268..6da14ac 100644 --- a/sepolicy/file_contexts +++ b/sepolicy/file_contexts @@ -3,6 +3,7 @@ /system/etc/usb_audio_policy_configuration.xml u:object_r:vendor_configs_file:s0 /system/bin/rw-system.sh u:object_r:phhsu_exec:s0 /system/bin/phh-on-boot.sh u:object_r:phhsu_exec:s0 +/system/bin/phh-on-data.sh u:object_r:phhsu_exec:s0 /system/bin/asus-motor u:object_r:phhsu_exec:s0 #/system/bin/fsck\.exfat u:object_r:fsck_exec:s0 diff --git a/vndk.rc b/vndk.rc index cbd22fa..7a3526f 100644 --- a/vndk.rc +++ b/vndk.rc @@ -5,6 +5,12 @@ on post-fs setprop ro.vndk.version ${persist.sys.vndk} export LD_PRELOAD : +on property:vold.decrypt=trigger_restart_framework + exec - root -- /system/bin/phh-on-data.sh + +on early-boot + exec - root -- /system/bin/phh-on-data.sh + service phh_on_boot /system/bin/phh-on-boot.sh oneshot disabled @@ -27,4 +33,4 @@ on property:persist.sys.phh.oppo.usbotg=* exec_background u:r:phhsu_daemon:s0 root -- /system/bin/phh-prop-handler.sh "persist.sys.phh.oppo.usbotg" on property:persist.sys.phh.xiaomi.dt2w=* - exec_background u:r:phhsu_daemon:s0 root -- /system/bin/phh-prop-handler.sh "persist.sys.phh.xiaomi.dt2w" \ No newline at end of file + exec_background u:r:phhsu_daemon:s0 root -- /system/bin/phh-prop-handler.sh "persist.sys.phh.xiaomi.dt2w"