summaryrefslogtreecommitdiffstats
path: root/recipes-sota
diff options
context:
space:
mode:
authorPatrick Vacek <patrickvacek@gmail.com>2018-11-12 14:49:37 +0100
committerPatrick Vacek <patrickvacek@gmail.com>2018-11-13 10:03:51 +0100
commitf05f7e554575fcc0720564ebc4703a3811644897 (patch)
tree0f7fc84c2cb6f7bb93aa8c22d40a8263a2f266ba /recipes-sota
parent94b473ae770faeca5c25959d36c3cc602ab18948 (diff)
downloadmeta-updater-f05f7e554575fcc0720564ebc4703a3811644897.tar.gz
aktualizr: Fix virtual secondary support.
Use /etc/sota/ecus as using /var/sota/ecus was conflicting with the provisioning recipes that also use /var/sota. Not totally ideal, but the best compromise I could find. Signed-off-by: Patrick Vacek <patrickvacek@gmail.com>
Diffstat (limited to 'recipes-sota')
-rw-r--r--recipes-sota/aktualizr/aktualizr-auto-prov.bb3
-rwxr-xr-xrecipes-sota/aktualizr/aktualizr_git.bb7
-rw-r--r--recipes-sota/aktualizr/environment.inc11
3 files changed, 11 insertions, 10 deletions
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() {
40FILES_${PN} = " \ 39FILES_${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 2b6ad38..39767d4 100755
--- a/recipes-sota/aktualizr/aktualizr_git.bb
+++ b/recipes-sota/aktualizr/aktualizr_git.bb
@@ -69,6 +69,12 @@ do_install_append () {
69 install -m 0644 ${WORKDIR}/aktualizr-secondary.service ${D}${systemd_unitdir}/system/aktualizr-secondary.service 69 install -m 0644 ${WORKDIR}/aktualizr-secondary.service ${D}${systemd_unitdir}/system/aktualizr-secondary.service
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
73 if [ -n "${SOTA_SECONDARY_CONFIG_DIR}" ] && [ -e "${SOTA_SECONDARY_CONFIG_DIR}" ]; then
74 install -m 0700 -d ${D}${sysconfdir}/sota/ecus
75 install -m 0644 "${SOTA_SECONDARY_CONFIG_DIR}"/* ${D}${sysconfdir}/sota/ecus/
76 fi
77
72} 78}
73 79
74do_install_append_class-target () { 80do_install_append_class-target () {
@@ -91,6 +97,7 @@ FILES_${PN} = " \
91 ${systemd_unitdir}/system/aktualizr.service \ 97 ${systemd_unitdir}/system/aktualizr.service \
92 ${libdir}/sota/conf.d \ 98 ${libdir}/sota/conf.d \
93 ${sysconfdir}/sota/conf.d \ 99 ${sysconfdir}/sota/conf.d \
100 ${sysconfdir}/sota/ecus/* \
94 " 101 "
95 102
96FILES_${PN}-examples = " \ 103FILES_${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 @@
1export SOTA_VIRTUAL_SECONDARIES
2
3do_install_append() { 1do_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
11FILES_${PN}_append = " ${libdir}/sota/sota.env" 8FILES_${PN}_append = " ${libdir}/sota/sota.env"