summaryrefslogtreecommitdiff
path: root/distribution/yocto-advanced/meta-schulung-extended/recipes-core/keys
diff options
context:
space:
mode:
authorJohn Ogness <john.ogness@linutronix.de>2017-12-19 11:16:28 +0100
committerJohn Ogness <john.ogness@linutronix.de>2017-12-19 11:16:28 +0100
commit6e7e1b7172813fc4ecb60597f903dd21a4616159 (patch)
treedbfe0b8f1a3d51c275722ba86d4ffe109ee88aef /distribution/yocto-advanced/meta-schulung-extended/recipes-core/keys
parent270520b4a2eac8725c8575c3180964289722e191 (diff)
update yocto-advanced: sync to devel/manut/yocto
The devel/manut/yocto heavily diverted from master. Sync with latest version 8cd4956a9b48a316eab6dc6d1b1f6cd51362fecf. Signed-off-by: John Ogness <john.ogness@linutronix.de>
Diffstat (limited to 'distribution/yocto-advanced/meta-schulung-extended/recipes-core/keys')
-rw-r--r--distribution/yocto-advanced/meta-schulung-extended/recipes-core/keys/keys-native.bb27
1 files changed, 27 insertions, 0 deletions
diff --git a/distribution/yocto-advanced/meta-schulung-extended/recipes-core/keys/keys-native.bb b/distribution/yocto-advanced/meta-schulung-extended/recipes-core/keys/keys-native.bb
new file mode 100644
index 0000000..0d97038
--- /dev/null
+++ b/distribution/yocto-advanced/meta-schulung-extended/recipes-core/keys/keys-native.bb
@@ -0,0 +1,27 @@
+# openssl is needed during build time to generate the keys
+DEPENDS += "openssl-native dtc-native"
+
+# specify a license (required for packages)
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302"
+
+# perform key generation as the compile task
+do_compile () {
+ openssl genpkey -algorithm RSA -out dev.key \
+ -pkeyopt rsa_keygen_bits:4096
+ openssl req -batch -new -x509 -sha512 -key dev.key -out dev.crt
+ openssl x509 -noout -text -in dev.crt
+
+ # this combined file could be used by kernel module signing
+ cat dev.crt dev.key > dev.pem
+}
+
+# install the keys to the datadir
+do_install () {
+ install -D -m 0644 dev.key ${D}/${datadir}/keys/dev.key
+ install -D -m 0644 dev.crt ${D}/${datadir}/keys/dev.crt
+ install -D -m 0644 dev.pem ${D}/${datadir}/keys/dev.pem
+}
+
+# this is a native package
+inherit native