summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSerhiy Stetskovych <patriotyk@gmail.com>2018-11-21 11:47:31 +0200
committerPatrick Vacek <patrickvacek@gmail.com>2018-11-29 11:19:47 +0100
commit80cf88a5ce9668041c020612630981e02d880bfc (patch)
tree07f77a94594f37242d612e8a7855fe4ceff6dda5
parent2832fa74813a3294711a4f832d43b5dc86ca5098 (diff)
downloadmeta-updater-80cf88a5ce9668041c020612630981e02d880bfc.tar.gz
Allow setup custom 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 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
84* `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. 84* `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.
85* `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). 85* `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).
86* `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. 86* `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.
87* `SOTA_HARDWARE_ID` - a custom hardware id variable. If not set, - MACHINE variable is used.
87 88
88== Usage 89== Usage
89 90
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 () {
226 --length 0 \ 226 --length 0 \
227 --url "${GARAGE_TARGET_URL}" \ 227 --url "${GARAGE_TARGET_URL}" \
228 --sha256 ${ostree_target_hash} \ 228 --sha256 ${ostree_target_hash} \
229 --hardwareids ${MACHINE} 229 --hardwareids ${SOTA_HARDWARE_ID}
230 garage-sign targets sign --repo tufrepo \ 230 garage-sign targets sign --repo tufrepo \
231 --home-dir ${GARAGE_SIGN_REPO} \ 231 --home-dir ${GARAGE_SIGN_REPO} \
232 --key-name=targets 232 --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"
10SOTA_CLIENT ??= "aktualizr" 10SOTA_CLIENT ??= "aktualizr"
11SOTA_CLIENT_PROV ??= "aktualizr-auto-prov" 11SOTA_CLIENT_PROV ??= "aktualizr-auto-prov"
12SOTA_DEPLOY_CREDENTIALS ?= "1" 12SOTA_DEPLOY_CREDENTIALS ?= "1"
13SOTA_HARDWARE_ID ??= "${MACHINE}"
13 14
14IMAGE_INSTALL_append_sota = " ostree os-release ${SOTA_CLIENT} ${SOTA_CLIENT_PROV}" 15IMAGE_INSTALL_append_sota = " ostree os-release ${SOTA_CLIENT} ${SOTA_CLIENT_PROV}"
15IMAGE_CLASSES += " image_types_ostree image_types_ota" 16IMAGE_CLASSES += " image_types_ostree image_types_ota"
@@ -26,7 +27,7 @@ OSTREE_INITRAMFS_FSTYPES ??= "${@oe.utils.ifelse(d.getVar('OSTREE_BOOTLOADER', T
26 27
27# Please redefine OSTREE_REPO in order to have a persistent OSTree repo 28# Please redefine OSTREE_REPO in order to have a persistent OSTree repo
28OSTREE_REPO ?= "${DEPLOY_DIR_IMAGE}/ostree_repo" 29OSTREE_REPO ?= "${DEPLOY_DIR_IMAGE}/ostree_repo"
29OSTREE_BRANCHNAME ?= "${MACHINE}" 30OSTREE_BRANCHNAME ?= "${SOTA_HARDWARE_ID}"
30OSTREE_OSNAME ?= "poky" 31OSTREE_OSNAME ?= "poky"
31OSTREE_INITRAMFS_IMAGE ?= "initramfs-ostree-image" 32OSTREE_INITRAMFS_IMAGE ?= "initramfs-ostree-image"
32OSTREE_BOOTLOADER ??= 'u-boot' 33OSTREE_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 () {
71 install -m 0700 -d ${D}${libdir}/sota/conf.d 71 install -m 0700 -d ${D}${libdir}/sota/conf.d
72 install -m 0700 -d ${D}${sysconfdir}/sota/conf.d 72 install -m 0700 -d ${D}${sysconfdir}/sota/conf.d
73 73
74 if [ -n "${SOTA_HARDWARE_ID}" ]; then
75 echo "[uptane]\nprimary_ecu_hardware_id = ${SOTA_HARDWARE_ID}\n" > ${D}${libdir}/sota/conf.d/40-hardware-id.toml
76 fi
77
74 if [ -n "${SOTA_SECONDARY_CONFIG_DIR}" ]; then 78 if [ -n "${SOTA_SECONDARY_CONFIG_DIR}" ]; then
75 if [ -d "${SOTA_SECONDARY_CONFIG_DIR}" ]; then 79 if [ -d "${SOTA_SECONDARY_CONFIG_DIR}" ]; then
76 install -m 0700 -d ${D}${sysconfdir}/sota/ecus 80 install -m 0700 -d ${D}${sysconfdir}/sota/ecus