From 9ae4e34f25586dd261eb2e645fc0468ceb23ee84 Mon Sep 17 00:00:00 2001 From: Matsvei Niaverau Date: Mon, 5 Dec 2022 15:41:31 +0100 Subject: [PATCH] rosemary: rootdir: Pull missing project init Change-Id: If3405bc52fb1d09aa314f30000ea3ddf45df4b8c --- device.mk | 1 + rootdir/Android.bp | 7 +++ rootdir/etc/init.project.rc | 91 +++++++++++++++++++++++++++++++++++++ 3 files changed, 99 insertions(+) create mode 100644 rootdir/etc/init.project.rc diff --git a/device.mk b/device.mk index c45c884..0994b98 100644 --- a/device.mk +++ b/device.mk @@ -390,6 +390,7 @@ PRODUCT_PACKAGES += \ init.modem.rc \ init.mt6785.rc \ init.mt6785.usb.rc \ + init.project.rc \ init.sensor_1_0.rc \ init.stnfc.rc \ init.target.rc \ diff --git a/rootdir/Android.bp b/rootdir/Android.bp index 2ceaa24..0f2c619 100644 --- a/rootdir/Android.bp +++ b/rootdir/Android.bp @@ -44,6 +44,13 @@ prebuilt_etc { vendor: true, } +prebuilt_etc { + name: "init.project.rc", + src: "etc/init.project.rc", + sub_dir: "init/hw", + vendor: true, +} + prebuilt_etc { name: "init.sensor_1_0.rc", src: "etc/init.sensor_1_0.rc", diff --git a/rootdir/etc/init.project.rc b/rootdir/etc/init.project.rc new file mode 100644 index 0000000..6a90137 --- /dev/null +++ b/rootdir/etc/init.project.rc @@ -0,0 +1,91 @@ +# MTK project .rc configure +import init.mi_thermald.rc + +on init + mkdir /mnt/media_rw/usbotg 0700 media_rw media_rw + mkdir /storage/usbotg 0700 root root + +on post-fs-data + mkdir /data/vendor/thermal 0771 root system + mkdir /data/vendor/thermal/config 0771 root system + #thermal + chown system system /sys/class/thermal/thermal_message/sconfig +#Camera + chmod 0660 /dev/MAINAF + chown system camera /dev/MAINAF + + chmod 0660 /dev/MAINAF2 + chown system camera /dev/MAINAF2 + + chmod 0660 /dev/SUBAF + chown system camera /dev/SUBAF + + chmod 0660 /dev/GAF001AF + chown system camera /dev/GAF001AF + + chmod 0660 /dev/DW9714AF + chown system camera /dev/DW9714AF + + chmod 0660 /dev/LC898212AF + chown system camera /dev/LC898212AF + + chmod 0660 /dev/BU64745GWZAF + chown system camera /dev/BU64745GWZAF + +#XIAOMI_DUAL_CAM_BIN + mkdir /mnt/vendor/persist/camera/ 0777 system camera + mkdir /data/vendor/camera/ 0777 system camera +# for intsense bokeh use + mkdir /data/vendor/camera/model 0776 system camera + mkdir /data/vendor/camera/model/dof_model 0776 system camera + mkdir /data/vendor/camera/model/rt_model 0776 system camera + + copy /vendor/etc/camera/model/dof_model/capture_cache /data/vendor/camera/model/dof_model/capture_cache + copy /vendor/etc/camera/model/dof_model/capture_model /data/vendor/camera/model/dof_model/capture_model + copy /vendor/etc/camera/model/dof_model/capture_policy /data/vendor/camera/model/dof_model/capture_policy + copy /vendor/etc/camera/model/rt_model/preview_cache /data/vendor/camera/model/rt_model/preview_cache + copy /vendor/etc/camera/model/rt_model/preview_model /data/vendor/camera/model/rt_model/preview_model + copy /vendor/etc/camera/model/rt_model/preview_policy /data/vendor/camera/model/rt_model/preview_policy + + chmod 0666 /data/vendor/camera/model/dof_model/capture_cache + chmod 0666 /data/vendor/camera/model/dof_model/capture_model + chmod 0666 /data/vendor/camera/model/dof_model/capture_policy + chmod 0666 /data/vendor/camera/model/rt_model/preview_cache + chmod 0666 /data/vendor/camera/model/rt_model/preview_model + chmod 0666 /data/vendor/camera/model/rt_model/preview_policy + +# for mibokeh use + mkdir /data/vendor/camera/mibokeh 0776 system camera + +#SMB + chown system system /proc/smb/ScreenComm + chmod 0660 /proc/smb/ScreenComm + + chmod 0660 /dev/spm + chown system system /dev/spm + +#charge permission control + chmod 0777 /sys/class/power_supply/battery/charging_enabled + chown system system /sys/class/power_supply/battery/charging_enabled + +on init + # Refer to http://source.android.com/devices/tech/storage/index.html + # It said, "Starting in Android 4.4, multiple external storage devices are surfaced to developers through + # Context.getExternalFilesDirs(), Context.getExternalCacheDirs(), and Context.getObbDirs(). + # External storage devices surfaced through these APIs must be a semi-permanent part of the device (such as an SD card slot in a battery compartment). + # Developers expect data stored in these locations to be available over long periods of time." + # Therefore, if the target doesn't support sd hot-plugging (Ex: the SD card slot in a battery compartment), we need to export SECONDARY_STORAGE in 'boot' section + # + # export SECONDARY_STORAGE /storage/sdcard1 + +#add thermal tactics +on property:vendor.camera.boost.en=1 + write /sys/class/thermal/thermal_message/sconfig 12 +on property:vendor.camera.boost.en=0 + write /sys/class/thermal/thermal_message/sconfig 17 + +service fuse_usbotg /system/bin/sdcard -u 1023 -g 1023 -w 1023 -d /mnt/media_rw/usbotg /storage/usbotg + class late_start + disabled + +