diff options
author | Patrick Vacek <patrickvacek@gmail.com> | 2018-11-22 14:31:16 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-11-22 14:31:16 +0100 |
commit | bc678ac4ca43e43b0a0597efe434b44b832080f6 (patch) | |
tree | 75a2f55f333910476a696073d1c021e0085ac25d | |
parent | 9b2d4eba69fb065e89a7127b389490a9a6d526f8 (diff) | |
parent | 4669df770116b0eb0c78e5fc7602e80137a858fe (diff) | |
download | meta-updater-bc678ac4ca43e43b0a0597efe434b44b832080f6.tar.gz |
Merge pull request #435 from advancedtelematic/feat/hardware_id
Allow setup custom hardware_id
-rw-r--r-- | README.adoc | 1 | ||||
-rw-r--r-- | classes/image_types_ostree.bbclass | 2 | ||||
-rw-r--r-- | classes/sota.bbclass | 3 | ||||
-rwxr-xr-x | recipes-sota/aktualizr/aktualizr_git.bb | 4 |
4 files changed, 8 insertions, 2 deletions
diff --git a/README.adoc b/README.adoc index bed0591..994ad67 100644 --- a/README.adoc +++ b/README.adoc | |||
@@ -87,6 +87,7 @@ Although we have used U-Boot so far, other boot loaders can be configured work w | |||
87 | * `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. | 87 | * `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. |
88 | * `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). | 88 | * `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). |
89 | * `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. | 89 | * `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. |
90 | * `SOTA_HARDWARE_ID` - a custom hardware ID that will be written to the aktualizr config. Defaults to MACHINE if not set. | ||
90 | 91 | ||
91 | == Usage | 92 | == Usage |
92 | 93 | ||
diff --git a/classes/image_types_ostree.bbclass b/classes/image_types_ostree.bbclass index 5286efc..05c73ff 100644 --- a/classes/image_types_ostree.bbclass +++ b/classes/image_types_ostree.bbclass | |||
@@ -235,7 +235,7 @@ IMAGE_CMD_garagesign () { | |||
235 | --length 0 \ | 235 | --length 0 \ |
236 | --url "${GARAGE_TARGET_URL}" \ | 236 | --url "${GARAGE_TARGET_URL}" \ |
237 | --sha256 ${ostree_target_hash} \ | 237 | --sha256 ${ostree_target_hash} \ |
238 | --hardwareids ${MACHINE} | 238 | --hardwareids ${SOTA_HARDWARE_ID} |
239 | garage-sign targets sign --repo tufrepo \ | 239 | garage-sign targets sign --repo tufrepo \ |
240 | --home-dir ${GARAGE_SIGN_REPO} \ | 240 | --home-dir ${GARAGE_SIGN_REPO} \ |
241 | --key-name=targets | 241 | --key-name=targets |
diff --git a/classes/sota.bbclass b/classes/sota.bbclass index 98cc3de..7fb54dc 100644 --- a/classes/sota.bbclass +++ b/classes/sota.bbclass | |||
@@ -11,6 +11,7 @@ HOSTTOOLS_NONFATAL += "java" | |||
11 | SOTA_CLIENT ??= "aktualizr" | 11 | SOTA_CLIENT ??= "aktualizr" |
12 | SOTA_CLIENT_PROV ??= "aktualizr-auto-prov" | 12 | SOTA_CLIENT_PROV ??= "aktualizr-auto-prov" |
13 | SOTA_DEPLOY_CREDENTIALS ?= "1" | 13 | SOTA_DEPLOY_CREDENTIALS ?= "1" |
14 | SOTA_HARDWARE_ID ??= "${MACHINE}" | ||
14 | 15 | ||
15 | IMAGE_INSTALL_append_sota = " ostree os-release ${SOTA_CLIENT} ${SOTA_CLIENT_PROV}" | 16 | IMAGE_INSTALL_append_sota = " ostree os-release ${SOTA_CLIENT} ${SOTA_CLIENT_PROV}" |
16 | IMAGE_CLASSES += " image_types_ostree image_types_ota" | 17 | IMAGE_CLASSES += " image_types_ostree image_types_ota" |
@@ -29,7 +30,7 @@ INITRAMFS_FSTYPES ??= "${@oe.utils.ifelse(d.getVar('OSTREE_BOOTLOADER', True) == | |||
29 | 30 | ||
30 | # Please redefine OSTREE_REPO in order to have a persistent OSTree repo | 31 | # Please redefine OSTREE_REPO in order to have a persistent OSTree repo |
31 | OSTREE_REPO ?= "${DEPLOY_DIR_IMAGE}/ostree_repo" | 32 | OSTREE_REPO ?= "${DEPLOY_DIR_IMAGE}/ostree_repo" |
32 | OSTREE_BRANCHNAME ?= "${MACHINE}" | 33 | OSTREE_BRANCHNAME ?= "${SOTA_HARDWARE_ID}" |
33 | OSTREE_OSNAME ?= "poky" | 34 | OSTREE_OSNAME ?= "poky" |
34 | INITRAMFS_IMAGE ?= "initramfs-ostree-image" | 35 | INITRAMFS_IMAGE ?= "initramfs-ostree-image" |
35 | OSTREE_BOOTLOADER ??= 'u-boot' | 36 | OSTREE_BOOTLOADER ??= 'u-boot' |
diff --git a/recipes-sota/aktualizr/aktualizr_git.bb b/recipes-sota/aktualizr/aktualizr_git.bb index 0d946f3..82449f0 100755 --- a/recipes-sota/aktualizr/aktualizr_git.bb +++ b/recipes-sota/aktualizr/aktualizr_git.bb | |||
@@ -70,6 +70,10 @@ do_install_append () { | |||
70 | install -m 0700 -d ${D}${libdir}/sota/conf.d | 70 | install -m 0700 -d ${D}${libdir}/sota/conf.d |
71 | install -m 0700 -d ${D}${sysconfdir}/sota/conf.d | 71 | install -m 0700 -d ${D}${sysconfdir}/sota/conf.d |
72 | 72 | ||
73 | if [ -n "${SOTA_HARDWARE_ID}" ]; then | ||
74 | echo "[provision]\nprimary_ecu_hardware_id = ${SOTA_HARDWARE_ID}\n" > ${D}${libdir}/sota/conf.d/40-hardware-id.toml | ||
75 | fi | ||
76 | |||
73 | if [ -n "${SOTA_SECONDARY_CONFIG_DIR}" ]; then | 77 | if [ -n "${SOTA_SECONDARY_CONFIG_DIR}" ]; then |
74 | if [ -d "${SOTA_SECONDARY_CONFIG_DIR}" ]; then | 78 | if [ -d "${SOTA_SECONDARY_CONFIG_DIR}" ]; then |
75 | install -m 0700 -d ${D}${sysconfdir}/sota/ecus | 79 | install -m 0700 -d ${D}${sysconfdir}/sota/ecus |