diff options
author | cajun-rat <phil@advancedtelematic.com> | 2017-12-05 17:26:18 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-12-05 17:26:18 +0100 |
commit | b238c2772512545789cef8da26898b703ee557fd (patch) | |
tree | c70c81b3c9f9e612c9dda6d9dbfcd1586b044335 | |
parent | 92471691b021291289b4c73b4f91f4aedd1336c6 (diff) | |
parent | 2475cbb2939568f36320d1a130ee1a7202351ad4 (diff) | |
download | meta-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.bb | 4 | ||||
-rw-r--r-- | recipes-sota/aktualizr/aktualizr-hsm-test-prov.bb | 2 | ||||
-rw-r--r-- | recipes-sota/aktualizr/aktualizr-implicit-prov.bb | 2 | ||||
-rw-r--r-- | recipes-sota/aktualizr/environment.inc | 17 | ||||
-rw-r--r-- | recipes-sota/aktualizr/files/aktualizr.service | 3 |
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 | ||
19 | inherit systemd | 19 | inherit systemd |
20 | 20 | ||
21 | require environment.inc | ||
22 | |||
21 | export SOTA_PACKED_CREDENTIALS | 23 | export SOTA_PACKED_CREDENTIALS |
22 | 24 | ||
23 | do_install_append() { | 25 | do_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 | ||
20 | inherit systemd | 20 | inherit systemd |
21 | 21 | ||
22 | require environment.inc | ||
23 | |||
22 | do_install() { | 24 | do_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 | ||
19 | inherit systemd | 19 | inherit systemd |
20 | 20 | ||
21 | require environment.inc | ||
22 | |||
21 | do_install() { | 23 | do_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 @@ | |||
1 | export SOTA_LEGACY_SECONDARY_INTERFACE | ||
2 | export SOTA_VIRTUAL_SECONDARIES | ||
3 | |||
4 | do_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 | |||
17 | FILES_${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] |
8 | RestartSec=10 | 8 | RestartSec=10 |
9 | Restart=always | 9 | Restart=always |
10 | ExecStart=/usr/bin/aktualizr --config /usr/lib/sota/sota.toml | 10 | EnvironmentFile=/usr/lib/sota/sota.env |
11 | ExecStart=/usr/bin/aktualizr $AKTUALIZR_CMDLINE_PARAMETERS | ||
11 | 12 | ||
12 | [Install] | 13 | [Install] |
13 | WantedBy=multi-user.target | 14 | WantedBy=multi-user.target |