diff options
Diffstat (limited to 'recipes-test')
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 | ||
19 | SECONDARY_NETWORK_IP_ADDR ?= "10.0.3.1" | 19 | PRIMARY_IP ?= "10.0.3.1" |
20 | IP_ADDR = "${PRIMARY_IP}" | ||
20 | 21 | ||
21 | require static-network-config.inc | 22 | require 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 | ||
23 | SECONDARY_NETWORK_IP_ADDR ?= "10.0.3.2" | 23 | SECONDARY_IP ?= "10.0.3.2" |
24 | IP_ADDR = "${SECONDARY_IP}" | ||
24 | 25 | ||
25 | require static-network-config.inc | 26 | require 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 | ||
5 | SECONDARY_NETWORK_INTERFACE_NAME ?= "enp0s5" | 5 | SECONDARY_INTERFACE ?= "enp0s5" |
6 | 6 | ||
7 | do_install_append() { | 7 | do_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] | ||
2 | port = @PORT@ | ||
3 | primary_ip = @PRIMARY_IP@ | ||
4 | primary_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] | ||
2 | ecu_serial = @SERIAL@ | ||
3 | ecu_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 @@ | |||
1 | DESCRIPTION = "Sample configuration for an Uptane Secondary" | 1 | DESCRIPTION = "Sample configuration for an Uptane Secondary" |
2 | LICENSE = "CLOSED" | 2 | LICENSE = "CLOSED" |
3 | 3 | ||
4 | inherit allarch | 4 | SECONDARY_SERIAL_ID ?= "" |
5 | SOTA_HARDWARE_ID ?= "${MACHINE}-sndry" | ||
6 | SECONDARY_HARDWARE_ID ?= "${SOTA_HARDWARE_ID}" | ||
7 | |||
8 | SECONDARY_PORT ?= "9050" | ||
9 | PRIMARY_IP ?= "10.0.3.1" | ||
10 | PRIMARY_PORT ?= "9040" | ||
5 | 11 | ||
6 | SRC_URI = "\ | 12 | SRC_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 | ||
10 | do_install () { | 18 | do_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 | ||
15 | FILES_${PN} = " \ | 35 | FILES_${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 | ||
5 | LICENSE = "MIT" | 5 | LICENSE = "MIT" |
6 | 6 | ||
7 | SECONDARY_SERIAL_ID ?= "" | ||
8 | SOTA_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) |