Added meta recipie / updated README.md and conf

pull/92/head
Aidan 2024-10-10 16:36:52 -07:00
parent 4af45d7eca
commit cb46448a1f
3 changed files with 150 additions and 1 deletions

View File

@ -290,7 +290,6 @@ looks as follows:
Testing Wolfssl-py and Wolfcrypt-py
-----------------------------------
To test the python wrapper for wolfSSL and wolfcrypt in a yocto build it will
require python3, python3-pytest, python3-cffi and wolfSSL are built on the target system.
@ -342,6 +341,79 @@ to add a DNS server to /etc/resolv.conf like such with root perms
echo "nameserver 8.8.8.8" >> /etc/resolv.conf
```
wolfTPM examples
----------------
Several wolfTPM example application recipes are included in this layer. These
include:
- attestation
- gpio
- pcr
- tls
- bench
- boot
- keygen
- csr
- endorsement
- firmware
- nvram
- management
- native
- pkcs7
- seal
- wrap
The recipes for these applications are located at:
```
meta-wolfssl/recipes-examples/wolftpm/wolftpm-examples.bb
```
This can be compiled with bitbake:
```
$ bitbake wolftpm-examples
```
To install these applications into your image, you will need to edit your
"build/conf/local.conf" file and add them to the "IMAGE_INSTALL"
variable. You would need to do something like this for wolfssl, wolftpm, and wolftpm-examples:
- For Dunfell and newer versions of Yocto
```
IMAGE_INSTALL:append = " wolfssl wolftpm wolftpm-examples "
```
- For versions of Yocto older than Dunfell
```
IMAGE_INSTALL_append = " wolfssl wolftpm wolftpm-examples "
```
When your image builds, these will be installed to the '/usr/bin' system
directory. When inside your executing image, you can run them from the
terminal.
additional information
----------------------
Use to re-source your build environment
```
source ../poky/oe-init-build-env
```
Check for active bitbake processes
```
ps aux | grep bitbake
```
to kill any processes
```
kill <PID>
```
Dependencies and More
---------------------
wolfProvider
------------
To build wolfProvider view the instructions in this [README](recipes-wolfssl/wolfprovider/README.md)

View File

@ -1,6 +1,9 @@
# We have a conf and classes directory, add to BBPATH
BBPATH := "${LAYERDIR}:${BBPATH}"
# Add specific `wolf*` to run bitbake
IMAGE_INSTALL:append = "wolftpm wolfssl wolftpm-examples "
# We have a packages directory, add to BBFILES
BBFILES += "${LAYERDIR}/recipes-wolfssl/wolfssl/*.bb \
${LAYERDIR}/recipes-wolfssl/wolfssl/*.bbappend"
@ -75,6 +78,11 @@ BBFILES += "${@bb.utils.contains('IMAGE_INSTALL', \
'${LAYERDIR}/recipes-examples/wolfengine/wolfenginetest/*.bb ${LAYERDIR}/recipes-examples/wolfengine/wolfenginetest/*.bbappend', \
'', d)}"
BBFILES += "${@bb.utils.contains('IMAGE_INSTALL', \
'wolftpm-examples', \
'${LAYERDIR}/recipes-examples/wolftpm/*.bb ${LAYERDIR}/recipes-examples/wolftpm/*.bbappend', \
'', d)}"
# Uncomment if building bind with wolfSSL.
#BBFILES += "${LAYERDIR}/recipes-connectivity/bind/*.bbappend"

View File

@ -0,0 +1,69 @@
SUMMARY = "Examples for wolfTPM"
DESCRIPTION = "This recipe provides examples for wolfTPM"
HOMEPAGE = "https://www.wolfssl.com/products/wolfssl"
LICENSE = "GPL-2.0-only"
LIC_FILES_CHKSUM = "file://LICENSE;md5=b234ee4d69f5fce4486a80fdaf4a4263"
SRC_URI = "git://github.com/wolfSSL/wolfTPM/examples.git;nobranch=1;protocol=https;rev=a5f6c912ac6903872d9666238440a76bc9f92517"
DEPENDS += "wolfssl wolftpm"
S = "${WORKDIR}/git/wolfTPM/examples"
do_compile() {
# Iterate through each directory and compile C files
for dir in attestation \
gpio \
pcr \
tls \
bench \
boot \
keygen \
csr \
endorsement \
firmware \
nvram \
management \
native \
pkcs7 \
seal \
wrap \
timestamp; do
for src in ${S}/$dir/*.c; do
exe_name=$(basename $src .c)
${CC} $src -o ${D}/usr/bin/$exe_name ${CFLAGS} ${LDFLAGS} -lwolfssl -lwolfTPM -ldl
done
done
}
do_install() {
install -d ${D}/usr/bin
for dir in attestation \
gpio \
pcr \
tls \
bench \
boot \
keygen \
csr \
endorsement \
firmware \
nvram \
management \
native \
pkcs7 \
seal \
wrap \
timestamp; do
for src in ${S}/$dir/*.c; do
exe_name=$(basename $src .c)
install -m 0755 ${D}/usr/bin/$exe_name ${D}/usr/bin/
done
done
install -d ${D}/usr/include/wolftpm
install -m 0644 ${S}/tpm_test_keys.h ${D}/usr/include/wolftpm/
install -m 0644 ${S}/tpm_test.h ${D}/usr/include/wolftpm/
}
PACKAGES = "${PN} ${PN}-dev"