]> code.ossystems Code Review - meta-freescale.git/commitdiff
cst: specify the non default keys pair
authorChunrong Guo <chunrong.guo@nxp.com>
Mon, 26 Aug 2019 03:36:57 +0000 (11:36 +0800)
committerOtavio Salvador <otavio@ossystems.com.br>
Wed, 4 Sep 2019 21:33:08 +0000 (18:33 -0300)
Signed-off-by: Chunrong Guo <chunrong.guo@nxp.com>
recipes-devtools/cst/cst_git.bb

index dcac949c953b908a25867d22d3d58b314c47fd1d..17fc9b381b83d6a8df088f35abbac43b42b72754 100644 (file)
@@ -9,6 +9,10 @@ RDEPENDS_${PN} = "bash"
 
 inherit kernel-arch
 
+# specify the non default keys pair for secure boot if needed
+#SECURE_PRI_KEY = "/path/srk.pri"
+#SECURE_PUB_KEY = "/path/srk.pub"
+
 SRC_URI = "git://source.codeaurora.org/external/qoriq/qoriq-components/cst;nobranch=1 \
 "
 SRCREV = "e04690ba2ca60f56eb126e01496ed0cacbd838d4"
@@ -21,6 +25,13 @@ PARALLEL_MAKE = ""
 
 do_install () {
     oe_runmake install DESTDIR=${D} BIN_DEST_DIR=${bindir}
+    if [ -n "${SECURE_PRI_KEY}" ]; then
+       cp -f ${SECURE_PRI_KEY} ${D}/${bindir}/cst/srk.pri
+       cp -f ${SECURE_PUB_KEY} ${D}/${bindir}/cst/srk.pub
+    elif [ ! -f ${D}/${bindir}/cst/srk.pri -o ! ${D}/${bindir}/cst/srk.pub ]; then
+       cd ${D}/${bindir}/cst  && ./gen_keys 1024
+    fi
+    
 }
 
 FILES_${PN}-dbg += "${bindir}/cst/.debug"