diff options
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.bb | 27 |
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 |
