.bbappend for wolftpm to move over examples / readme update / option to disable or enable examples
parent
7fa9060df3
commit
9568c19088
21
README.md
21
README.md
|
@ -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:
|
||||||
```
|
```
|
||||||
|
|
|
@ -1,32 +1,39 @@
|
||||||
# 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 () {
|
||||||
|
enable_wolftpm_examples = d.getVar('ENABLE_WOLFTPM_EXAMPLES', True)
|
||||||
|
|
||||||
|
if enable_wolftpm_examples == "1":
|
||||||
distro_version = d.getVar('DISTRO_VERSION', True)
|
distro_version = d.getVar('DISTRO_VERSION', True)
|
||||||
wolftpm_dir = d.getVar('WOLFTPM_DIR', True)
|
wolftpm_test_dir = d.getVar('WOLFTPM_TEST_DIR', True)
|
||||||
wolftpm_test_target_dir = d.getVar('WOLFTPM_TEST_TARGET_DIR', True)
|
wolftpm_test_target_dir = d.getVar('WOLFTPM_TEST_TARGET_DIR', True)
|
||||||
|
|
||||||
bb.note("Installing Examples Directory for wolfTPM")
|
bb.note("Installing Examples Directory for wolfTPM")
|
||||||
installDir = 'install -m 0755 -d "%s"\n' % (wolftpm_test_target_dir)
|
installDir = 'install -m 0755 -d "%s"\n' % (wolftpm_test_target_dir)
|
||||||
cpWolftpmExamples = 'cp -r %s/* %s\n' % (wolftpm_dir, wolftpm_test_target_dir)
|
cpWolftpmExamples = 'cp -r %s/* %s\n' % (wolftpm_test_dir, wolftpm_test_target_dir)
|
||||||
|
|
||||||
d.appendVar('do_install', installDir)
|
d.appendVar('do_install', installDir)
|
||||||
d.appendVar('do_install', cpWolftpmExamples)
|
d.appendVar('do_install', cpWolftpmExamples)
|
||||||
|
|
||||||
|
# Remove the unwanted file
|
||||||
|
d.appendVar('do_install', 'rm -f %s/run_examples.sh\n' % wolftpm_test_target_dir)
|
||||||
|
|
||||||
# Append to FILES:${PN} within the Python function
|
# Append to FILES:${PN} within the Python function
|
||||||
files_var = 'FILES:' + d.getVar('PN', True)
|
files_var = 'FILES:' + d.getVar('PN', True)
|
||||||
wolftpm_example_files = wolftpm_test_target_dir + '/*'
|
wolftpm_example_files = wolftpm_test_target_dir + '/*'
|
||||||
|
|
||||||
pn = d.getVar('PN', True)
|
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.')):
|
if distro_version and (distro_version.startswith('2.') or distro_version.startswith('3.')):
|
||||||
files_var_name = 'FILES_' + pn
|
files_var_name = 'FILES_' + pn
|
||||||
else:
|
else:
|
||||||
files_var_name = 'FILES:' + pn
|
files_var_name = 'FILES:' + pn
|
||||||
|
|
||||||
current_files = d.getVar(files_var_name, True) or ""
|
current_files = d.getVar(files_var_name, True) or ""
|
||||||
new_files = current_files + ' ' + wolftpm_example_files
|
new_files = current_files + ' ' + wolftpm_dir + '/*'
|
||||||
d.setVar(files_var_name, new_files)
|
d.setVar(files_var_name, new_files)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue