summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSerhiy Stetskovych <patriotyk@gmail.com>2018-11-21 11:47:31 +0200
committerSerhiy Stetskovych <patriotyk@gmail.com>2018-11-22 11:15:35 +0200
commit01700ac5f0f3aaaee17b9dc426b0697996d17c70 (patch)
tree7888ddcd76fe66c97725e3542f66035e5684f359
parent616cbf7d42dc7a6d9b09803fd7e6080299264f74 (diff)
downloadmeta-updater-feat/hardware_id.tar.gz
Allow setup custom hardware_idfeat/hardware_id
Signed-off-by: Serhiy Stetskovych <patriotyk@gmail.com>
-rw-r--r--README.adoc1
-rw-r--r--classes/image_types_ostree.bbclass2
-rw-r--r--classes/sota.bbclass3
-rwxr-xr-xrecipes-sota/aktualizr/aktualizr_git.bb4
4 files changed, 8 insertions, 2 deletions
diff --git a/README.adoc b/README.adoc
index bed0591..9c5c9e5 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 variable. If not set, - MACHINE variable is used.
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"
11SOTA_CLIENT ??= "aktualizr" 11SOTA_CLIENT ??= "aktualizr"
12SOTA_CLIENT_PROV ??= "aktualizr-auto-prov" 12SOTA_CLIENT_PROV ??= "aktualizr-auto-prov"
13SOTA_DEPLOY_CREDENTIALS ?= "1" 13SOTA_DEPLOY_CREDENTIALS ?= "1"
14SOTA_HARDWARE_ID ??= "${MACHINE}"
14 15
15IMAGE_INSTALL_append_sota = " ostree os-release ${SOTA_CLIENT} ${SOTA_CLIENT_PROV}" 16IMAGE_INSTALL_append_sota = " ostree os-release ${SOTA_CLIENT} ${SOTA_CLIENT_PROV}"
16IMAGE_CLASSES += " image_types_ostree image_types_ota" 17IMAGE_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
31OSTREE_REPO ?= "${DEPLOY_DIR_IMAGE}/ostree_repo" 32OSTREE_REPO ?= "${DEPLOY_DIR_IMAGE}/ostree_repo"
32OSTREE_BRANCHNAME ?= "${MACHINE}" 33OSTREE_BRANCHNAME ?= "${SOTA_HARDWARE_ID}"
33OSTREE_OSNAME ?= "poky" 34OSTREE_OSNAME ?= "poky"
34INITRAMFS_IMAGE ?= "initramfs-ostree-image" 35INITRAMFS_IMAGE ?= "initramfs-ostree-image"
35OSTREE_BOOTLOADER ??= 'u-boot' 36OSTREE_BOOTLOADER ??= 'u-boot'
diff --git a/recipes-sota/aktualizr/aktualizr_git.bb b/recipes-sota/aktualizr/aktualizr_git.bb
index 0d946f3..5a19b52 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 "[uptane]\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