diff options
Diffstat (limited to 'recipes-test')
-rw-r--r-- | recipes-test/big-update/big-update_1.0.bb | 2 | ||||
-rw-r--r-- | recipes-test/big-update/big-update_2.0.bb | 2 | ||||
-rw-r--r-- | recipes-test/demo-config/files/30-fake-pacman.toml | 2 | ||||
-rw-r--r-- | recipes-test/demo-config/files/30-secondary-config.toml | 2 | ||||
-rw-r--r-- | recipes-test/demo-config/files/35-network-config.toml | 4 | ||||
-rw-r--r-- | recipes-test/demo-config/files/45-id-config.toml | 3 | ||||
-rw-r--r-- | recipes-test/demo-config/files/ip_secondary_config.json | 7 | ||||
-rw-r--r-- | recipes-test/demo-config/primary-config.bb | 68 | ||||
-rw-r--r-- | recipes-test/demo-config/secondary-config.bb | 41 | ||||
-rw-r--r-- | recipes-test/demo-config/shared-conf.inc | 5 | ||||
-rw-r--r-- | recipes-test/demo-network-config/files/26-static-client.network | 7 | ||||
-rw-r--r-- | recipes-test/demo-network-config/primary-network-config.bb | 17 | ||||
-rw-r--r-- | recipes-test/demo-network-config/secondary-network-config.bb | 17 | ||||
-rw-r--r-- | recipes-test/demo-network-config/static-network-config.inc | 16 | ||||
-rw-r--r-- | recipes-test/images/primary-image.bb | 6 | ||||
-rw-r--r-- | recipes-test/images/secondary-image.bb | 15 |
16 files changed, 196 insertions, 18 deletions
diff --git a/recipes-test/big-update/big-update_1.0.bb b/recipes-test/big-update/big-update_1.0.bb index 68b9746..3b1d652 100644 --- a/recipes-test/big-update/big-update_1.0.bb +++ b/recipes-test/big-update/big-update_1.0.bb | |||
@@ -1,5 +1,5 @@ | |||
1 | DESCRIPTION = "Example Package with 10MB of random, seeded content" | 1 | DESCRIPTION = "Example Package with 10MB of random, seeded content" |
2 | LICENSE = "CLOSED" | 2 | LICENSE = "MPL-2.0" |
3 | 3 | ||
4 | SRC_URI = "file://rand_file.py" | 4 | SRC_URI = "file://rand_file.py" |
5 | 5 | ||
diff --git a/recipes-test/big-update/big-update_2.0.bb b/recipes-test/big-update/big-update_2.0.bb index 20c8138..7cb6e94 100644 --- a/recipes-test/big-update/big-update_2.0.bb +++ b/recipes-test/big-update/big-update_2.0.bb | |||
@@ -1,5 +1,5 @@ | |||
1 | DESCRIPTION = "Example Package with 12MB of random, seeded content" | 1 | DESCRIPTION = "Example Package with 12MB of random, seeded content" |
2 | LICENSE = "CLOSED" | 2 | LICENSE = "MPL-2.0" |
3 | 3 | ||
4 | SRC_URI = "file://rand_file.py" | 4 | SRC_URI = "file://rand_file.py" |
5 | 5 | ||
diff --git a/recipes-test/demo-config/files/30-fake-pacman.toml b/recipes-test/demo-config/files/30-fake-pacman.toml new file mode 100644 index 0000000..3fb5cf2 --- /dev/null +++ b/recipes-test/demo-config/files/30-fake-pacman.toml | |||
@@ -0,0 +1,2 @@ | |||
1 | [pacman] | ||
2 | type = "fake" | ||
diff --git a/recipes-test/demo-config/files/30-secondary-config.toml b/recipes-test/demo-config/files/30-secondary-config.toml new file mode 100644 index 0000000..7714240 --- /dev/null +++ b/recipes-test/demo-config/files/30-secondary-config.toml | |||
@@ -0,0 +1,2 @@ | |||
1 | [uptane] | ||
2 | secondary_config_file = "@CFG_FILEPATH@" | ||
diff --git a/recipes-test/demo-config/files/35-network-config.toml b/recipes-test/demo-config/files/35-network-config.toml new file mode 100644 index 0000000..db7a1bb --- /dev/null +++ b/recipes-test/demo-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-config/files/45-id-config.toml b/recipes-test/demo-config/files/45-id-config.toml new file mode 100644 index 0000000..6cbd77f --- /dev/null +++ b/recipes-test/demo-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-config/files/ip_secondary_config.json b/recipes-test/demo-config/files/ip_secondary_config.json new file mode 100644 index 0000000..690cf2e --- /dev/null +++ b/recipes-test/demo-config/files/ip_secondary_config.json | |||
@@ -0,0 +1,7 @@ | |||
1 | { | ||
2 | "IP": { | ||
3 | "secondaries_wait_port": @PORT@, | ||
4 | "secondaries_wait_timeout": @TIMEOUT@, | ||
5 | "secondaries": @ADDR_ARRAY@ | ||
6 | } | ||
7 | } | ||
diff --git a/recipes-test/demo-config/primary-config.bb b/recipes-test/demo-config/primary-config.bb new file mode 100644 index 0000000..27cb553 --- /dev/null +++ b/recipes-test/demo-config/primary-config.bb | |||
@@ -0,0 +1,68 @@ | |||
1 | DESCRIPTION = "Sample configuration for an Uptane Primary to support IP/Posix Secondary" | ||
2 | LICENSE = "MPL-2.0" | ||
3 | LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MPL-2.0;md5=815ca599c9df247a0c7f619bab123dad" | ||
4 | |||
5 | require shared-conf.inc | ||
6 | |||
7 | PRIMARY_SECONDARIES ?= "${SECONDARY_IP}:${SECONDARY_PORT}" | ||
8 | |||
9 | SRC_URI = "\ | ||
10 | file://30-secondary-config.toml \ | ||
11 | file://ip_secondary_config.json \ | ||
12 | " | ||
13 | |||
14 | def get_secondary_addrs(d): | ||
15 | import json | ||
16 | |||
17 | secondaries = d.getVar('PRIMARY_SECONDARIES') | ||
18 | sec_array = [] | ||
19 | for secondary in secondaries.split(): | ||
20 | sec_array.append({"addr": secondary}) | ||
21 | |||
22 | return json.dumps(sec_array) | ||
23 | |||
24 | do_install () { | ||
25 | |||
26 | if [ ! -n "${SOTA_SECONDARY_CONFIG}" ]; then | ||
27 | bbwarn "SOTA_SECONDARY_CONFIG hasn't been specified in the local config, generate a default one" | ||
28 | |||
29 | IP_SECONDARY_CONFIG_FILE=${WORKDIR}/ip_secondary_config.json | ||
30 | IP_SECONDARY_ADDRS='${@get_secondary_addrs(d)}' | ||
31 | else | ||
32 | bbwarn "SOTA_SECONDARY_CONFIG has been specified in the local config: ${SOTA_SECONDARY_CONFIG}" | ||
33 | |||
34 | IP_SECONDARY_CONFIG_FILE=${SOTA_SECONDARY_CONFIG} | ||
35 | fi | ||
36 | |||
37 | if [ ! -f $IP_SECONDARY_CONFIG_FILE ]; then | ||
38 | bbfatal "Secondary config file does not exist: $IP_SECONDARY_CONFIG_FILE" | ||
39 | fi | ||
40 | |||
41 | SECONDARY_CONFIG_DEST_DIR="${D}${sysconfdir}/sota/ecus" | ||
42 | SECONDARY_CONFIG_DEST_FILEPATH=$SECONDARY_CONFIG_DEST_DIR/$(basename -- $IP_SECONDARY_CONFIG_FILE) | ||
43 | SECONDARY_CONFIG_FILEPATH_ON_IMAGE="${sysconfdir}/sota/ecus/$(basename -- $IP_SECONDARY_CONFIG_FILE)" | ||
44 | |||
45 | # install the secondary configuration file (json) | ||
46 | install -m 0700 -d $SECONDARY_CONFIG_DEST_DIR | ||
47 | install -m 0644 $IP_SECONDARY_CONFIG_FILE $SECONDARY_CONFIG_DEST_DIR | ||
48 | |||
49 | # if SOTA_SECONDARY_CONFIG/secondary config file is not defined in the local conf | ||
50 | # then a default template is used and filled with corresponding configuration variable values | ||
51 | if [ ! -n "${SOTA_SECONDARY_CONFIG}" ]; then | ||
52 | sed -i -e "s|@PORT@|${PRIMARY_PORT}|g" \ | ||
53 | -e "s|@TIMEOUT@|${PRIMARY_WAIT_TIMEOUT}|g" \ | ||
54 | -e "s|@ADDR_ARRAY@|$IP_SECONDARY_ADDRS|g" $SECONDARY_CONFIG_DEST_FILEPATH | ||
55 | fi | ||
56 | |||
57 | # install aktualizr config file (toml) that points to the secondary config file, so aktualizr is aware about it | ||
58 | install -m 0700 -d ${D}${libdir}/sota/conf.d | ||
59 | install -m 0644 ${WORKDIR}/30-secondary-config.toml ${D}${libdir}/sota/conf.d | ||
60 | sed -i "s|@CFG_FILEPATH@|$SECONDARY_CONFIG_FILEPATH_ON_IMAGE|g" ${D}${libdir}/sota/conf.d/30-secondary-config.toml | ||
61 | } | ||
62 | |||
63 | FILES_${PN} = " \ | ||
64 | ${libdir}/sota/conf.d/* \ | ||
65 | ${sysconfdir}/sota/ecus/* \ | ||
66 | " | ||
67 | |||
68 | # vim:set ts=4 sw=4 sts=4 expandtab: | ||
diff --git a/recipes-test/demo-config/secondary-config.bb b/recipes-test/demo-config/secondary-config.bb new file mode 100644 index 0000000..9411646 --- /dev/null +++ b/recipes-test/demo-config/secondary-config.bb | |||
@@ -0,0 +1,41 @@ | |||
1 | DESCRIPTION = "Sample configuration for an Uptane Secondary" | ||
2 | LICENSE = "MPL-2.0" | ||
3 | LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MPL-2.0;md5=815ca599c9df247a0c7f619bab123dad" | ||
4 | |||
5 | require shared-conf.inc | ||
6 | |||
7 | SECONDARY_SERIAL_ID ?= "" | ||
8 | SOTA_HARDWARE_ID ?= "${MACHINE}-sndry" | ||
9 | SECONDARY_HARDWARE_ID ?= "${SOTA_HARDWARE_ID}" | ||
10 | |||
11 | SRC_URI = "\ | ||
12 | file://30-fake-pacman.toml \ | ||
13 | file://35-network-config.toml \ | ||
14 | file://45-id-config.toml \ | ||
15 | " | ||
16 | |||
17 | do_install () { | ||
18 | install -m 0700 -d ${D}${libdir}/sota/conf.d | ||
19 | install -m 0644 ${WORKDIR}/30-fake-pacman.toml ${D}/${libdir}/sota/conf.d/30-fake-pacman.toml | ||
20 | |||
21 | install -m 0644 ${WORKDIR}/35-network-config.toml ${D}/${libdir}/sota/conf.d/35-network-config.toml | ||
22 | sed -i -e 's|@PORT@|${SECONDARY_PORT}|g' \ | ||
23 | -e 's|@PRIMARY_IP@|${PRIMARY_IP}|g' \ | ||
24 | -e 's|@PRIMARY_PORT@|${PRIMARY_PORT}|g' \ | ||
25 | ${D}/${libdir}/sota/conf.d/35-network-config.toml | ||
26 | |||
27 | install -m 0644 ${WORKDIR}/45-id-config.toml ${D}/${libdir}/sota/conf.d/45-id-config.toml | ||
28 | sed -i -e 's|@SERIAL@|${SECONDARY_SERIAL_ID}|g' \ | ||
29 | -e 's|@HWID@|${SECONDARY_HARDWARE_ID}|g' \ | ||
30 | ${D}/${libdir}/sota/conf.d/45-id-config.toml | ||
31 | |||
32 | } | ||
33 | |||
34 | FILES_${PN} = " \ | ||
35 | ${libdir}/sota/conf.d \ | ||
36 | ${libdir}/sota/conf.d/30-fake-pacman.toml \ | ||
37 | ${libdir}/sota/conf.d/35-network-config.toml \ | ||
38 | ${libdir}/sota/conf.d/45-id-config.toml \ | ||
39 | " | ||
40 | |||
41 | # vim:set ts=4 sw=4 sts=4 expandtab: | ||
diff --git a/recipes-test/demo-config/shared-conf.inc b/recipes-test/demo-config/shared-conf.inc new file mode 100644 index 0000000..ce2bb44 --- /dev/null +++ b/recipes-test/demo-config/shared-conf.inc | |||
@@ -0,0 +1,5 @@ | |||
1 | SECONDARY_IP ?= "10.0.3.2" | ||
2 | SECONDARY_PORT ?= "9050" | ||
3 | PRIMARY_IP ?= "10.0.3.1" | ||
4 | PRIMARY_PORT ?= "9040" | ||
5 | PRIMARY_WAIT_TIMEOUT ?= "120" | ||
diff --git a/recipes-test/demo-network-config/files/26-static-client.network b/recipes-test/demo-network-config/files/26-static-client.network new file mode 100644 index 0000000..19a6b83 --- /dev/null +++ b/recipes-test/demo-network-config/files/26-static-client.network | |||
@@ -0,0 +1,7 @@ | |||
1 | [Match] | ||
2 | Name=@IFNAME@ | ||
3 | |||
4 | [Network] | ||
5 | Description=Private internal network between aktualizr Primary and Secondary nodes | ||
6 | Address=@ADDR@ | ||
7 | DHCP=no | ||
diff --git a/recipes-test/demo-network-config/primary-network-config.bb b/recipes-test/demo-network-config/primary-network-config.bb index 78678a2..c7daa15 100644 --- a/recipes-test/demo-network-config/primary-network-config.bb +++ b/recipes-test/demo-network-config/primary-network-config.bb | |||
@@ -1,10 +1,12 @@ | |||
1 | DESCRIPTION = "Sample network configuration for an Uptane Primary" | 1 | DESCRIPTION = "Sample network configuration for an Uptane Primary" |
2 | LICENSE = "CLOSED" | 2 | LICENSE = "MPL-2.0" |
3 | LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MPL-2.0;md5=815ca599c9df247a0c7f619bab123dad" | ||
3 | 4 | ||
4 | inherit allarch | 5 | inherit allarch |
5 | 6 | ||
6 | SRC_URI = "file://25-dhcp-server.network" | 7 | SRC_URI = "\ |
7 | 8 | file://27-dhcp-client-external.network \ | |
9 | " | ||
8 | 10 | ||
9 | FILES_${PN} = "/usr/lib/systemd/network" | 11 | FILES_${PN} = "/usr/lib/systemd/network" |
10 | 12 | ||
@@ -12,5 +14,12 @@ PR = "1" | |||
12 | 14 | ||
13 | do_install() { | 15 | do_install() { |
14 | install -d ${D}/usr/lib/systemd/network | 16 | install -d ${D}/usr/lib/systemd/network |
15 | install -m 0644 ${WORKDIR}/25-dhcp-server.network ${D}/usr/lib/systemd/network/ | 17 | install -m 0644 ${WORKDIR}/27-dhcp-client-external.network ${D}/usr/lib/systemd/network/ |
16 | } | 18 | } |
19 | |||
20 | PRIMARY_IP ?= "10.0.3.1" | ||
21 | IP_ADDR = "${PRIMARY_IP}" | ||
22 | |||
23 | require static-network-config.inc | ||
24 | |||
25 | # vim:set ts=4 sw=4 sts=4 expandtab: | ||
diff --git a/recipes-test/demo-network-config/secondary-network-config.bb b/recipes-test/demo-network-config/secondary-network-config.bb index 9091c65..c70d88a 100644 --- a/recipes-test/demo-network-config/secondary-network-config.bb +++ b/recipes-test/demo-network-config/secondary-network-config.bb | |||
@@ -1,20 +1,29 @@ | |||
1 | DESCRIPTION = "Sample network configuration for an Uptane Secondary" | 1 | DESCRIPTION = "Sample network configuration for an Uptane Secondary" |
2 | LICENSE = "CLOSED" | 2 | LICENSE = "MPL-2.0" |
3 | LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MPL-2.0;md5=815ca599c9df247a0c7f619bab123dad" | ||
3 | 4 | ||
4 | inherit allarch | 5 | inherit allarch |
5 | 6 | ||
7 | # TODO: It configures the 'user' interface in NAT mode and provides an access to public Inet via it | ||
8 | # which is not desired for Secondary. It cannot be just removed since we get SSH access to Secondary | ||
9 | # VM via this interface. So, the task is to configure the interface in such way that it does provide access | ||
10 | # via SSH from a host machine and forbids an access to Inet | ||
6 | SRC_URI = "\ | 11 | SRC_URI = "\ |
7 | file://26-dhcp-client.network \ | ||
8 | file://27-dhcp-client-external.network \ | 12 | file://27-dhcp-client-external.network \ |
9 | " | 13 | " |
10 | 14 | ||
11 | |||
12 | FILES_${PN} = "/usr/lib/systemd/network" | 15 | FILES_${PN} = "/usr/lib/systemd/network" |
13 | 16 | ||
14 | PR = "1" | 17 | PR = "1" |
15 | 18 | ||
16 | do_install() { | 19 | do_install() { |
17 | install -d ${D}/usr/lib/systemd/network | 20 | install -d ${D}/usr/lib/systemd/network |
18 | install -m 0644 ${WORKDIR}/26-dhcp-client.network ${D}/usr/lib/systemd/network/ | ||
19 | install -m 0644 ${WORKDIR}/27-dhcp-client-external.network ${D}/usr/lib/systemd/network/ | 21 | install -m 0644 ${WORKDIR}/27-dhcp-client-external.network ${D}/usr/lib/systemd/network/ |
20 | } | 22 | } |
23 | |||
24 | SECONDARY_IP ?= "10.0.3.2" | ||
25 | IP_ADDR = "${SECONDARY_IP}" | ||
26 | |||
27 | require static-network-config.inc | ||
28 | |||
29 | # vim:set ts=4 sw=4 sts=4 expandtab: | ||
diff --git a/recipes-test/demo-network-config/static-network-config.inc b/recipes-test/demo-network-config/static-network-config.inc new file mode 100644 index 0000000..e64675e --- /dev/null +++ b/recipes-test/demo-network-config/static-network-config.inc | |||
@@ -0,0 +1,16 @@ | |||
1 | SRC_URI_append = "\ | ||
2 | file://26-static-client.network \ | ||
3 | " | ||
4 | |||
5 | SECONDARY_INTERFACE ?= "enp0s5" | ||
6 | |||
7 | do_install_append() { | ||
8 | install -d ${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@|${IP_ADDR}|g' \ | ||
11 | -e 's|@IFNAME@|${SECONDARY_INTERFACE}|g' \ | ||
12 | ${D}/usr/lib/systemd/network/26-static-client.network | ||
13 | |||
14 | } | ||
15 | |||
16 | # vim:set ts=4 sw=4 sts=4 expandtab: | ||
diff --git a/recipes-test/images/primary-image.bb b/recipes-test/images/primary-image.bb index 6d2df94..ba1dc1f 100644 --- a/recipes-test/images/primary-image.bb +++ b/recipes-test/images/primary-image.bb | |||
@@ -2,13 +2,15 @@ include recipes-core/images/core-image-minimal.bb | |||
2 | 2 | ||
3 | SUMMARY = "A minimal Uptane Primary image running aktualizr, for testing with a Linux secondary" | 3 | SUMMARY = "A minimal Uptane Primary image running aktualizr, for testing with a Linux secondary" |
4 | 4 | ||
5 | LICENSE = "MIT" | 5 | LICENSE = "MPL-2.0" |
6 | 6 | ||
7 | IMAGE_INSTALL_remove = " \ | 7 | IMAGE_INSTALL_remove = " \ |
8 | virtual/network-configuration \ | ||
8 | " | 9 | " |
9 | 10 | ||
10 | IMAGE_INSTALL_append = " \ | 11 | IMAGE_INSTALL_append = " \ |
11 | primary-network-config \ | 12 | primary-network-config \ |
13 | primary-config \ | ||
12 | " | 14 | " |
13 | 15 | ||
14 | # vim:set ts=4 sw=4 sts=4 expandtab: | 16 | # 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 61df85b..27d1e3f 100644 --- a/recipes-test/images/secondary-image.bb +++ b/recipes-test/images/secondary-image.bb | |||
@@ -2,18 +2,20 @@ include recipes-core/images/core-image-minimal.bb | |||
2 | 2 | ||
3 | SUMMARY = "A minimal Uptane Secondary image running aktualizr-secondary" | 3 | SUMMARY = "A minimal Uptane Secondary image running aktualizr-secondary" |
4 | 4 | ||
5 | LICENSE = "MIT" | 5 | LICENSE = "MPL-2.0" |
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) |
10 | IMAGE_INSTALL_remove = " \ | 12 | IMAGE_INSTALL_remove = " \ |
11 | aktualizr \ | 13 | aktualizr \ |
12 | aktualizr-auto-prov \ | 14 | aktualizr-shared-prov \ |
13 | aktualizr-auto-prov-creds \ | 15 | aktualizr-shared-prov-creds \ |
14 | aktualizr-ca-implicit-prov \ | 16 | aktualizr-device-prov \ |
15 | aktualizr-ca-implicit-prov-creds \ | 17 | aktualizr-device-prov-creds \ |
16 | aktualizr-hsm-prov \ | 18 | aktualizr-device-prov-hsm \ |
17 | aktualizr-uboot-env-rollback \ | 19 | aktualizr-uboot-env-rollback \ |
18 | virtual/network-configuration \ | 20 | virtual/network-configuration \ |
19 | " | 21 | " |
@@ -21,6 +23,7 @@ IMAGE_INSTALL_remove = " \ | |||
21 | IMAGE_INSTALL_append = " \ | 23 | IMAGE_INSTALL_append = " \ |
22 | aktualizr-secondary \ | 24 | aktualizr-secondary \ |
23 | secondary-network-config \ | 25 | secondary-network-config \ |
26 | secondary-config \ | ||
24 | " | 27 | " |
25 | 28 | ||
26 | # vim:set ts=4 sw=4 sts=4 expandtab: | 29 | # vim:set ts=4 sw=4 sts=4 expandtab: |