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:41 +0100
commit84c3f66de1a1d690eeed2035ae1a8232f35a0572 (patch)
tree04a216e4e8fc8f1363ec3599eabcbd9446799758
parenteaee7001e061ed8cf644b013be8e0ec62a9e3f74 (diff)
downloadmeta-updater-84c3f66de1a1d690eeed2035ae1a8232f35a0572.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 43d625c..563f9d6 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 4bcfc9b..0acc786 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 06da674..1e149ea 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 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