Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OTA-2488: Remove SOTA_SECONDARY_CONFIG_DIR configuration variable #533

Merged
merged 1 commit into from
Jul 10, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ Your images will also need network connectivity to be able to reach an actual OT
* `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.
* `SOTA_CLIENT_PROV` - which provisioning method to use. Valid options are `aktualizr-shared-prov`, `aktualizr-device-prov`, and `aktualizr-device-prov-hsm`. For more information on these provisioning methods, see the https://docs.ota.here.com/client-config/client-provisioning-methods.html[OTA Connect documentation]. The default is `aktualizr-shared-prov`. This can also be set to an empty string to avoid using a provisioning recipe.
* `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).
* `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.
* `SOTA_SECONDARY_CONFIG` - a file containing JSON configuration for secondaries. It will be installed into `/etc/sota/ecus` on the device and automatically provided to aktualizr. See link:https://github.com/advancedtelematic/aktualizr/blob/master/docs/posix-secondaries-bitbaking.adoc[here] for more details.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is the bit about /var/sota/ecus accurate? And has aktualizr been bumped already such that the new method is the only way forward now? If yes to both, then this is fine. But how does the config file get on the device? I've forgotten.

Copy link
Collaborator Author

@mike-sul mike-sul Jul 10, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I am sure about /etc/sota/ecus - this is a folder that the secondaries configuration file is put in.
No, I haven't updated the reference to the desired version of aktualizr at meta-udpater, will do it.

But how does the config file get on the device?

If SOTA_SECONDARY_CONFIG is specified in the local.conf then the corresponding file will be installed into /etc/sota/ecus folder and /usr/lib/sota/conf.d/30-secondary-config.toml will reference to it.
If SOTA_SECONDARY_CONFIG is not specified in the local.conf then the config file will be auto-generated taking into account other configuration variables, see here for details on them https://github.com/advancedtelematic/aktualizr/blob/master/docs/posix-secondaries-bitbaking.adoc

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bumped the corresponding version of aktualizr.

* `SOTA_HARDWARE_ID` - a custom hardware ID that will be written to the aktualizr config. Defaults to MACHINE if not set.
* `SOTA_MAIN_DTB` - base device tree to use with the kernel. Used together with FIT images. You can change it, and the device tree will also be changed after the update.
* `SOTA_DT_OVERLAYS` - whitespace-separated list of used device tree overlays for FIT image. This list is OSTree-updateable as well.
Expand Down
12 changes: 1 addition & 11 deletions recipes-sota/aktualizr/aktualizr_git.bb
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ SRC_URI = " \
SRC_URI[md5sum] = "e104ccd4f32e52571a5fc0e5042db050"
SRC_URI[sha256sum] = "c590be1a57523bfe097af82279eda5c97cf40ae47fb27162cf33c469702c8a9b"

SRCREV = "fce5854ff10e7efd52d69bbaf68dc2af990d5746"
SRCREV = "9c592cf9d8dfcd995d47753f2be7bd1a2b56c7da"
BRANCH ?= "master"

S = "${WORKDIR}/git"
Expand Down Expand Up @@ -106,16 +106,6 @@ do_install_append () {
printf "[provision]\nprimary_ecu_hardware_id = ${SOTA_HARDWARE_ID}\n" > ${D}${libdir}/sota/conf.d/40-hardware-id.toml
fi

if [ -n "${SOTA_SECONDARY_CONFIG_DIR}" ]; then
if [ -d "${SOTA_SECONDARY_CONFIG_DIR}" ]; then
install -m 0700 -d ${D}${sysconfdir}/sota/ecus
install -m 0644 "${SOTA_SECONDARY_CONFIG_DIR}"/* ${D}${sysconfdir}/sota/ecus/
printf "[uptane]\nsecondary_configs_dir = /etc/sota/ecus/\n" > ${D}${libdir}/sota/conf.d/30-secondary-configs-dir.toml
else
bbwarn "SOTA_SECONDARY_CONFIG_DIR is set to an invalid directory (${SOTA_SECONDARY_CONFIG_DIR})"
fi
fi

install -m 0755 -d ${D}${systemd_unitdir}/system
aktualizr_service=${@bb.utils.contains('SOTA_CLIENT_FEATURES', 'serialcan', '${WORKDIR}/aktualizr-serialcan.service', '${WORKDIR}/aktualizr.service', d)}
install -m 0644 ${aktualizr_service} ${D}${systemd_unitdir}/system/aktualizr.service
Expand Down