diff options
Diffstat (limited to 'recipes-test/demo-network-config')
4 files changed, 49 insertions, 8 deletions
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: | ||