sabrina: Import device-specific init-files/properties
authorNolen Johnson <johnsonnolen@gmail.com>
Wed, 21 Jul 2021 23:52:32 +0000 (19:52 -0400)
committerNolen Johnson <johnsonnolen@gmail.com>
Tue, 27 Jul 2021 15:36:20 +0000 (11:36 -0400)
Change-Id: I36e872979960d98e6cde9c8fbfbf64b76508ad69

device.mk
init-files/init.amlogic.sku.rc [new file with mode: 0644]
init-files/init.amlogic.wifi_buildin.rc
init-files/tee_hdcp.rc [new file with mode: 0644]
init-files/tee_key_inject.rc [new file with mode: 0644]
vendor.prop

index 91180bb7ad500c1cb63c91ebdc1d019721ec8c11..971ddb6b8d38db3589c9ac9e479d1fe400a259db 100644 (file)
--- a/device.mk
+++ b/device.mk
@@ -16,6 +16,9 @@ PRODUCT_PACKAGES += \
 
 ## Init-Files
 PRODUCT_COPY_FILES += \
+    $(DEVICE_PATH)/init-files/tee_hdcp.rc:$(TARGET_COPY_OUT_VENDOR)/etc/init/tee_hdcp.rc \
+    $(DEVICE_PATH)/init-files/tee_key_inject.rc:$(TARGET_COPY_OUT_VENDOR)/etc/init/tee_key_inject.rc \
+    $(DEVICE_PATH)/init-files/init.amlogic.sku.rc:$(TARGET_COPY_OUT_VENDOR)/etc/init/hw/init.amlogic.sku.rc \
     $(DEVICE_PATH)/init-files/init.amlogic.wifi_buildin.rc:$(TARGET_COPY_OUT_VENDOR)/etc/init/hw/init.amlogic.wifi_buildin.rc
 
 ## Kernel Modules
diff --git a/init-files/init.amlogic.sku.rc b/init-files/init.amlogic.sku.rc
new file mode 100644 (file)
index 0000000..438f25f
--- /dev/null
@@ -0,0 +1,71 @@
+on early-init && property:ro.boot.hardware.sku=*
+    setprop ro.boot.product.hardware.sku ${ro.boot.hardware.sku}
+
+on init
+    # Set sku to US if it was not set by the bootloader
+    setprop ro.boot.product.hardware.sku US
+    trigger sku-init
+
+on sku-init
+    # Allow PAI targeting per hardware SKU
+    setprop ro.oem.key1 ATV00100020-${ro.boot.product.hardware.sku}
+
+on sku-init && property:ro.boot.product.hardware.sku=US
+    setprop ro.boot.wificountrycode US
+    setprop ro.boot.oem.locales en-US,es-US
+
+on sku-init && property:ro.boot.product.hardware.sku=CA
+    setprop ro.boot.wificountrycode CA
+    setprop ro.boot.oem.locales en-US,fr-CA
+
+on sku-init && property:ro.boot.product.hardware.sku=GB
+    setprop ro.boot.wificountrycode EU
+    setprop ro.boot.oem.locales en-GB
+
+on sku-init && property:ro.boot.product.hardware.sku=IE
+    setprop ro.boot.wificountrycode EU
+    setprop ro.boot.oem.locales en-GB
+
+on sku-init && property:ro.boot.product.hardware.sku=DE
+    setprop ro.boot.wificountrycode EU
+    setprop ro.boot.oem.locales de-DE
+
+on sku-init && property:ro.boot.product.hardware.sku=FR
+    setprop ro.boot.wificountrycode EU
+    setprop ro.boot.oem.locales fr-FR
+
+on sku-init && property:ro.boot.product.hardware.sku=NL
+    setprop ro.boot.wificountrycode EU
+    setprop ro.boot.oem.locales de-DE,fr-FR,nl-NL
+
+on sku-init && property:ro.boot.product.hardware.sku=NO
+    setprop ro.boot.wificountrycode EU
+    setprop ro.boot.oem.locales en-GB,nb-NO,sv-SE,da-DK,fi-FI
+
+on sku-init && property:ro.boot.product.hardware.sku=IT
+    setprop ro.boot.wificountrycode EU
+    setprop ro.boot.oem.locales es-ES,it-IT
+
+on sku-init && property:ro.boot.product.hardware.sku=AU
+    setprop ro.boot.wificountrycode AU
+    setprop ro.boot.oem.locales en-AU
+
+on sku-init && property:ro.boot.product.hardware.sku=JP
+    setprop ro.boot.wificountrycode JP
+    setprop ro.boot.oem.locales ja-JP
+
+on sku-init && property:ro.boot.product.hardware.sku=KR
+    setprop ro.boot.wificountrycode KR
+    setprop ro.boot.oem.locales ko-KR
+
+on sku-init && property:ro.boot.product.hardware.sku=IN
+    setprop ro.boot.wificountrycode US
+    setprop ro.boot.oem.locales hi-IN,en-IN
+
+on sku-init && property:ro.boot.product.hardware.sku=MX
+    setprop ro.boot.wificountrycode US
+    setprop ro.boot.oem.locales es-US
+
+on sku-init && property:ro.boot.product.hardware.sku=TW
+    setprop ro.boot.wificountrycode US
+    setprop ro.boot.oem.locales zh-TW,en-US
index 797982214ea0105672baecb6d1437ce184040f33..ee31023959995f06e78dda59d9aecc891b2948cb 100644 (file)
@@ -1,3 +1,5 @@
+import /vendor/etc/init/hw/init.amlogic.sku.rc
+
 on boot
     insmod /vendor/lib/modules/dhd.ko firmware_path=/vendor/etc/wifi/buildin/ nvram_path=/vendor/etc/wifi/buildin/
     chown root wifi /sys/module/dhd/parameters/firmware_path
