From 7511a219525ff195c4412db77b9638cff41c3264 Mon Sep 17 00:00:00 2001 From: Alexandre Bard Date: Tue, 13 Nov 2018 12:04:45 +0100 Subject: Fix function name conflict buildinfo function name is used in poky: meta/classes/image-buildinfo.bbclass Both classes could not be used together Signed-off-by: Alexandre Bard --- classes/image_repo_manifest.bbclass | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/classes/image_repo_manifest.bbclass b/classes/image_repo_manifest.bbclass index 467fd9a..c2e7056 100644 --- a/classes/image_repo_manifest.bbclass +++ b/classes/image_repo_manifest.bbclass @@ -12,7 +12,7 @@ HOSTTOOLS_NONFATAL += " repo " # Write build information to target filesystem -buildinfo () { +buildinfo_manifest () { if [ $(which repo) ]; then repo manifest --revision-as-HEAD -o ${IMAGE_ROOTFS}${sysconfdir}/manifest.xml || bbwarn "Android repo tool failed to run; manifest not copied" else @@ -20,4 +20,4 @@ buildinfo () { fi } -IMAGE_PREPROCESS_COMMAND += "buildinfo;" +IMAGE_PREPROCESS_COMMAND += "buildinfo_manifest;" -- cgit v1.2.3-54-g00ecf From c19a1529d950587ffbb0a95fcce3081694d0ab3b Mon Sep 17 00:00:00 2001 From: Patrick Vacek Date: Fri, 16 Nov 2018 11:01:50 +0100 Subject: aktualizr: Bump to latest and fix names. Signed-off-by: Patrick Vacek --- lib/oeqa/selftest/cases/updater.py | 12 ++++++------ recipes-sota/aktualizr/aktualizr-ca-implicit-prov-creds.bb | 6 +++--- recipes-sota/aktualizr/aktualizr_git.bb | 6 +++--- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/lib/oeqa/selftest/cases/updater.py b/lib/oeqa/selftest/cases/updater.py index 3c17b8a..228b8a6 100644 --- a/lib/oeqa/selftest/cases/updater.py +++ b/lib/oeqa/selftest/cases/updater.py @@ -103,7 +103,7 @@ class AktualizrToolsTests(OESelftestTestCase): bitbake('aktualizr-native') def test_cert_provider_help(self): - akt_native_run(self, 'aktualizr_cert_provider --help') + akt_native_run(self, 'aktualizr-cert-provider --help') def test_cert_provider_local_output(self): logger = logging.getLogger("selftest") @@ -115,7 +115,7 @@ class AktualizrToolsTests(OESelftestTestCase): bb_vars_prov = get_bb_vars(['STAGING_DIR_HOST', 'libdir'], 'aktualizr-ca-implicit-prov') config = bb_vars_prov['STAGING_DIR_HOST'] + bb_vars_prov['libdir'] + '/sota/sota_implicit_prov_ca.toml' - akt_native_run(self, 'aktualizr_cert_provider -c {creds} -r -l {temp} -g {config}' + akt_native_run(self, 'aktualizr-cert-provider -c {creds} -r -l {temp} -g {config}' .format(creds=creds, temp=temp_dir, config=config)) # Might be nice if these names weren't hardcoded. @@ -424,14 +424,14 @@ class ImplProvTests(OESelftestTestCase): self.assertIn(b'Fetched metadata: no', stdout, 'Device already provisioned!? ' + stderr.decode() + stdout.decode()) - # Run cert_provider. + # Run aktualizr-cert-provider. bb_vars = get_bb_vars(['SOTA_PACKED_CREDENTIALS'], 'aktualizr-native') creds = bb_vars['SOTA_PACKED_CREDENTIALS'] bb_vars_prov = get_bb_vars(['STAGING_DIR_HOST', 'libdir'], 'aktualizr-ca-implicit-prov') config = bb_vars_prov['STAGING_DIR_HOST'] + bb_vars_prov['libdir'] + '/sota/sota_implicit_prov_ca.toml' print('Provisining at root@localhost:%d' % self.qemu.ssh_port) - akt_native_run(self, 'aktualizr_cert_provider -c {creds} -t root@localhost -p {port} -s -u -r -g {config}' + akt_native_run(self, 'aktualizr-cert-provider -c {creds} -t root@localhost -p {port} -s -u -r -g {config}' .format(creds=creds, port=self.qemu.ssh_port, config=config)) verifyProvisioned(self, machine) @@ -509,13 +509,13 @@ class HsmTests(OESelftestTestCase): self.assertNotEqual(retcode, 0, 'softhsm2-tool succeeded before initialization: ' + stdout.decode() + stderr.decode()) - # Run cert_provider. + # Run aktualizr-cert-provider. bb_vars = get_bb_vars(['SOTA_PACKED_CREDENTIALS'], 'aktualizr-native') creds = bb_vars['SOTA_PACKED_CREDENTIALS'] bb_vars_prov = get_bb_vars(['STAGING_DIR_NATIVE', 'libdir'], 'aktualizr-hsm-prov') config = bb_vars_prov['STAGING_DIR_NATIVE'] + bb_vars_prov['libdir'] + '/sota/sota_hsm_prov.toml' - akt_native_run(self, 'aktualizr_cert_provider -c {creds} -t root@localhost -p {port} -r -s -u -g {config}' + akt_native_run(self, 'aktualizr-cert-provider -c {creds} -t root@localhost -p {port} -r -s -u -g {config}' .format(creds=creds, port=self.qemu.ssh_port, config=config)) # Verify that HSM is able to initialize. diff --git a/recipes-sota/aktualizr/aktualizr-ca-implicit-prov-creds.bb b/recipes-sota/aktualizr/aktualizr-ca-implicit-prov-creds.bb index a729e6b..41af7c0 100644 --- a/recipes-sota/aktualizr/aktualizr-ca-implicit-prov-creds.bb +++ b/recipes-sota/aktualizr/aktualizr-ca-implicit-prov-creds.bb @@ -37,9 +37,9 @@ do_install() { fi install -m 0700 -d ${D}${localstatedir}/sota - aktualizr_cert_provider --credentials ${SOTA_PACKED_CREDENTIALS} \ - --device-ca ${SOTA_CACERT_PATH} \ - --device-ca-key ${SOTA_CAKEY_PATH} \ + aktualizr-cert-provider --credentials ${SOTA_PACKED_CREDENTIALS} \ + --fleet-ca ${SOTA_CACERT_PATH} \ + --fleet-ca-key ${SOTA_CAKEY_PATH} \ --root-ca \ --server-url \ --local ${D} \ diff --git a/recipes-sota/aktualizr/aktualizr_git.bb b/recipes-sota/aktualizr/aktualizr_git.bb index 9cc7c7a..f3b61f8 100755 --- a/recipes-sota/aktualizr/aktualizr_git.bb +++ b/recipes-sota/aktualizr/aktualizr_git.bb @@ -27,7 +27,7 @@ SRC_URI = " \ file://aktualizr-serialcan.service \ " -SRCREV = "4621a15779db38531fb386478232a9e8593e53f4" +SRCREV = "348822d914f422a8d7b34a1e98cfdd1fa3cf816c" BRANCH ?= "master" S = "${WORKDIR}/git" @@ -107,12 +107,12 @@ FILES_${PN} = " \ " FILES_${PN}-examples = " \ - ${bindir}/hmi_stub \ + ${bindir}/hmi-stub \ " FILES_${PN}-host-tools = " \ ${bindir}/aktualizr-repo \ - ${bindir}/aktualizr_cert_provider \ + ${bindir}/aktualizr-cert-provider \ ${bindir}/garage-deploy \ ${bindir}/garage-push \ ${libdir}/sota/sota_autoprov.toml \ -- cgit v1.2.3-54-g00ecf From 2832fa74813a3294711a4f832d43b5dc86ca5098 Mon Sep 17 00:00:00 2001 From: Patrick Vacek Date: Fri, 16 Nov 2018 17:35:39 +0100 Subject: docs: better explanation of oe-selftest requirements. Also remove all references to aktualizr-example-interface. It has been removed. Signed-off-by: Patrick Vacek --- CONTRIBUTING.adoc | 2 +- README.adoc | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/CONTRIBUTING.adoc b/CONTRIBUTING.adoc index f12b95d..4d9e8f6 100644 --- a/CONTRIBUTING.adoc +++ b/CONTRIBUTING.adoc @@ -17,7 +17,7 @@ If you are developing with meta-updater, it may be helpful to read the README an * OTA-enabled build succeeds for at least one platform, the resulting image boots, and an update can be installed. This check is absolutely necessary for every pull request unless it only touches documentation. * If your change touches platform code (like `classes/sota_.bbclass`), please check building and updating on this particular platform. -* oe-selftest succeeds. To test meta-updater, run `oe-selftest -r updater` from a build directory with `MACHINE` set to `qemux86-64`. +* oe-selftest succeeds. To test meta-updater, run `oe-selftest -r updater` from a build directory with `MACHINE` set to `qemux86-64`. See the link:README.adoc#qa-with-oe-selftest[relevant section of the README] for more details. * Updates are forwards- and backwards-compatible. You should be able to update an OTA-enabled build before the change is applied to the version with change applied and vice versa. One should pay double attention to the compatibility when bootloader code is affected. * The patch/branch should be based on the latest version of the target branch. This may mean that rebasing is necessary if other PRs are merged before yours is approved. diff --git a/README.adoc b/README.adoc index 2f74c1d..759259f 100644 --- a/README.adoc +++ b/README.adoc @@ -143,7 +143,6 @@ First, you can set `SOTA_CLIENT_PROV` to control which provisioning recipe is us Second, you can write recipes to install additional config files with customized options. A few recipes already exist to address common needs and provide an example: -* link:recipes-sota/config/aktualizr-example-interface.bb[aktualizr-example-interface.bb] will configure aktualizr to connect to an example interface for a legacy flasher. This is intended to be used in conjunction with the `aktualizr-examples` package. See https://github.com/advancedtelematic/aktualizr/blob/master/docs/legacysecondary.adoc[legacysecondary.adoc] in the aktualizr repo for more information. * link:recipes-sota/config/aktualizr-disable-send-ip.bb[aktualizr-disable-send-ip.bb] disables the reporting of networking information to the server. This is enabled by default and supported by https://connect.ota.here.com/[HERE OTA Connect]. However, if you are using a different server that does not support this feature, you may want to disable it in aktualizr. * link:recipes-sota/config/aktualizr-log-debug.bb[aktualizr-log-debug.bb] sets the log level of aktualizr to 0 (trace). The default is 2 (info). This recipe is intended for development and debugging purposes. @@ -178,7 +177,7 @@ Please note that [target name, target version] pairs are expected to be unique i == QA with oe-selftest -This layer relies on the test framework oe-selftest for quality assurance. Follow the steps below to run the tests: +This layer relies on the test framework oe-selftest for quality assurance. Currently, you will need to run this in a build directory with `MACHINE` set to `qemux86-64`. Follow the steps below to run the tests: 1. Append the line below to `conf/local.conf` to disable the warning about supported operating systems: + -- cgit v1.2.3-54-g00ecf From 80cf88a5ce9668041c020612630981e02d880bfc Mon Sep 17 00:00:00 2001 From: Serhiy Stetskovych Date: Wed, 21 Nov 2018 11:47:31 +0200 Subject: Allow setup custom hardware_id Signed-off-by: Serhiy Stetskovych --- README.adoc | 1 + classes/image_types_ostree.bbclass | 2 +- classes/sota.bbclass | 3 ++- recipes-sota/aktualizr/aktualizr_git.bb | 4 ++++ 4 files changed, 8 insertions(+), 2 deletions(-) diff --git a/README.adoc b/README.adoc index 759259f..057a8a0 100644 --- a/README.adoc +++ b/README.adoc @@ -84,6 +84,7 @@ Although we have used U-Boot so far, other boot loaders can be configured work w * `SOTA_CLIENT_PROV` - which provisioning method to use. Valid options are https://github.com/advancedtelematic/aktualizr/blob/master/docs/automatic-provisioning.adoc[`aktualizr-auto-prov`], https://github.com/advancedtelematic/aktualizr/blob/master/docs/implicit-provisioning.adoc[`aktualizr-ca-implicit-prov`], and https://github.com/advancedtelematic/aktualizr/blob/master/docs/hsm-provisioning.adoc[`aktualizr-hsm-prov`]. The default is `aktualizr-auto-prov`. This can also be set to an empty string to avoid using a provisioning recipe. * `SOTA_CLIENT_FEATURES` - extensions to aktualizr. The only valid options are `hsm` (to build with HSM support) and `secondary-network` (to set up a simulated 'in-vehicle' network with support for a primary node with a DHCP server and a secondary node with a DHCP client). * `SOTA_SECONDARY_CONFIG_DIR` - a directory containing JSON configuration files for virtual secondaries on the host. These will be installed into `/etc/sota/ecus` on the device and automatically provided to aktualizr. +* `SOTA_HARDWARE_ID` - a custom hardware id variable. If not set, - MACHINE variable is used. == Usage diff --git a/classes/image_types_ostree.bbclass b/classes/image_types_ostree.bbclass index e7ff2c4..22ae123 100644 --- a/classes/image_types_ostree.bbclass +++ b/classes/image_types_ostree.bbclass @@ -226,7 +226,7 @@ IMAGE_CMD_garagesign () { --length 0 \ --url "${GARAGE_TARGET_URL}" \ --sha256 ${ostree_target_hash} \ - --hardwareids ${MACHINE} + --hardwareids ${SOTA_HARDWARE_ID} garage-sign targets sign --repo tufrepo \ --home-dir ${GARAGE_SIGN_REPO} \ --key-name=targets diff --git a/classes/sota.bbclass b/classes/sota.bbclass index 657fbc2..246865b 100644 --- a/classes/sota.bbclass +++ b/classes/sota.bbclass @@ -10,6 +10,7 @@ HOSTTOOLS_NONFATAL += "java" SOTA_CLIENT ??= "aktualizr" SOTA_CLIENT_PROV ??= "aktualizr-auto-prov" SOTA_DEPLOY_CREDENTIALS ?= "1" +SOTA_HARDWARE_ID ??= "${MACHINE}" IMAGE_INSTALL_append_sota = " ostree os-release ${SOTA_CLIENT} ${SOTA_CLIENT_PROV}" IMAGE_CLASSES += " image_types_ostree image_types_ota" @@ -26,7 +27,7 @@ OSTREE_INITRAMFS_FSTYPES ??= "${@oe.utils.ifelse(d.getVar('OSTREE_BOOTLOADER', T # Please redefine OSTREE_REPO in order to have a persistent OSTree repo OSTREE_REPO ?= "${DEPLOY_DIR_IMAGE}/ostree_repo" -OSTREE_BRANCHNAME ?= "${MACHINE}" +OSTREE_BRANCHNAME ?= "${SOTA_HARDWARE_ID}" OSTREE_OSNAME ?= "poky" OSTREE_INITRAMFS_IMAGE ?= "initramfs-ostree-image" OSTREE_BOOTLOADER ??= 'u-boot' diff --git a/recipes-sota/aktualizr/aktualizr_git.bb b/recipes-sota/aktualizr/aktualizr_git.bb index f3b61f8..509b74b 100755 --- a/recipes-sota/aktualizr/aktualizr_git.bb +++ b/recipes-sota/aktualizr/aktualizr_git.bb @@ -71,6 +71,10 @@ do_install_append () { install -m 0700 -d ${D}${libdir}/sota/conf.d install -m 0700 -d ${D}${sysconfdir}/sota/conf.d + if [ -n "${SOTA_HARDWARE_ID}" ]; then + echo "[uptane]\nprimary_ecu_hardware_id = ${SOTA_HARDWARE_ID}\n" > ${D}${libdir}/sota/conf.d/40-hardware-id.toml + fi + if [ -n "${SOTA_SECONDARY_CONFIG_DIR}" ]; then if [ -d "${SOTA_SECONDARY_CONFIG_DIR}" ]; then install -m 0700 -d ${D}${sysconfdir}/sota/ecus -- cgit v1.2.3-54-g00ecf From 109c863a039cba8868abfdad5c5dda847c9fe221 Mon Sep 17 00:00:00 2001 From: Patrick Vacek Date: Thu, 22 Nov 2018 14:15:15 +0100 Subject: README: slightly more descriptive explanation of SOTA_HARDWARE_ID. Signed-off-by: Patrick Vacek --- README.adoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.adoc b/README.adoc index 057a8a0..32630d7 100644 --- a/README.adoc +++ b/README.adoc @@ -84,7 +84,7 @@ Although we have used U-Boot so far, other boot loaders can be configured work w * `SOTA_CLIENT_PROV` - which provisioning method to use. Valid options are https://github.com/advancedtelematic/aktualizr/blob/master/docs/automatic-provisioning.adoc[`aktualizr-auto-prov`], https://github.com/advancedtelematic/aktualizr/blob/master/docs/implicit-provisioning.adoc[`aktualizr-ca-implicit-prov`], and https://github.com/advancedtelematic/aktualizr/blob/master/docs/hsm-provisioning.adoc[`aktualizr-hsm-prov`]. The default is `aktualizr-auto-prov`. This can also be set to an empty string to avoid using a provisioning recipe. * `SOTA_CLIENT_FEATURES` - extensions to aktualizr. The only valid options are `hsm` (to build with HSM support) and `secondary-network` (to set up a simulated 'in-vehicle' network with support for a primary node with a DHCP server and a secondary node with a DHCP client). * `SOTA_SECONDARY_CONFIG_DIR` - a directory containing JSON configuration files for virtual secondaries on the host. These will be installed into `/etc/sota/ecus` on the device and automatically provided to aktualizr. -* `SOTA_HARDWARE_ID` - a custom hardware id variable. If not set, - MACHINE variable is used. +* `SOTA_HARDWARE_ID` - a custom hardware ID that will be written to the aktualizr config. Defaults to MACHINE if not set. == Usage -- cgit v1.2.3-54-g00ecf From 3886102c7fb46b36a116d777513a008ba7c220ae Mon Sep 17 00:00:00 2001 From: Patrick Vacek Date: Thu, 22 Nov 2018 14:29:50 +0100 Subject: aktualizr: fix hardware ID config section. Signed-off-by: Patrick Vacek --- recipes-sota/aktualizr/aktualizr_git.bb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recipes-sota/aktualizr/aktualizr_git.bb b/recipes-sota/aktualizr/aktualizr_git.bb index 509b74b..c818e16 100755 --- a/recipes-sota/aktualizr/aktualizr_git.bb +++ b/recipes-sota/aktualizr/aktualizr_git.bb @@ -72,7 +72,7 @@ do_install_append () { install -m 0700 -d ${D}${sysconfdir}/sota/conf.d if [ -n "${SOTA_HARDWARE_ID}" ]; then - echo "[uptane]\nprimary_ecu_hardware_id = ${SOTA_HARDWARE_ID}\n" > ${D}${libdir}/sota/conf.d/40-hardware-id.toml + echo "[provision]\nprimary_ecu_hardware_id = ${SOTA_HARDWARE_ID}\n" > ${D}${libdir}/sota/conf.d/40-hardware-id.toml fi if [ -n "${SOTA_SECONDARY_CONFIG_DIR}" ]; then -- cgit v1.2.3-54-g00ecf From 27cbc9b97050f06d1478f7a2179a4dfd22272f5b Mon Sep 17 00:00:00 2001 From: Patrick Vacek Date: Thu, 29 Nov 2018 11:01:55 +0100 Subject: aktualizr: Bump to latest (d00d1a04cc2366d1a5f143b84b9f507f8bd32c44). Some OSTree improvements, reboot detection, retry failed downloads. Signed-off-by: Patrick Vacek --- recipes-sota/aktualizr/aktualizr_git.bb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recipes-sota/aktualizr/aktualizr_git.bb b/recipes-sota/aktualizr/aktualizr_git.bb index c818e16..ced8388 100755 --- a/recipes-sota/aktualizr/aktualizr_git.bb +++ b/recipes-sota/aktualizr/aktualizr_git.bb @@ -27,7 +27,7 @@ SRC_URI = " \ file://aktualizr-serialcan.service \ " -SRCREV = "348822d914f422a8d7b34a1e98cfdd1fa3cf816c" +SRCREV = "d00d1a04cc2366d1a5f143b84b9f507f8bd32c44" BRANCH ?= "master" S = "${WORKDIR}/git" -- cgit v1.2.3-54-g00ecf