summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMike Sul <ext-mykhaylo.sul@here.com>2019-05-21 08:04:44 +0300
committerMike Sul <ext-mykhaylo.sul@here.com>2019-05-27 10:40:00 +0300
commitd0b6547fde5038cb7ab9837681ea370af24de855 (patch)
treebbe7d483d6cb7e3804b1cd524b8d691ea02b29b4
parent753f664541c84f1977f370690e38d9130bf9e2f1 (diff)
downloadmeta-updater-d0b6547fde5038cb7ab9837681ea370af24de855.tar.gz
OTA-2541: Add suffix '-sndry' to a default HW_ID for Secondary. Ability to define IP and Port in local.conf
Signed-off-by: Mike Sul <ext-mykhaylo.sul@here.com>
-rw-r--r--recipes-test/demo-network-config/primary-network-config.bb3
-rw-r--r--recipes-test/demo-network-config/secondary-network-config.bb3
-rw-r--r--recipes-test/demo-network-config/static-network-config.inc6
-rw-r--r--recipes-test/demo-secondary-config/files/35-network_config.toml4
-rw-r--r--recipes-test/demo-secondary-config/files/45-id_config.toml3
-rw-r--r--recipes-test/demo-secondary-config/secondary-config.bb26
-rw-r--r--recipes-test/images/secondary-image.bb2
7 files changed, 40 insertions, 7 deletions
diff --git a/recipes-test/demo-network-config/primary-network-config.bb b/recipes-test/demo-network-config/primary-network-config.bb
index ce19f07..9725898 100644
--- a/recipes-test/demo-network-config/primary-network-config.bb
+++ b/recipes-test/demo-network-config/primary-network-config.bb
@@ -16,7 +16,8 @@ do_install() {
16 install -m 0644 ${WORKDIR}/27-dhcp-client-external.network ${D}/usr/lib/systemd/network/ 16 install -m 0644 ${WORKDIR}/27-dhcp-client-external.network ${D}/usr/lib/systemd/network/
17} 17}
18 18
19SECONDARY_NETWORK_IP_ADDR ?= "10.0.3.1" 19PRIMARY_IP ?= "10.0.3.1"
20IP_ADDR = "${PRIMARY_IP}"
20 21
21require static-network-config.inc 22require static-network-config.inc
22 23
diff --git a/recipes-test/demo-network-config/secondary-network-config.bb b/recipes-test/demo-network-config/secondary-network-config.bb
index 6473e05..e33229d 100644
--- a/recipes-test/demo-network-config/secondary-network-config.bb
+++ b/recipes-test/demo-network-config/secondary-network-config.bb
@@ -20,7 +20,8 @@ do_install() {
20 install -m 0644 ${WORKDIR}/27-dhcp-client-external.network ${D}/usr/lib/systemd/network/ 20 install -m 0644 ${WORKDIR}/27-dhcp-client-external.network ${D}/usr/lib/systemd/network/
21} 21}
22 22
23SECONDARY_NETWORK_IP_ADDR ?= "10.0.3.2" 23SECONDARY_IP ?= "10.0.3.2"
24IP_ADDR = "${SECONDARY_IP}"
24 25
25require static-network-config.inc 26require static-network-config.inc
26 27
diff --git a/recipes-test/demo-network-config/static-network-config.inc b/recipes-test/demo-network-config/static-network-config.inc
index 27d2a20..e64675e 100644
--- a/recipes-test/demo-network-config/static-network-config.inc
+++ b/recipes-test/demo-network-config/static-network-config.inc
@@ -2,13 +2,13 @@ SRC_URI_append = "\
2 file://26-static-client.network \ 2 file://26-static-client.network \
3 " 3 "
4 4
5SECONDARY_NETWORK_INTERFACE_NAME ?= "enp0s5" 5SECONDARY_INTERFACE ?= "enp0s5"
6 6
7do_install_append() { 7do_install_append() {
8 install -d ${D}/usr/lib/systemd/network 8 install -d ${D}/usr/lib/systemd/network
9 install -m 0644 ${WORKDIR}/26-static-client.network ${D}/usr/lib/systemd/network/ 9 install -m 0644 ${WORKDIR}/26-static-client.network ${D}/usr/lib/systemd/network/
10 sed -i -e 's|@ADDR@|${SECONDARY_NETWORK_IP_ADDR}|g' \ 10 sed -i -e 's|@ADDR@|${IP_ADDR}|g' \
11 -e 's|@IFNAME@|${SECONDARY_NETWORK_INTERFACE_NAME}|g' \ 11 -e 's|@IFNAME@|${SECONDARY_INTERFACE}|g' \
12 ${D}/usr/lib/systemd/network/26-static-client.network 12 ${D}/usr/lib/systemd/network/26-static-client.network
13 13
14} 14}
diff --git a/recipes-test/demo-secondary-config/files/35-network_config.toml b/recipes-test/demo-secondary-config/files/35-network_config.toml
new file mode 100644
index 0000000..db7a1bb
--- /dev/null
+++ b/recipes-test/demo-secondary-config/files/35-network_config.toml
@@ -0,0 +1,4 @@
1[network]
2port = @PORT@
3primary_ip = @PRIMARY_IP@
4primary_port = @PRIMARY_PORT@
diff --git a/recipes-test/demo-secondary-config/files/45-id_config.toml b/recipes-test/demo-secondary-config/files/45-id_config.toml
new file mode 100644
index 0000000..6cbd77f
--- /dev/null
+++ b/recipes-test/demo-secondary-config/files/45-id_config.toml
@@ -0,0 +1,3 @@
1[uptane]
2ecu_serial = @SERIAL@
3ecu_hardware_id = @HWID@
diff --git a/recipes-test/demo-secondary-config/secondary-config.bb b/recipes-test/demo-secondary-config/secondary-config.bb
index 3187ff0..b05ab8e 100644
--- a/recipes-test/demo-secondary-config/secondary-config.bb
+++ b/recipes-test/demo-secondary-config/secondary-config.bb
@@ -1,20 +1,42 @@
1DESCRIPTION = "Sample configuration for an Uptane Secondary" 1DESCRIPTION = "Sample configuration for an Uptane Secondary"
2LICENSE = "CLOSED" 2LICENSE = "CLOSED"
3 3
4inherit allarch 4SECONDARY_SERIAL_ID ?= ""
5SOTA_HARDWARE_ID ?= "${MACHINE}-sndry"
6SECONDARY_HARDWARE_ID ?= "${SOTA_HARDWARE_ID}"
7
8SECONDARY_PORT ?= "9050"
9PRIMARY_IP ?= "10.0.3.1"
10PRIMARY_PORT ?= "9040"
5 11
6SRC_URI = "\ 12SRC_URI = "\
7 file://30-fake_pacman.toml \ 13 file://30-fake_pacman.toml \
14 file://35-network_config.toml \
15 file://45-id_config.toml \
8 " 16 "
9 17
10do_install () { 18do_install () {
11 install -m 0700 -d ${D}${libdir}/sota/conf.d 19 install -m 0700 -d ${D}${libdir}/sota/conf.d
12 install -m 0644 ${WORKDIR}/30-fake_pacman.toml ${D}/${libdir}/sota/conf.d/30-fake_pacman.toml 20 install -m 0644 ${WORKDIR}/30-fake_pacman.toml ${D}/${libdir}/sota/conf.d/30-fake_pacman.toml
21
22 install -m 0644 ${WORKDIR}/35-network_config.toml ${D}/${libdir}/sota/conf.d/35-network_config.toml
23 sed -i -e 's|@PORT@|${SECONDARY_PORT}|g' \
24 -e 's|@PRIMARY_IP@|${PRIMARY_IP}|g' \
25 -e 's|@PRIMARY_PORT@|${PRIMARY_PORT}|g' \
26 ${D}/${libdir}/sota/conf.d/35-network_config.toml
27
28 install -m 0644 ${WORKDIR}/45-id_config.toml ${D}/${libdir}/sota/conf.d/45-id_config.toml
29 sed -i -e 's|@SERIAL@|${SECONDARY_SERIAL_ID}|g' \
30 -e 's|@HWID@|${SECONDARY_HARDWARE_ID}|g' \
31 ${D}/${libdir}/sota/conf.d/45-id_config.toml
32
13} 33}
14 34
15FILES_${PN} = " \ 35FILES_${PN} = " \
16 ${libdir}/sota/conf.d \ 36 ${libdir}/sota/conf.d \
17 ${libdir}/sota/conf.d/30-fake_pacman.toml \ 37 ${libdir}/sota/conf.d/30-fake_pacman.toml \
38 ${libdir}/sota/conf.d/35-network_config.toml \
39 ${libdir}/sota/conf.d/45-id_config.toml \
18 " 40 "
19 41
20# vim:set ts=4 sw=4 sts=4 expandtab: 42# vim:set ts=4 sw=4 sts=4 expandtab:
diff --git a/recipes-test/images/secondary-image.bb b/recipes-test/images/secondary-image.bb
index 46be3d1..a688bbd 100644
--- a/recipes-test/images/secondary-image.bb
+++ b/recipes-test/images/secondary-image.bb
@@ -4,6 +4,8 @@ SUMMARY = "A minimal Uptane Secondary image running aktualizr-secondary"
4 4
5LICENSE = "MIT" 5LICENSE = "MIT"
6 6
7SECONDARY_SERIAL_ID ?= ""
8SOTA_HARDWARE_ID ?= "${MACHINE}-sndry"
7 9
8# Remove default aktualizr primary, and the provisioning configuration (which 10# Remove default aktualizr primary, and the provisioning configuration (which
9# RDEPENDS on aktualizr) 11# RDEPENDS on aktualizr)