diff options
| -rw-r--r-- | conf/layer.conf | 1 | ||||
| -rw-r--r-- | lib/oeqa/selftest/cases/updater.py | 9 | ||||
| -rw-r--r-- | recipes-bsp/grub/grub-efi_%.bbappend | 2 | ||||
| -rw-r--r-- | recipes-sota/aktualizr/aktualizr-auto-prov.bb | 7 | ||||
| -rw-r--r-- | recipes-sota/aktualizr/aktualizr-ca-implicit-prov.bb | 11 | ||||
| -rw-r--r-- | recipes-sota/aktualizr/aktualizr-hsm-prov.bb | 12 | ||||
| -rw-r--r-- | recipes-sota/aktualizr/aktualizr-implicit-prov.bb | 10 | ||||
| -rwxr-xr-x | recipes-sota/aktualizr/aktualizr_git.bb | 5 | ||||
| -rw-r--r-- | recipes-support/ca-certificates/ca-certificates_%.bbappend | 1 | ||||
| -rwxr-xr-x | scripts/find_packages.py | 125 |
10 files changed, 158 insertions, 25 deletions
diff --git a/conf/layer.conf b/conf/layer.conf index 942ef6a..798ceba 100644 --- a/conf/layer.conf +++ b/conf/layer.conf | |||
| @@ -10,3 +10,4 @@ BBFILE_PATTERN_sota = "^${LAYERDIR}/" | |||
| 10 | BBFILE_PRIORITY_sota = "7" | 10 | BBFILE_PRIORITY_sota = "7" |
| 11 | 11 | ||
| 12 | LAYERDEPENDS_sota = "filesystems-layer" | 12 | LAYERDEPENDS_sota = "filesystems-layer" |
| 13 | LAYERSERIES_COMPAT_sota = "sumo" | ||
diff --git a/lib/oeqa/selftest/cases/updater.py b/lib/oeqa/selftest/cases/updater.py index 2efef15..0253a84 100644 --- a/lib/oeqa/selftest/cases/updater.py +++ b/lib/oeqa/selftest/cases/updater.py | |||
| @@ -71,17 +71,17 @@ class GeneralTests(OESelftestTestCase): | |||
| 71 | 71 | ||
| 72 | logger.info('Running bitbake with man in the image package list') | 72 | logger.info('Running bitbake with man in the image package list') |
| 73 | self.append_config('IMAGE_INSTALL_append = " man "') | 73 | self.append_config('IMAGE_INSTALL_append = " man "') |
| 74 | bitbake('-c cleanall man') | 74 | bitbake('-c cleanall man-db') |
| 75 | bitbake('core-image-minimal') | 75 | bitbake('core-image-minimal') |
| 76 | result = runCmd('oe-pkgdata-util find-path /usr/bin/man') | 76 | result = runCmd('oe-pkgdata-util find-path /usr/bin/man') |
| 77 | self.assertEqual(result.output, 'man: /usr/bin/man') | 77 | self.assertEqual(result.output, 'man-db: /usr/bin/man') |
| 78 | path1 = os.path.realpath(image_path) | 78 | path1 = os.path.realpath(image_path) |
| 79 | size1 = os.path.getsize(path1) | 79 | size1 = os.path.getsize(path1) |
| 80 | logger.info('First image %s has size %i' % (path1, size1)) | 80 | logger.info('First image %s has size %i' % (path1, size1)) |
| 81 | 81 | ||
| 82 | logger.info('Running bitbake without man in the image package list') | 82 | logger.info('Running bitbake without man in the image package list') |
| 83 | self.append_config('IMAGE_INSTALL_remove = " man "') | 83 | self.append_config('IMAGE_INSTALL_remove = " man "') |
| 84 | bitbake('-c cleanall man') | 84 | bitbake('-c cleanall man-db') |
| 85 | bitbake('core-image-minimal') | 85 | bitbake('core-image-minimal') |
| 86 | result = runCmd('oe-pkgdata-util find-path /usr/bin/man', ignore_status=True) | 86 | result = runCmd('oe-pkgdata-util find-path /usr/bin/man', ignore_status=True) |
| 87 | self.assertEqual(result.status, 1, "Status different than 1. output: %s" % result.output) | 87 | self.assertEqual(result.status, 1, "Status different than 1. output: %s" % result.output) |
| @@ -439,8 +439,7 @@ class HsmTests(OESelftestTestCase): | |||
| 439 | # Strip off line ending. | 439 | # Strip off line ending. |
| 440 | value = stdout.decode()[:-1] | 440 | value = stdout.decode()[:-1] |
| 441 | self.assertEqual(value, machine, | 441 | self.assertEqual(value, machine, |
| 442 | 'MACHINE does not match hostname: ' + machine + ', ' + value + | 442 | 'MACHINE does not match hostname: ' + machine + ', ' + value) |
| 443 | '\nIs tianocore ovmf installed?') | ||
| 444 | print(value) | 443 | print(value) |
| 445 | print('Checking output of aktualizr-info:') | 444 | print('Checking output of aktualizr-info:') |
| 446 | ran_ok = False | 445 | ran_ok = False |
diff --git a/recipes-bsp/grub/grub-efi_%.bbappend b/recipes-bsp/grub/grub-efi_%.bbappend deleted file mode 100644 index bebb006..0000000 --- a/recipes-bsp/grub/grub-efi_%.bbappend +++ /dev/null | |||
| @@ -1,2 +0,0 @@ | |||
| 1 | |||
| 2 | GRUB_BUILDIN_append_sota = " configfile" | ||
diff --git a/recipes-sota/aktualizr/aktualizr-auto-prov.bb b/recipes-sota/aktualizr/aktualizr-auto-prov.bb index 8deee7e..7f4f2e4 100644 --- a/recipes-sota/aktualizr/aktualizr-auto-prov.bb +++ b/recipes-sota/aktualizr/aktualizr-auto-prov.bb | |||
| @@ -1,5 +1,5 @@ | |||
| 1 | SUMMARY = "Aktualizr configuration for autoprovisioning" | 1 | SUMMARY = "Aktualizr configuration for autoprovisioning" |
| 2 | DESCRIPTION = "Systemd service and configurations for autoprovisioning Aktualizr, the SOTA Client application written in C++" | 2 | DESCRIPTION = "Configuration for automatically provisioning Aktualizr, the SOTA Client application written in C++" |
| 3 | HOMEPAGE = "https://github.com/advancedtelematic/aktualizr" | 3 | HOMEPAGE = "https://github.com/advancedtelematic/aktualizr" |
| 4 | SECTION = "base" | 4 | SECTION = "base" |
| 5 | LICENSE = "MPL-2.0" | 5 | LICENSE = "MPL-2.0" |
| @@ -35,7 +35,8 @@ do_install() { | |||
| 35 | if [ -n "${SOTA_PACKED_CREDENTIALS}" ]; then | 35 | if [ -n "${SOTA_PACKED_CREDENTIALS}" ]; then |
| 36 | aktualizr_toml=${@bb.utils.contains('SOTA_CLIENT_FEATURES', 'secondary-network', 'sota_autoprov_primary.toml', 'sota_autoprov.toml', d)} | 36 | aktualizr_toml=${@bb.utils.contains('SOTA_CLIENT_FEATURES', 'secondary-network', 'sota_autoprov_primary.toml', 'sota_autoprov.toml', d)} |
| 37 | 37 | ||
| 38 | install -m 0644 ${STAGING_DIR_NATIVE}${libdir}/sota/${aktualizr_toml} ${D}${libdir}/sota/conf.d/20-sota.toml | 38 | install -m 0644 ${STAGING_DIR_NATIVE}${libdir}/sota/${aktualizr_toml} \ |
| 39 | ${D}${libdir}/sota/conf.d/20-${aktualizr_toml}.toml | ||
| 39 | 40 | ||
| 40 | # deploy SOTA credentials | 41 | # deploy SOTA credentials |
| 41 | if [ -e ${SOTA_PACKED_CREDENTIALS} ]; then | 42 | if [ -e ${SOTA_PACKED_CREDENTIALS} ]; then |
| @@ -48,7 +49,7 @@ do_install() { | |||
| 48 | 49 | ||
| 49 | FILES_${PN} = " \ | 50 | FILES_${PN} = " \ |
| 50 | ${libdir}/sota/conf.d \ | 51 | ${libdir}/sota/conf.d \ |
| 51 | ${libdir}/sota/conf.d/20-sota.toml \ | 52 | ${libdir}/sota/conf.d/20-${aktualizr_toml}.toml \ |
| 52 | ${localstatedir}/sota \ | 53 | ${localstatedir}/sota \ |
| 53 | ${localstatedir}/sota/sota_provisioning_credentials.zip \ | 54 | ${localstatedir}/sota/sota_provisioning_credentials.zip \ |
| 54 | " | 55 | " |
diff --git a/recipes-sota/aktualizr/aktualizr-ca-implicit-prov.bb b/recipes-sota/aktualizr/aktualizr-ca-implicit-prov.bb index 319074e..4d5ff79 100644 --- a/recipes-sota/aktualizr/aktualizr-ca-implicit-prov.bb +++ b/recipes-sota/aktualizr/aktualizr-ca-implicit-prov.bb | |||
| @@ -1,5 +1,5 @@ | |||
| 1 | SUMMARY = "Aktualizr configuration for implicit provisioning with CA" | 1 | SUMMARY = "Aktualizr configuration for implicit provisioning with CA" |
| 2 | DESCRIPTION = "Systemd service and configurations for implicitly provisioning Aktualizr using externally provided or generated CA" | 2 | DESCRIPTION = "Configuration for implicitly provisioning Aktualizr using externally provided or generated CA" |
| 3 | 3 | ||
| 4 | # WARNING: it is NOT a production solution. The secure way to provision devices is to create certificate request directly on the device | 4 | # WARNING: it is NOT a production solution. The secure way to provision devices is to create certificate request directly on the device |
| 5 | # (either with HSM/TPM or with software) and then sign it with a CA stored on a disconnected machine | 5 | # (either with HSM/TPM or with software) and then sign it with a CA stored on a disconnected machine |
| @@ -36,7 +36,7 @@ do_install() { | |||
| 36 | SOTA_CACERT_PATH=${DEPLOY_DIR_IMAGE}/CA/cacert.pem | 36 | SOTA_CACERT_PATH=${DEPLOY_DIR_IMAGE}/CA/cacert.pem |
| 37 | SOTA_CAKEY_PATH=${DEPLOY_DIR_IMAGE}/CA/ca.private.pem | 37 | SOTA_CAKEY_PATH=${DEPLOY_DIR_IMAGE}/CA/ca.private.pem |
| 38 | mkdir -p ${DEPLOY_DIR_IMAGE}/CA | 38 | mkdir -p ${DEPLOY_DIR_IMAGE}/CA |
| 39 | bbwarn "SOTA_CACERT_PATH is not specified, use default one at $SOTA_CACERT_PATH" | 39 | bbwarn "SOTA_CACERT_PATH is not specified, use default one at $SOTA_CACERT_PATH" |
| 40 | 40 | ||
| 41 | if [ ! -f ${SOTA_CACERT_PATH} ]; then | 41 | if [ ! -f ${SOTA_CACERT_PATH} ]; then |
| 42 | bbwarn "${SOTA_CACERT_PATH} does not exist, generate a new CA" | 42 | bbwarn "${SOTA_CACERT_PATH} does not exist, generate a new CA" |
| @@ -52,19 +52,20 @@ do_install() { | |||
| 52 | fi | 52 | fi |
| 53 | 53 | ||
| 54 | install -m 0700 -d ${D}${localstatedir}/sota | 54 | install -m 0700 -d ${D}${localstatedir}/sota |
| 55 | install -m 0644 ${STAGING_DIR_NATIVE}${libdir}/sota/sota_implicit_prov_ca.toml ${D}${libdir}/sota/conf.d/20-sota.toml | 55 | install -m 0644 ${STAGING_DIR_NATIVE}${libdir}/sota/sota_implicit_prov_ca.toml \ |
| 56 | ${D}${libdir}/sota/conf.d/20-sota_implicit_prov_ca.toml | ||
| 56 | aktualizr_cert_provider --credentials ${SOTA_PACKED_CREDENTIALS} \ | 57 | aktualizr_cert_provider --credentials ${SOTA_PACKED_CREDENTIALS} \ |
| 57 | --device-ca ${SOTA_CACERT_PATH} \ | 58 | --device-ca ${SOTA_CACERT_PATH} \ |
| 58 | --device-ca-key ${SOTA_CAKEY_PATH} \ | 59 | --device-ca-key ${SOTA_CAKEY_PATH} \ |
| 59 | --root-ca \ | 60 | --root-ca \ |
| 60 | --server-url \ | 61 | --server-url \ |
| 61 | --local ${D}${localstatedir}/sota \ | 62 | --local ${D}${localstatedir}/sota \ |
| 62 | --config ${D}${libdir}/sota/conf.d/20-sota.toml | 63 | --config ${STAGING_DIR_NATIVE}${libdir}/sota/sota_implicit_prov_ca.toml |
| 63 | } | 64 | } |
| 64 | 65 | ||
| 65 | FILES_${PN} = " \ | 66 | FILES_${PN} = " \ |
| 66 | ${libdir}/sota/conf.d \ | 67 | ${libdir}/sota/conf.d \ |
| 67 | ${libdir}/sota/conf.d/20-sota.toml \ | 68 | ${libdir}/sota/conf.d/20-sota_implicit_prov_ca.toml \ |
| 68 | ${libdir}/sota/root.crt \ | 69 | ${libdir}/sota/root.crt \ |
| 69 | ${localstatedir}/sota/* \ | 70 | ${localstatedir}/sota/* \ |
| 70 | " | 71 | " |
diff --git a/recipes-sota/aktualizr/aktualizr-hsm-prov.bb b/recipes-sota/aktualizr/aktualizr-hsm-prov.bb index 504f0d8..d526cd2 100644 --- a/recipes-sota/aktualizr/aktualizr-hsm-prov.bb +++ b/recipes-sota/aktualizr/aktualizr-hsm-prov.bb | |||
| @@ -1,12 +1,12 @@ | |||
| 1 | SUMMARY = "Aktualizr configuration with HSM support" | 1 | SUMMARY = "Aktualizr configuration with HSM support" |
| 2 | DESCRIPTION = "Systemd service and configurations for HSM provisioning with Aktualizr, the SOTA Client application written in C++" | 2 | DESCRIPTION = "Configuration for HSM provisioning with Aktualizr, the SOTA Client application written in C++" |
| 3 | HOMEPAGE = "https://github.com/advancedtelematic/aktualizr" | 3 | HOMEPAGE = "https://github.com/advancedtelematic/aktualizr" |
| 4 | SECTION = "base" | 4 | SECTION = "base" |
| 5 | LICENSE = "MPL-2.0" | 5 | LICENSE = "MPL-2.0" |
| 6 | LIC_FILES_CHKSUM = "file://${WORKDIR}/LICENSE;md5=9741c346eef56131163e13b9db1241b3" | 6 | LIC_FILES_CHKSUM = "file://${WORKDIR}/LICENSE;md5=9741c346eef56131163e13b9db1241b3" |
| 7 | 7 | ||
| 8 | DEPENDS = "aktualizr-native" | 8 | DEPENDS = "aktualizr-native" |
| 9 | RDEPENDS_${PN} = "aktualizr softhsm softhsm-testtoken" | 9 | RDEPENDS_${PN} = "aktualizr" |
| 10 | 10 | ||
| 11 | SRC_URI = " \ | 11 | SRC_URI = " \ |
| 12 | file://LICENSE \ | 12 | file://LICENSE \ |
| @@ -19,15 +19,19 @@ require credentials.inc | |||
| 19 | 19 | ||
| 20 | do_install() { | 20 | do_install() { |
| 21 | install -m 0700 -d ${D}${libdir}/sota/conf.d | 21 | install -m 0700 -d ${D}${libdir}/sota/conf.d |
| 22 | install -m 0644 ${STAGING_DIR_NATIVE}${libdir}/sota/sota_hsm_prov.toml \ | ||
| 23 | ${D}${libdir}/sota/conf.d/20-sota_hsm_prov.toml | ||
| 22 | if [ -n "${SOTA_PACKED_CREDENTIALS}" ]; then | 24 | if [ -n "${SOTA_PACKED_CREDENTIALS}" ]; then |
| 23 | aktualizr_implicit_writer -c ${SOTA_PACKED_CREDENTIALS} --no-root-ca \ | 25 | aktualizr_implicit_writer -c ${SOTA_PACKED_CREDENTIALS} --no-root-ca \ |
| 24 | -i ${STAGING_DIR_NATIVE}${libdir}/sota/sota_hsm_prov.toml -o ${D}${libdir}/sota/conf.d/20-sota.toml -p ${D} | 26 | -i ${STAGING_DIR_NATIVE}${libdir}/sota/sota_hsm_prov.toml \ |
| 27 | -o ${D}${libdir}/sota/conf.d/30-implicit_server.toml -p ${D} | ||
| 25 | fi | 28 | fi |
| 26 | } | 29 | } |
| 27 | 30 | ||
| 28 | FILES_${PN} = " \ | 31 | FILES_${PN} = " \ |
| 29 | ${libdir}/sota/conf.d \ | 32 | ${libdir}/sota/conf.d \ |
| 30 | ${libdir}/sota/conf.d/20-sota.toml \ | 33 | ${libdir}/sota/conf.d/20-sota_hsm_prov.toml \ |
| 34 | ${libdir}/sota/conf.d/30-implicit_server.toml \ | ||
| 31 | " | 35 | " |
| 32 | 36 | ||
| 33 | # vim:set ts=4 sw=4 sts=4 expandtab: | 37 | # vim:set ts=4 sw=4 sts=4 expandtab: |
diff --git a/recipes-sota/aktualizr/aktualizr-implicit-prov.bb b/recipes-sota/aktualizr/aktualizr-implicit-prov.bb index dcfaffb..e08eeef 100644 --- a/recipes-sota/aktualizr/aktualizr-implicit-prov.bb +++ b/recipes-sota/aktualizr/aktualizr-implicit-prov.bb | |||
| @@ -1,5 +1,5 @@ | |||
| 1 | SUMMARY = "Aktualizr configuration for implicit provisioning" | 1 | SUMMARY = "Aktualizr configuration for implicit provisioning" |
| 2 | DESCRIPTION = "Systemd service and configurations for implicitly provisioning Aktualizr, the SOTA Client application written in C++" | 2 | DESCRIPTION = "Configuration for implicitly provisioning Aktualizr, the SOTA Client application written in C++" |
| 3 | HOMEPAGE = "https://github.com/advancedtelematic/aktualizr" | 3 | HOMEPAGE = "https://github.com/advancedtelematic/aktualizr" |
| 4 | SECTION = "base" | 4 | SECTION = "base" |
| 5 | LICENSE = "MPL-2.0" | 5 | LICENSE = "MPL-2.0" |
| @@ -19,15 +19,19 @@ require credentials.inc | |||
| 19 | 19 | ||
| 20 | do_install() { | 20 | do_install() { |
| 21 | install -m 0700 -d ${D}${libdir}/sota/conf.d | 21 | install -m 0700 -d ${D}${libdir}/sota/conf.d |
| 22 | install -m 0644 ${STAGING_DIR_NATIVE}${libdir}/sota/sota_implicit_prov.toml \ | ||
| 23 | ${D}${libdir}/sota/conf.d/20-sota_implicit_prov.toml | ||
| 22 | if [ -n "${SOTA_PACKED_CREDENTIALS}" ]; then | 24 | if [ -n "${SOTA_PACKED_CREDENTIALS}" ]; then |
| 23 | aktualizr_implicit_writer -c ${SOTA_PACKED_CREDENTIALS} \ | 25 | aktualizr_implicit_writer -c ${SOTA_PACKED_CREDENTIALS} \ |
| 24 | -i ${STAGING_DIR_NATIVE}${libdir}/sota/sota_implicit_prov.toml -o ${D}${libdir}/sota/conf.d/20-sota.toml -p ${D} | 26 | -i ${STAGING_DIR_NATIVE}${libdir}/sota/sota_implicit_prov.toml \ |
| 27 | -o ${D}${libdir}/sota/conf.d/30-implicit_server.toml -p ${D} | ||
| 25 | fi | 28 | fi |
| 26 | } | 29 | } |
| 27 | 30 | ||
| 28 | FILES_${PN} = " \ | 31 | FILES_${PN} = " \ |
| 29 | ${libdir}/sota/conf.d \ | 32 | ${libdir}/sota/conf.d \ |
| 30 | ${libdir}/sota/conf.d/20-sota.toml \ | 33 | ${libdir}/sota/conf.d/20-implicit_prov.toml \ |
| 34 | ${libdir}/sota/conf.d/30-implicit_server.toml \ | ||
| 31 | ${libdir}/sota/root.crt \ | 35 | ${libdir}/sota/root.crt \ |
| 32 | " | 36 | " |
| 33 | 37 | ||
diff --git a/recipes-sota/aktualizr/aktualizr_git.bb b/recipes-sota/aktualizr/aktualizr_git.bb index f55eca8..8dc4b31 100755 --- a/recipes-sota/aktualizr/aktualizr_git.bb +++ b/recipes-sota/aktualizr/aktualizr_git.bb | |||
| @@ -10,7 +10,8 @@ DEPENDS_append_class-target = "ostree ${@bb.utils.contains('SOTA_CLIENT_FEATURES | |||
| 10 | DEPENDS_append_class-native = "glib-2.0-native " | 10 | DEPENDS_append_class-native = "glib-2.0-native " |
| 11 | 11 | ||
| 12 | RDEPENDS_${PN}_class-target = "lshw " | 12 | RDEPENDS_${PN}_class-target = "lshw " |
| 13 | RDEPENDS_${PN}_append_class-target = " ${@bb.utils.contains('SOTA_CLIENT_FEATURES', 'serialcan', ' slcand-start', '', d)} " | 13 | RDEPENDS_${PN}_append_class-target = "${@bb.utils.contains('SOTA_CLIENT_FEATURES', 'serialcan', ' slcand-start', '', d)} " |
| 14 | RDEPENDS_${PN}_append_class-target = "${@bb.utils.contains('SOTA_CLIENT_FEATURES', 'hsm', ' softhsm softhsm-testtoken', '', d)}" | ||
| 14 | 15 | ||
| 15 | PV = "1.0+git${SRCPV}" | 16 | PV = "1.0+git${SRCPV}" |
| 16 | PR = "7" | 17 | PR = "7" |
| @@ -22,7 +23,7 @@ SRC_URI = " \ | |||
| 22 | file://aktualizr-secondary.socket \ | 23 | file://aktualizr-secondary.socket \ |
| 23 | file://aktualizr-serialcan.service \ | 24 | file://aktualizr-serialcan.service \ |
| 24 | " | 25 | " |
| 25 | SRCREV = "3b89858cf8ce9a8331cc4e6a5d2b5783d2eb7ae9" | 26 | SRCREV = "114dc6c519ca9a605d73ad292821348607d0fa12" |
| 26 | BRANCH ?= "master" | 27 | BRANCH ?= "master" |
| 27 | 28 | ||
| 28 | S = "${WORKDIR}/git" | 29 | S = "${WORKDIR}/git" |
diff --git a/recipes-support/ca-certificates/ca-certificates_%.bbappend b/recipes-support/ca-certificates/ca-certificates_%.bbappend deleted file mode 100644 index cc95a68..0000000 --- a/recipes-support/ca-certificates/ca-certificates_%.bbappend +++ /dev/null | |||
| @@ -1 +0,0 @@ | |||
| 1 | SYSROOT_DIRS += "${sysconfdir}" | ||
diff --git a/scripts/find_packages.py b/scripts/find_packages.py new file mode 100755 index 0000000..7a60a17 --- /dev/null +++ b/scripts/find_packages.py | |||
| @@ -0,0 +1,125 @@ | |||
| 1 | #!/usr/bin/env python3 | ||
| 2 | |||
| 3 | import os.path | ||
| 4 | import sys | ||
| 5 | |||
| 6 | scripts_path = os.path.dirname(os.path.realpath(__file__)) | ||
| 7 | bb_lib_path = os.path.abspath(scripts_path + '/../../poky/bitbake/lib') | ||
| 8 | sys.path = sys.path + [bb_lib_path] | ||
| 9 | |||
| 10 | import bb.fetch2 | ||
| 11 | import bb.tinfoil | ||
| 12 | |||
| 13 | |||
| 14 | def print_deps(tinfoil, abcd_file, rn): | ||
| 15 | try: | ||
| 16 | info = tinfoil.get_recipe_info(rn) | ||
| 17 | except Exception: | ||
| 18 | print('Failed to get recipe info for: %s' % rn) | ||
| 19 | return [] | ||
| 20 | if not info: | ||
| 21 | print('No recipe info found for: %s' % rn) | ||
| 22 | return [] | ||
| 23 | append_files = tinfoil.get_file_appends(info.fn) | ||
| 24 | appends = True | ||
| 25 | data = tinfoil.parse_recipe_file(info.fn, appends, append_files) | ||
| 26 | src_uri = data.getVar('SRC_URI').split() | ||
| 27 | lic = data.getVar('LICENSE') | ||
| 28 | summary = data.getVar('SUMMARY') | ||
| 29 | description = data.getVar('DESCRIPTION') | ||
| 30 | homepage = data.getVar('HOMEPAGE') | ||
| 31 | srcrev = data.getVar('SRCREV') | ||
| 32 | branch = data.getVar('BRANCH') | ||
| 33 | depends = data.getVar('DEPENDS').split() | ||
| 34 | |||
| 35 | abcd_file.write('- id:\n') | ||
| 36 | abcd_file.write(' package_manager: "Yocto"\n') | ||
| 37 | abcd_file.write(' name: "%s"\n' % info.pn) | ||
| 38 | abcd_file.write(' version: "%s"\n' % info.pv) | ||
| 39 | abcd_file.write(' declared_lics:\n') | ||
| 40 | abcd_file.write(' - "%s"\n' % lic) | ||
| 41 | if summary: | ||
| 42 | abcd_file.write(' description: "%s"\n' % summary) | ||
| 43 | else: | ||
| 44 | abcd_file.write(' description: "%s"\n' % description) | ||
| 45 | abcd_file.write(' homepage_url: "%s"\n' % homepage) | ||
| 46 | abcd_file.write(' source_artifact:\n') | ||
| 47 | repos = [] | ||
| 48 | for src in src_uri: | ||
| 49 | # Strip options. | ||
| 50 | # TODO: ignore files with apply=false? | ||
| 51 | src = src.split(';', maxsplit=1)[0] | ||
| 52 | src_type = src.split('://', maxsplit=1)[0] | ||
| 53 | if src_type == 'file': | ||
| 54 | # TODO: Get full path of patches and other files within the source | ||
| 55 | # repo, not just the filesystem? | ||
| 56 | fetch = bb.fetch2.Fetch([], data) | ||
| 57 | local = fetch.localpath(src) | ||
| 58 | abcd_file.write(' - "%s"\n' % local) | ||
| 59 | else: | ||
| 60 | abcd_file.write(' - "%s"\n' % src) | ||
| 61 | if src_type != 'http' and src_type != 'https' and src_type != 'ftp' and src_type != 'ssh': | ||
| 62 | repos.append(src) | ||
| 63 | if len(repos) > 1: | ||
| 64 | print('Multiple repos not fully supported yet. Pacakge: %s' % info.pn) | ||
| 65 | for repo in repos: | ||
| 66 | vcs_type, url = repo.split('://', maxsplit=1) | ||
| 67 | abcd_file.write(' vcs:\n') | ||
| 68 | if vcs_type == 'gitsm': | ||
| 69 | vcs_type = 'git' | ||
| 70 | abcd_file.write(' type: "%s"\n' % vcs_type) | ||
| 71 | abcd_file.write(' url: "%s"\n' % url) | ||
| 72 | # TODO: Actually support multiple repos here: | ||
| 73 | abcd_file.write(' revision: "%s"\n' % srcrev) | ||
| 74 | abcd_file.write(' branch: "%s"\n' % branch) | ||
| 75 | |||
| 76 | abcd_file.write(' dependencies:\n') | ||
| 77 | for dep in depends: | ||
| 78 | abcd_file.write(' - "%s"\n' % dep) | ||
| 79 | # TODO: search for transitive dependencies here? Each dependency will | ||
| 80 | # get checked for its own dependencies sooner or later. | ||
| 81 | |||
| 82 | return depends | ||
| 83 | |||
| 84 | |||
| 85 | def main(): | ||
| 86 | abcd_manifest = 'manifest.abcd' | ||
| 87 | with open(abcd_manifest, "w") as abcd_file, bb.tinfoil.Tinfoil() as tinfoil: | ||
| 88 | tinfoil.prepare() | ||
| 89 | # These are the packages that bitbake assumes are provided by the host | ||
| 90 | # system. They do not have recipes, so searching tinfoil for them will | ||
| 91 | # not work. Anyway, by nature they are not included in code we release, | ||
| 92 | # only used by it. | ||
| 93 | assume_provided = tinfoil.config_data.getVar('ASSUME_PROVIDED').split() | ||
| 94 | abcd_file.write('packages:\n') | ||
| 95 | |||
| 96 | # Does NOT include garage-sign, anything used only for testing (i.e. | ||
| 97 | # strace and gtest), any of the git submodules, all of which are also | ||
| 98 | # only used for testing (tuf-test-vectors, isotp-c, ostreesysroot, | ||
| 99 | # and HdrHistogram_c), or any other third party modules included | ||
| 100 | # directly into the source tree (jsoncpp, open62541, picojson) | ||
| 101 | recipes_to_check = ['aktualizr', | ||
| 102 | 'aktualizr-native', | ||
| 103 | 'aktualizr-auto-prov', | ||
| 104 | 'aktualizr-implicit-prov', | ||
| 105 | 'aktualizr-ca-implicit-prov', | ||
| 106 | 'aktualizr-hsm-prov', | ||
| 107 | 'aktualizr-disable-send-ip', | ||
| 108 | 'aktualizr-example-interface', | ||
| 109 | 'aktualizr-log-debug', | ||
| 110 | 'libp11', # BUILD_P11 (HSM) only | ||
| 111 | 'dpkg', # BUILD_DEB only | ||
| 112 | 'systemd'] # BUILD_SYSTEMD only | ||
| 113 | |||
| 114 | # Iterate through the list of recipes to check. Append any dependencies | ||
| 115 | # found that aren't already in the list. As long as we only add to the | ||
| 116 | # list, it should be safe. | ||
| 117 | for recipe in recipes_to_check: | ||
| 118 | depends = print_deps(tinfoil, abcd_file, recipe) | ||
| 119 | for dep in depends: | ||
| 120 | if dep not in recipes_to_check and dep not in assume_provided: | ||
| 121 | recipes_to_check.append(dep) | ||
| 122 | |||
| 123 | |||
| 124 | if __name__ == "__main__": | ||
| 125 | main() | ||
