.bbappend for wolftpm to move over examples / readme update / option to disable or enable examples

pull/92/head
Aidan 2024-10-17 13:19:26 -07:00
parent 7fa9060df3
commit 9568c19088
2 changed files with 33 additions and 41 deletions

View File

@ -344,24 +344,9 @@ echo "nameserver 8.8.8.8" >> /etc/resolv.conf
wolfTPM Examples wolfTPM Examples
---------------- ----------------
Several wolfTPM example application recipes are included in this layer. These Several wolfTPM example application recipes are included in this layer. These include:
include:
- attestation TODO
- gpio
- pcr
- tls
- bench
- boot
- keygen
- csr
- endorsement
- firmware
- nvram
- management
- native
- pkcs7
- seal
- wrap
The recipes for these applications are located at: The recipes for these applications are located at:
``` ```

View File

@ -1,33 +1,40 @@
# For wolfTPM Examples # For wolfTPM Examples
WOLFTPM_DIR = "${S}/examples" WOLFTPM_TEST_DIR = "${S}/examples"
WOLFTPM_TARGET_DIR = "/home/root/wolftpm/examples" WOLFTPM_DIR = "/home/root/wolftpm/examples"
WOLFTPM_TEST_TARGET_DIR = "${D}${WOLFTPM_TARGET_DIR}" WOLFTPM_TEST_TARGET_DIR = "${D}${WOLFTPM_DIR}"
python () { python () {
distro_version = d.getVar('DISTRO_VERSION', True) enable_wolftpm_examples = d.getVar('ENABLE_WOLFTPM_EXAMPLES', True)
wolftpm_dir = d.getVar('WOLFTPM_DIR', True)
wolftpm_test_target_dir = d.getVar('WOLFTPM_TEST_TARGET_DIR', True)
bb.note("Installing Examples Directory for wolfTPM") if enable_wolftpm_examples == "1":
installDir = 'install -m 0755 -d "%s"\n' % (wolftpm_test_target_dir) distro_version = d.getVar('DISTRO_VERSION', True)
cpWolftpmExamples = 'cp -r %s/* %s\n' % (wolftpm_dir, wolftpm_test_target_dir) wolftpm_test_dir = d.getVar('WOLFTPM_TEST_DIR', True)
wolftpm_test_target_dir = d.getVar('WOLFTPM_TEST_TARGET_DIR', True)
d.appendVar('do_install', installDir) bb.note("Installing Examples Directory for wolfTPM")
d.appendVar('do_install', cpWolftpmExamples) installDir = 'install -m 0755 -d "%s"\n' % (wolftpm_test_target_dir)
cpWolftpmExamples = 'cp -r %s/* %s\n' % (wolftpm_test_dir, wolftpm_test_target_dir)
# Append to FILES:${PN} within the Python function d.appendVar('do_install', installDir)
files_var = 'FILES:' + d.getVar('PN', True) d.appendVar('do_install', cpWolftpmExamples)
wolftpm_example_files = wolftpm_test_target_dir + '/*'
pn = d.getVar('PN', True) # Remove the unwanted file
if distro_version and (distro_version.startswith('2.') or distro_version.startswith('3.')): d.appendVar('do_install', 'rm -f %s/run_examples.sh\n' % wolftpm_test_target_dir)
files_var_name = 'FILES_' + pn
else:
files_var_name = 'FILES:' + pn
current_files = d.getVar(files_var_name, True) or "" # Append to FILES:${PN} within the Python function
new_files = current_files + ' ' + wolftpm_example_files files_var = 'FILES:' + d.getVar('PN', True)
d.setVar(files_var_name, new_files) wolftpm_example_files = wolftpm_test_target_dir + '/*'
pn = d.getVar('PN', True)
wolftpm_dir = d.getVar('WOLFTPM_DIR', True)
if distro_version and (distro_version.startswith('2.') or distro_version.startswith('3.')):
files_var_name = 'FILES_' + pn
else:
files_var_name = 'FILES:' + pn
current_files = d.getVar(files_var_name, True) or ""
new_files = current_files + ' ' + wolftpm_dir + '/*'
d.setVar(files_var_name, new_files)
} }
# Python Specific option # Python Specific option