[Feature]add MT2731_MP2_MR2_SVN388 baseline version
Change-Id: Ief04314834b31e27effab435d3ca8ba33b499059
diff --git a/meta/meta-mediatek/recipes-support/encryptlibrary-init/HOWTO b/meta/meta-mediatek/recipes-support/encryptlibrary-init/HOWTO
new file mode 100644
index 0000000..d0982a1
--- /dev/null
+++ b/meta/meta-mediatek/recipes-support/encryptlibrary-init/HOWTO
@@ -0,0 +1,10 @@
+MTK side:
+1.encrypt library on platform with command "secure_program enc [path/to/library] [path/to/encryptedlibrary]
+2.put encryptedlibrary in folder "files"
+
+Customer side:
+1.put encryptedlibrary in folder "files" after receiving encryptedlibrary
+2.make sure or modify "EncryptedLibraryName" value to library name in encryptlibrary-init.bb
+4.add encryptlibrary-init in image:
+eg: add encryptlibrary-init in section "IMAGE_INSTALL_append" of meta/meta-mediatek-mt8516/recipes-audio/images/mtk-image-aud-8516.bb
+5.at bootup time, the encryptedlibrary will be decrypted and put in /tmp
diff --git a/meta/meta-mediatek/recipes-support/encryptlibrary-init/encryptlibrary-init.bb b/meta/meta-mediatek/recipes-support/encryptlibrary-init/encryptlibrary-init.bb
new file mode 100644
index 0000000..c187b4c
--- /dev/null
+++ b/meta/meta-mediatek/recipes-support/encryptlibrary-init/encryptlibrary-init.bb
@@ -0,0 +1,35 @@
+inherit workonsrc
+inherit pkgconfig
+inherit systemd
+
+DESCRIPTION = "Encrypted Library Decryption Helper"
+LICENSE = "MediaTekProprietary"
+LIC_FILES_CHKSUM = "file://COPYING;md5=d7810fab7487fb0aad327b76f1be7cd7"
+APPS_SRC = "${TOPDIR}/../meta/meta-mediatek/recipes-support/encryptlibrary-init"
+SECURE_PROGRAM = "secure_program"
+WORKONSRC = "${APPS_SRC}"
+
+#####Customization Start#####
+EncryptedLibraryName = "libMtkOmxEac3Dec.so"
+#####Customization End#####
+
+SYSTEMD_PACKAGES = "${PN}"
+SYSTEMD_SERVICE_${PN} = "encryptlibrary-init.service"
+FILES_${PN} += "${systemd_unitdir}/system/encryptlibrary-init.service"
+FILES_${PN} += "etc/encryptlibrary-init.sh"
+FILES_${PN} += "${libdir}/encrypted/${EncryptedLibraryName}"
+
+do_install() {
+ install -d ${D}${systemd_system_unitdir}
+ install -m 0755 ${S}files/encryptlibrary-init.service ${D}${systemd_system_unitdir}
+
+ install -d ${D}/etc
+ install -m 755 ${S}files/encryptlibrary-init.sh ${D}/etc/encryptlibrary-init.sh
+
+ install -d ${D}${libdir}/encrypted
+ install -m 644 ${S}files/${EncryptedLibraryName} ${D}${libdir}/encrypted
+
+ echo "${SECURE_PROGRAM} dec /usr/lib/encrypted/${EncryptedLibraryName} /tmp/${EncryptedLibraryName}" >> ${D}/etc/encryptlibrary-init.sh
+}
+
+
diff --git a/meta/meta-mediatek/recipes-support/encryptlibrary-init/files/encryptlibrary-init.service b/meta/meta-mediatek/recipes-support/encryptlibrary-init/files/encryptlibrary-init.service
new file mode 100644
index 0000000..678f1e8
--- /dev/null
+++ b/meta/meta-mediatek/recipes-support/encryptlibrary-init/files/encryptlibrary-init.service
@@ -0,0 +1,10 @@
+[Unit]
+Description=EncryptedFileDecryptedHelperScript
+
+[Service]
+ExecStart=/etc/encryptlibrary-init.sh
+Type=simple
+
+[Install]
+Alias=DecryptionHelperScript
+WantedBy=multi-user.target
\ No newline at end of file
diff --git a/meta/meta-mediatek/recipes-support/encryptlibrary-init/files/encryptlibrary-init.sh b/meta/meta-mediatek/recipes-support/encryptlibrary-init/files/encryptlibrary-init.sh
new file mode 100644
index 0000000..cf14349
--- /dev/null
+++ b/meta/meta-mediatek/recipes-support/encryptlibrary-init/files/encryptlibrary-init.sh
@@ -0,0 +1,4 @@
+#!/bin/sh
+#
+# @author
+# @brief generate the top index for each module doc