summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorcajun-rat <phil@advancedtelematic.com>2017-12-05 17:26:18 +0100
committerGitHub <noreply@github.com>2017-12-05 17:26:18 +0100
commitb238c2772512545789cef8da26898b703ee557fd (patch)
treec70c81b3c9f9e612c9dda6d9dbfcd1586b044335
parent92471691b021291289b4c73b4f91f4aedd1336c6 (diff)
parent2475cbb2939568f36320d1a130ee1a7202351ad4 (diff)
downloadmeta-updater-b238c2772512545789cef8da26898b703ee557fd.tar.gz
Merge pull request #196 from advancedtelematic/feat/PRO-3751/legacyinterface
Provide user interface to add legacy secondary bridge
-rw-r--r--recipes-sota/aktualizr/aktualizr-auto-prov.bb4
-rw-r--r--recipes-sota/aktualizr/aktualizr-hsm-test-prov.bb2
-rw-r--r--recipes-sota/aktualizr/aktualizr-implicit-prov.bb2
-rw-r--r--recipes-sota/aktualizr/environment.inc17
-rw-r--r--recipes-sota/aktualizr/files/aktualizr.service3
5 files changed, 26 insertions, 2 deletions
diff --git a/recipes-sota/aktualizr/aktualizr-auto-prov.bb b/recipes-sota/aktualizr/aktualizr-auto-prov.bb
index e44530a..6588c20 100644
--- a/recipes-sota/aktualizr/aktualizr-auto-prov.bb
+++ b/recipes-sota/aktualizr/aktualizr-auto-prov.bb
@@ -18,9 +18,11 @@ SYSTEMD_SERVICE_${PN} = "aktualizr.service"
18 18
19inherit systemd 19inherit systemd
20 20
21require environment.inc
22
21export SOTA_PACKED_CREDENTIALS 23export SOTA_PACKED_CREDENTIALS
22 24
23do_install_append() { 25do_install() {
24 if [ -n "${SOTA_AUTOPROVISION_CREDENTIALS}" ]; then 26 if [ -n "${SOTA_AUTOPROVISION_CREDENTIALS}" ]; then
25 bbwarn "SOTA_AUTOPROVISION_CREDENTIALS are ignored. Please use SOTA_PACKED_CREDENTIALS" 27 bbwarn "SOTA_AUTOPROVISION_CREDENTIALS are ignored. Please use SOTA_PACKED_CREDENTIALS"
26 fi 28 fi
diff --git a/recipes-sota/aktualizr/aktualizr-hsm-test-prov.bb b/recipes-sota/aktualizr/aktualizr-hsm-test-prov.bb
index cc34528..ddc8dbf 100644
--- a/recipes-sota/aktualizr/aktualizr-hsm-test-prov.bb
+++ b/recipes-sota/aktualizr/aktualizr-hsm-test-prov.bb
@@ -19,6 +19,8 @@ SYSTEMD_SERVICE_${PN} = "aktualizr.service"
19 19
20inherit systemd 20inherit systemd
21 21
22require environment.inc
23
22do_install() { 24do_install() {
23 install -d ${D}/${systemd_unitdir}/system 25 install -d ${D}/${systemd_unitdir}/system
24 install -m 0644 ${WORKDIR}/aktualizr.service ${D}/${systemd_unitdir}/system/aktualizr.service 26 install -m 0644 ${WORKDIR}/aktualizr.service ${D}/${systemd_unitdir}/system/aktualizr.service
diff --git a/recipes-sota/aktualizr/aktualizr-implicit-prov.bb b/recipes-sota/aktualizr/aktualizr-implicit-prov.bb
index 5688b95..37d0e91 100644
--- a/recipes-sota/aktualizr/aktualizr-implicit-prov.bb
+++ b/recipes-sota/aktualizr/aktualizr-implicit-prov.bb
@@ -18,6 +18,8 @@ SYSTEMD_SERVICE_${PN} = "aktualizr.service"
18 18
19inherit systemd 19inherit systemd
20 20
21require environment.inc
22
21do_install() { 23do_install() {
22 install -d ${D}/${systemd_unitdir}/system 24 install -d ${D}/${systemd_unitdir}/system
23 install -m 0644 ${WORKDIR}/aktualizr.service ${D}/${systemd_unitdir}/system/aktualizr.service 25 install -m 0644 ${WORKDIR}/aktualizr.service ${D}/${systemd_unitdir}/system/aktualizr.service
diff --git a/recipes-sota/aktualizr/environment.inc b/recipes-sota/aktualizr/environment.inc
new file mode 100644
index 0000000..cba77e7
--- /dev/null
+++ b/recipes-sota/aktualizr/environment.inc
@@ -0,0 +1,17 @@
1export SOTA_LEGACY_SECONDARY_INTERFACE
2export SOTA_VIRTUAL_SECONDARIES
3
4do_install_append() {
5 if [ -n "${SOTA_LEGACY_SECONDARY_INTERFACE}" ]; then
6 AKTUALIZR_PARAMETERS_LEGACYSEC="--legacy-interface ${SOTA_LEGACY_SECONDARY_INTERFACE}";
7 fi
8
9 AKTUALIZR_PARAMETERS_CONFIGFILE="--config /usr/lib/sota/sota.toml"
10 for sec in ${SOTA_VIRTUAL_SECONDARIES}; do
11 AKTUALIZR_PARAMETERS_VIRTUALSECS="${AKTUALIZR_PARAMETERS_VIRTUALSECS} --secondary-config $sec"
12 done
13
14 echo "AKTUALIZR_CMDLINE_PARAMETERS=${AKTUALIZR_PARAMETERS_CONFIGFILE} ${AKTUALIZR_PARAMETERS_LEGACYSEC} ${AKTUALIZR_PARAMETERS_VIRTUALSECS}" > ${D}${libdir}/sota/sota.env
15}
16
17FILES_${PN}_append = " ${libdir}/sota/sota.env"
diff --git a/recipes-sota/aktualizr/files/aktualizr.service b/recipes-sota/aktualizr/files/aktualizr.service
index 8cb8d78..b6df9d7 100644
--- a/recipes-sota/aktualizr/files/aktualizr.service
+++ b/recipes-sota/aktualizr/files/aktualizr.service
@@ -7,7 +7,8 @@ Requires=network-online.target
7[Service] 7[Service]
8RestartSec=10 8RestartSec=10
9Restart=always 9Restart=always
10ExecStart=/usr/bin/aktualizr --config /usr/lib/sota/sota.toml 10EnvironmentFile=/usr/lib/sota/sota.env
11ExecStart=/usr/bin/aktualizr $AKTUALIZR_CMDLINE_PARAMETERS
11 12
12[Install] 13[Install]
13WantedBy=multi-user.target 14WantedBy=multi-user.target