diff --git a/init-files/tee_hdcp.rc b/init-files/tee_hdcp.rc
new file mode 100644 (file)
index 0000000..ff0e675
--- /dev/null
@@ -0,0 +1,8 @@
+on property:vold.post_fs_data_done=1
+       start tee_hdcp
+
+service tee_hdcp /vendor/bin/tee_hdcp
+       oneshot
+       user root
+       group system
+       seclabel u:r:tee:s0
diff --git a/init-files/tee_key_inject.rc b/init-files/tee_key_inject.rc
new file mode 100644 (file)
index 0000000..5bfd630
--- /dev/null
@@ -0,0 +1,71 @@
+on late-fs
+       restorecon_recursive /mnt/vendor/factory
+       exec_start tee_provision_otp
+       rm /mnt/vendor/factory/otp.pkg
+
+       mount ext4 /dev/block/factory /mnt/vendor/factory ro remount
+
+       exec_start tee_provision_password_hash
+
+       exec_start tee_key_inject_wv_key
+       exec_start tee_key_inject_pr3_key
+       exec_start tee_key_inject_pr3_crt
+       exec_start tee_key_inject_hdcp14tx
+       exec_start tee_key_inject_hdcp22tx
+       exec_start tee_key_inject_attestation_key
+       exec_start tee_key_inject_nf
+
+
+service tee_provision_otp /vendor/bin/tee_provision /mnt/vendor/factory/otp.pkg
+       oneshot
+       user root
+       group system
+       seclabel u:r:tee:s0
+
+service tee_provision_password_hash /vendor/bin/tee_provision_password_hash
+       oneshot
+       user root
+       group system
+       seclabel u:r:tee:s0
+
+service tee_key_inject_wv_key /vendor/bin/tee_key_inject -t 0x11 -i /mnt/vendor/factory/wv.key -p vendor.sys.tee_key_inject_wv_key
+       oneshot
+       user root
+       group system
+       seclabel u:r:tee:s0
+
+service tee_key_inject_pr3_key /vendor/bin/tee_key_inject -t 0x21 -i /mnt/vendor/factory/pr3.key -p vendor.sys.tee_key_inject_pr3_key
+       oneshot
+       user root
+       group system
+       seclabel u:r:tee:s0
+
+service tee_key_inject_pr3_crt /vendor/bin/tee_key_inject -t 0x22 -i /mnt/vendor/factory/pr3.crt -p vendor.sys.tee_key_inject_pr3_crt
+       oneshot
+       user root
+       group system
+       seclabel u:r:tee:s0
+
+service tee_key_inject_hdcp14tx /vendor/bin/tee_key_inject -t 0x31 -i /mnt/vendor/factory/hdcp14tx.key -p vendor.sys.tee_key_inject_hdcp14tx
+       oneshot
+       user root
+       group system
+       seclabel u:r:tee:s0
+
+service tee_key_inject_hdcp22tx /vendor/bin/tee_key_inject -t 0x32 -i /mnt/vendor/factory/hdcp22tx.key -p vendor.sys.tee_key_inject_hdcp22tx
+       oneshot
+       user root
+       group system
+       seclabel u:r:tee:s0
+
+service tee_key_inject_attestation_key /vendor/bin/tee_key_inject -t 0x42 -i /mnt/vendor/factory/android_attestation.key -n attestationkeybox -p vendor.sys.tee_key_inject_attestation_key
+       oneshot
+       user root
+       group system
+       seclabel u:r:tee:s0
+
+service tee_key_inject_nf /vendor/bin/tee_key_inject -t 0x61 -i /mnt/vendor/factory/nf.key -p vendor.sys.tee_key_inject_nf
+       oneshot
+       user root
+       group system
+       seclabel u:r:tee:s0
index 7288b609dcf73fa5c644bfbf9eec16ea717688b6..be6360886c407b5fb48a0a6dbce9a1fc66bf4b98 100644 (file)
@@ -7,6 +7,12 @@
 ## Bluetooth
 ro.bt.bdaddr_path=/sys/class/bt_addr/value
 
+## Dolby
+persist.vendor.sys.dolbyvision.enable=true
+persist.vendor.sys.tv.dolbyvision.enable=true
+ro.vendor.platform.support.dolbyvision=true
+vendor.media.support.dolbyvision=true
+
 ## FRP
 ro.frp.pst=/dev/block/by-name/frp