diff options
| -rw-r--r-- | README.adoc | 3 | ||||
| -rw-r--r-- | classes/image_types_ostree.bbclass | 5 | ||||
| -rw-r--r-- | recipes-sota/aktualizr/aktualizr-auto-prov.bb | 3 | ||||
| -rwxr-xr-x | recipes-sota/aktualizr/aktualizr_git.bb | 7 | ||||
| -rw-r--r-- | recipes-sota/aktualizr/environment.inc | 11 |
5 files changed, 12 insertions, 17 deletions
diff --git a/README.adoc b/README.adoc index 2ded322..2f74c1d 100644 --- a/README.adoc +++ b/README.adoc | |||
| @@ -83,8 +83,7 @@ Although we have used U-Boot so far, other boot loaders can be configured work w | |||
| 83 | * `SOTA_DEPLOY_CREDENTIALS` - when set to '1' (default value), deploys credentials to the built image. Override it in `local.conf` to built a generic image that can be provisioned manually after the build. | 83 | * `SOTA_DEPLOY_CREDENTIALS` - when set to '1' (default value), deploys credentials to the built image. Override it in `local.conf` to built a generic image that can be provisioned manually after the build. |
| 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_ECUS` - a list of paths separated by spaces of JSON configuration files for virtual secondaries on the host. These will be installed into `/var/sota/ecus` on the device. | 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_VIRTUAL_SECONDARIES` - a list of paths separated by spaces of JSON configuration files for virtual secondaries installed on the device. If `SOTA_SECONDARY_ECUS` is used to install them, then you can expect them to be installed in `/var/sota/ecus`. | ||
| 88 | 87 | ||
| 89 | == Usage | 88 | == Usage |
| 90 | 89 | ||
diff --git a/classes/image_types_ostree.bbclass b/classes/image_types_ostree.bbclass index dc0e9a2..e7ff2c4 100644 --- a/classes/image_types_ostree.bbclass +++ b/classes/image_types_ostree.bbclass | |||
| @@ -123,11 +123,6 @@ IMAGE_CMD_ostree () { | |||
| 123 | ln -sf var/roothome root | 123 | ln -sf var/roothome root |
| 124 | fi | 124 | fi |
| 125 | 125 | ||
| 126 | if [ -n "${SOTA_SECONDARY_ECUS}" ]; then | ||
| 127 | mkdir -p var/sota/ecus | ||
| 128 | cp ${SOTA_SECONDARY_ECUS} var/sota/ecus | ||
| 129 | fi | ||
| 130 | |||
| 131 | # Creating boot directories is required for "ostree admin deploy" | 126 | # Creating boot directories is required for "ostree admin deploy" |
| 132 | 127 | ||
| 133 | mkdir -p boot/loader.0 | 128 | mkdir -p boot/loader.0 |
diff --git a/recipes-sota/aktualizr/aktualizr-auto-prov.bb b/recipes-sota/aktualizr/aktualizr-auto-prov.bb index 01f21fa..39a5e6e 100644 --- a/recipes-sota/aktualizr/aktualizr-auto-prov.bb +++ b/recipes-sota/aktualizr/aktualizr-auto-prov.bb | |||
| @@ -30,7 +30,6 @@ do_install() { | |||
| 30 | fi | 30 | fi |
| 31 | 31 | ||
| 32 | install -m 0700 -d ${D}${libdir}/sota/conf.d | 32 | install -m 0700 -d ${D}${libdir}/sota/conf.d |
| 33 | install -m 0700 -d ${D}${localstatedir}/sota | ||
| 34 | aktualizr_toml=${@bb.utils.contains('SOTA_CLIENT_FEATURES', 'secondary-network', 'sota_autoprov_primary.toml', 'sota_autoprov.toml', d)} | 33 | aktualizr_toml=${@bb.utils.contains('SOTA_CLIENT_FEATURES', 'secondary-network', 'sota_autoprov_primary.toml', 'sota_autoprov.toml', d)} |
| 35 | 34 | ||
| 36 | install -m 0644 ${STAGING_DIR_NATIVE}${libdir}/sota/${aktualizr_toml} \ | 35 | install -m 0644 ${STAGING_DIR_NATIVE}${libdir}/sota/${aktualizr_toml} \ |
| @@ -40,8 +39,6 @@ do_install() { | |||
| 40 | FILES_${PN} = " \ | 39 | FILES_${PN} = " \ |
| 41 | ${libdir}/sota/conf.d \ | 40 | ${libdir}/sota/conf.d \ |
| 42 | ${libdir}/sota/conf.d/20-${aktualizr_toml} \ | 41 | ${libdir}/sota/conf.d/20-${aktualizr_toml} \ |
| 43 | ${localstatedir}/sota \ | ||
| 44 | ${localstatedir}/sota/sota_provisioning_credentials.zip \ | ||
| 45 | " | 42 | " |
| 46 | 43 | ||
| 47 | # vim:set ts=4 sw=4 sts=4 expandtab: | 44 | # vim:set ts=4 sw=4 sts=4 expandtab: |
diff --git a/recipes-sota/aktualizr/aktualizr_git.bb b/recipes-sota/aktualizr/aktualizr_git.bb index b42f133..37dc6d4 100755 --- a/recipes-sota/aktualizr/aktualizr_git.bb +++ b/recipes-sota/aktualizr/aktualizr_git.bb | |||
| @@ -70,6 +70,12 @@ do_install_append () { | |||
| 70 | install -m 0644 ${WORKDIR}/aktualizr-secondary.service ${D}${systemd_unitdir}/system/aktualizr-secondary.service | 70 | install -m 0644 ${WORKDIR}/aktualizr-secondary.service ${D}${systemd_unitdir}/system/aktualizr-secondary.service |
| 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 | |||
| 74 | if [ -n "${SOTA_SECONDARY_CONFIG_DIR}" ] && [ -e "${SOTA_SECONDARY_CONFIG_DIR}" ]; then | ||
| 75 | install -m 0700 -d ${D}${sysconfdir}/sota/ecus | ||
| 76 | install -m 0644 "${SOTA_SECONDARY_CONFIG_DIR}"/* ${D}${sysconfdir}/sota/ecus/ | ||
| 77 | fi | ||
| 78 | |||
| 73 | } | 79 | } |
| 74 | 80 | ||
| 75 | do_install_append_class-target () { | 81 | do_install_append_class-target () { |
| @@ -92,6 +98,7 @@ FILES_${PN} = " \ | |||
| 92 | ${systemd_unitdir}/system/aktualizr.service \ | 98 | ${systemd_unitdir}/system/aktualizr.service \ |
| 93 | ${libdir}/sota/conf.d \ | 99 | ${libdir}/sota/conf.d \ |
| 94 | ${sysconfdir}/sota/conf.d \ | 100 | ${sysconfdir}/sota/conf.d \ |
| 101 | ${sysconfdir}/sota/ecus/* \ | ||
| 95 | " | 102 | " |
| 96 | 103 | ||
| 97 | FILES_${PN}-examples = " \ | 104 | FILES_${PN}-examples = " \ |
diff --git a/recipes-sota/aktualizr/environment.inc b/recipes-sota/aktualizr/environment.inc index 16e789e..0b46a2e 100644 --- a/recipes-sota/aktualizr/environment.inc +++ b/recipes-sota/aktualizr/environment.inc | |||
| @@ -1,11 +1,8 @@ | |||
| 1 | export SOTA_VIRTUAL_SECONDARIES | ||
| 2 | |||
| 3 | do_install_append() { | 1 | do_install_append() { |
| 4 | for sec in ${SOTA_VIRTUAL_SECONDARIES}; do | 2 | if [ -n "${SOTA_SECONDARY_CONFIG_DIR}" ]; then |
| 5 | AKTUALIZR_PARAMETERS_VIRTUALSECS="${AKTUALIZR_PARAMETERS_VIRTUALSECS} --secondary-config $sec" | 3 | AKTUALIZR_CMDLINE_PARAMETERS="${AKTUALIZR_CMDLINE_PARAMETERS} --secondary-configs-dir /etc/sota/ecus" |
| 6 | done | 4 | fi |
| 7 | 5 | echo "AKTUALIZR_CMDLINE_PARAMETERS=${AKTUALIZR_CMDLINE_PARAMETERS}" > ${D}${libdir}/sota/sota.env | |
| 8 | echo "AKTUALIZR_CMDLINE_PARAMETERS=${AKTUALIZR_PARAMETERS_VIRTUALSECS}" > ${D}${libdir}/sota/sota.env | ||
| 9 | } | 6 | } |
| 10 | 7 | ||
| 11 | FILES_${PN}_append = " ${libdir}/sota/sota.env" | 8 | FILES_${PN}_append = " ${libdir}/sota/sota.env" |
