summaryrefslogtreecommitdiffstats
path: root/recipes-test
diff options
context:
space:
mode:
Diffstat (limited to 'recipes-test')
-rw-r--r--recipes-test/demo-config/files/30-ostree-pacman.toml2
-rw-r--r--recipes-test/demo-config/files/30-pacman-config.toml2
-rw-r--r--recipes-test/demo-config/secondary-config.bb22
-rw-r--r--recipes-test/demo-config/shared-conf.inc4
-rw-r--r--recipes-test/demo-network-config/files/25-dhcp-server.network4
-rw-r--r--recipes-test/demo-network-config/primary-network-config.bb2
-rw-r--r--recipes-test/demo-network-config/secondary-network-config.bb4
7 files changed, 28 insertions, 12 deletions
diff --git a/recipes-test/demo-config/files/30-ostree-pacman.toml b/recipes-test/demo-config/files/30-ostree-pacman.toml
deleted file mode 100644
index d2cf5b8..0000000
--- a/recipes-test/demo-config/files/30-ostree-pacman.toml
+++ /dev/null
@@ -1,2 +0,0 @@
1[pacman]
2type = "ostree"
diff --git a/recipes-test/demo-config/files/30-pacman-config.toml b/recipes-test/demo-config/files/30-pacman-config.toml
new file mode 100644
index 0000000..750cf5c
--- /dev/null
+++ b/recipes-test/demo-config/files/30-pacman-config.toml
@@ -0,0 +1,2 @@
1[pacman]
2type = @UPDATE_TYPE@
diff --git a/recipes-test/demo-config/secondary-config.bb b/recipes-test/demo-config/secondary-config.bb
index 58b18df..638f0ae 100644
--- a/recipes-test/demo-config/secondary-config.bb
+++ b/recipes-test/demo-config/secondary-config.bb
@@ -10,16 +10,32 @@ PACKAGE_ARCH = "${MACHINE_ARCH}"
10SECONDARY_SERIAL_ID ?= "" 10SECONDARY_SERIAL_ID ?= ""
11SOTA_HARDWARE_ID ?= "${MACHINE}-sndry" 11SOTA_HARDWARE_ID ?= "${MACHINE}-sndry"
12SECONDARY_HARDWARE_ID ?= "${SOTA_HARDWARE_ID}" 12SECONDARY_HARDWARE_ID ?= "${SOTA_HARDWARE_ID}"
13SECONDARY_UPDATE_TYPE ?= "ostree"
14
15UPDATE_TYPE = "${SECONDARY_UPDATE_TYPE}"
16python () {
17 update_type = d.getVar('UPDATE_TYPE')
18 if update_type not in [ 'ostree', 'file']:
19 bb.fatal('Unsupported type of an update specified for secondary: SECONDARY_UPDATE_TYPE = {}\n'
20 'Supported update types are: ostree and file'
21 .format(update_type))
22
23 if update_type == 'file':
24 d.setVar('UPDATE_TYPE', 'none')
25}
13 26
14SRC_URI = "\ 27SRC_URI = "\
15 file://30-ostree-pacman.toml \ 28 file://30-pacman-config.toml \
16 file://35-network-config.toml \ 29 file://35-network-config.toml \
17 file://45-id-config.toml \ 30 file://45-id-config.toml \
18 " 31 "
19 32
33
20do_install () { 34do_install () {
21 install -m 0700 -d ${D}${libdir}/sota/conf.d 35 install -m 0700 -d ${D}${libdir}/sota/conf.d
22 install -m 0644 ${WORKDIR}/30-ostree-pacman.toml ${D}${libdir}/sota/conf.d/30-ostree-pacman.toml 36
37 install -m 0644 ${WORKDIR}/30-pacman-config.toml ${D}${libdir}/sota/conf.d/30-pacman-config.toml
38 sed -i -e 's|@UPDATE_TYPE@|${UPDATE_TYPE}|g' ${D}${libdir}/sota/conf.d/30-pacman-config.toml
23 39
24 install -m 0644 ${WORKDIR}/35-network-config.toml ${D}${libdir}/sota/conf.d/35-network-config.toml 40 install -m 0644 ${WORKDIR}/35-network-config.toml ${D}${libdir}/sota/conf.d/35-network-config.toml
25 sed -i -e 's|@PORT@|${SECONDARY_PORT}|g' \ 41 sed -i -e 's|@PORT@|${SECONDARY_PORT}|g' \
@@ -36,7 +52,7 @@ do_install () {
36 52
37FILES_${PN} = " \ 53FILES_${PN} = " \
38 ${libdir}/sota/conf.d \ 54 ${libdir}/sota/conf.d \
39 ${libdir}/sota/conf.d/30-ostree-pacman.toml \ 55 ${libdir}/sota/conf.d/30-pacman-config.toml \
40 ${libdir}/sota/conf.d/35-network-config.toml \ 56 ${libdir}/sota/conf.d/35-network-config.toml \
41 ${libdir}/sota/conf.d/45-id-config.toml \ 57 ${libdir}/sota/conf.d/45-id-config.toml \
42 " 58 "
diff --git a/recipes-test/demo-config/shared-conf.inc b/recipes-test/demo-config/shared-conf.inc
index c5ab598..5523406 100644
--- a/recipes-test/demo-config/shared-conf.inc
+++ b/recipes-test/demo-config/shared-conf.inc
@@ -1,5 +1,5 @@
1SECONDARY_IP ?= "10.0.3.2" 1SECONDARY_IP ?= "192.168.254.2"
2SECONDARY_PORT ?= "9050" 2SECONDARY_PORT ?= "9050"
3PRIMARY_IP ?= "10.0.3.1" 3PRIMARY_IP ?= "192.168.254.1"
4PRIMARY_PORT ?= "9040" 4PRIMARY_PORT ?= "9040"
5PRIMARY_WAIT_TIMEOUT ?= "240" 5PRIMARY_WAIT_TIMEOUT ?= "240"
diff --git a/recipes-test/demo-network-config/files/25-dhcp-server.network b/recipes-test/demo-network-config/files/25-dhcp-server.network
index 4766f9a..03bb302 100644
--- a/recipes-test/demo-network-config/files/25-dhcp-server.network
+++ b/recipes-test/demo-network-config/files/25-dhcp-server.network
@@ -4,9 +4,9 @@ Name=enp0s4
4[Network] 4[Network]
5Description=Private internal network between aktualizr Primary and Secondary nodes 5Description=Private internal network between aktualizr Primary and Secondary nodes
6DHCPServer=yes 6DHCPServer=yes
7Address=10.0.3.1/24 7Address=192.168.254.1/24
8IPForward=yes 8IPForward=yes
9IPMasquerade=yes 9IPMasquerade=yes
10 10
11[DHCPServer] 11[DHCPServer]
12PoolOffset=10 \ No newline at end of file 12PoolOffset=10
diff --git a/recipes-test/demo-network-config/primary-network-config.bb b/recipes-test/demo-network-config/primary-network-config.bb
index 544a5ec..7ee873f 100644
--- a/recipes-test/demo-network-config/primary-network-config.bb
+++ b/recipes-test/demo-network-config/primary-network-config.bb
@@ -15,7 +15,7 @@ do_install() {
15 install -m 0644 ${WORKDIR}/27-dhcp-client-external.network ${D}${libdir}/systemd/network/ 15 install -m 0644 ${WORKDIR}/27-dhcp-client-external.network ${D}${libdir}/systemd/network/
16} 16}
17 17
18PRIMARY_IP ?= "10.0.3.1" 18PRIMARY_IP ?= "192.168.254.1"
19 19
20IP_ADDR = "${PRIMARY_IP}" 20IP_ADDR = "${PRIMARY_IP}"
21CONF_TYPE ?= "${@ 'multihomed' if d.getVar('MACHINE') == 'raspberrypi3' and d.getVar('RPI_WIFI_ENABLE') != '1' else 'static'}" 21CONF_TYPE ?= "${@ 'multihomed' if d.getVar('MACHINE') == 'raspberrypi3' and d.getVar('RPI_WIFI_ENABLE') != '1' else 'static'}"
diff --git a/recipes-test/demo-network-config/secondary-network-config.bb b/recipes-test/demo-network-config/secondary-network-config.bb
index ca83d53..b268cd3 100644
--- a/recipes-test/demo-network-config/secondary-network-config.bb
+++ b/recipes-test/demo-network-config/secondary-network-config.bb
@@ -19,9 +19,9 @@ do_install() {
19 install -m 0644 ${WORKDIR}/27-dhcp-client-external.network ${D}${libdir}/systemd/network/ 19 install -m 0644 ${WORKDIR}/27-dhcp-client-external.network ${D}${libdir}/systemd/network/
20} 20}
21 21
22SECONDARY_IP ?= "10.0.3.2" 22SECONDARY_IP ?= "192.168.254.2"
23IP_ADDR = "${SECONDARY_IP}" 23IP_ADDR = "${SECONDARY_IP}"
24CONF_TYPE = "static" 24CONF_TYPE ?= "${@ 'multihomed' if d.getVar('MACHINE') == 'raspberrypi3' and d.getVar('RPI_WIFI_ENABLE') != '1' else 'static'}"
25 25
26require network-config.inc 26require network-config.inc
27 27