From 6374bea5199b0ada3506d36a49c23b398261e9e0 Mon Sep 17 00:00:00 2001 From: Mike Sul Date: Thu, 16 May 2019 22:47:12 +0300 Subject: OTA-2541: Static IP address on Primary's and Secondary's internal NIC Signed-off-by: Mike Sul Signed-off-by: Patrick Vacek --- recipes-test/demo-network-config/primary-network-config.bb | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'recipes-test/demo-network-config/primary-network-config.bb') diff --git a/recipes-test/demo-network-config/primary-network-config.bb b/recipes-test/demo-network-config/primary-network-config.bb index 78678a2..ce19f07 100644 --- a/recipes-test/demo-network-config/primary-network-config.bb +++ b/recipes-test/demo-network-config/primary-network-config.bb @@ -3,8 +3,9 @@ LICENSE = "CLOSED" inherit allarch -SRC_URI = "file://25-dhcp-server.network" - +SRC_URI = "\ + file://27-dhcp-client-external.network \ + " FILES_${PN} = "/usr/lib/systemd/network" @@ -12,5 +13,11 @@ PR = "1" do_install() { install -d ${D}/usr/lib/systemd/network - install -m 0644 ${WORKDIR}/25-dhcp-server.network ${D}/usr/lib/systemd/network/ + install -m 0644 ${WORKDIR}/27-dhcp-client-external.network ${D}/usr/lib/systemd/network/ } + +SECONDARY_NETWORK_IP_ADDR ?= "10.0.3.1" + +require static-network-config.inc + +# vim:set ts=4 sw=4 sts=4 expandtab: -- cgit v1.2.3-54-g00ecf From 158fd8775df957147bfc3360d20055acb76f6f2a Mon Sep 17 00:00:00 2001 From: Mike Sul Date: Tue, 21 May 2019 08:04:44 +0300 Subject: 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 Signed-off-by: Patrick Vacek --- .../demo-network-config/primary-network-config.bb | 3 ++- .../secondary-network-config.bb | 3 ++- .../demo-network-config/static-network-config.inc | 6 ++--- .../files/35-network_config.toml | 4 ++++ .../demo-secondary-config/files/45-id_config.toml | 3 +++ .../demo-secondary-config/secondary-config.bb | 26 ++++++++++++++++++++-- recipes-test/images/secondary-image.bb | 2 ++ 7 files changed, 40 insertions(+), 7 deletions(-) create mode 100644 recipes-test/demo-secondary-config/files/35-network_config.toml create mode 100644 recipes-test/demo-secondary-config/files/45-id_config.toml (limited to 'recipes-test/demo-network-config/primary-network-config.bb') 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() { install -m 0644 ${WORKDIR}/27-dhcp-client-external.network ${D}/usr/lib/systemd/network/ } -SECONDARY_NETWORK_IP_ADDR ?= "10.0.3.1" +PRIMARY_IP ?= "10.0.3.1" +IP_ADDR = "${PRIMARY_IP}" require static-network-config.inc 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() { install -m 0644 ${WORKDIR}/27-dhcp-client-external.network ${D}/usr/lib/systemd/network/ } -SECONDARY_NETWORK_IP_ADDR ?= "10.0.3.2" +SECONDARY_IP ?= "10.0.3.2" +IP_ADDR = "${SECONDARY_IP}" require static-network-config.inc 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 = "\ file://26-static-client.network \ " -SECONDARY_NETWORK_INTERFACE_NAME ?= "enp0s5" +SECONDARY_INTERFACE ?= "enp0s5" do_install_append() { install -d ${D}/usr/lib/systemd/network install -m 0644 ${WORKDIR}/26-static-client.network ${D}/usr/lib/systemd/network/ - sed -i -e 's|@ADDR@|${SECONDARY_NETWORK_IP_ADDR}|g' \ - -e 's|@IFNAME@|${SECONDARY_NETWORK_INTERFACE_NAME}|g' \ + sed -i -e 's|@ADDR@|${IP_ADDR}|g' \ + -e 's|@IFNAME@|${SECONDARY_INTERFACE}|g' \ ${D}/usr/lib/systemd/network/26-static-client.network } 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 @@ +[network] +port = @PORT@ +primary_ip = @PRIMARY_IP@ +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 @@ +[uptane] +ecu_serial = @SERIAL@ +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 @@ DESCRIPTION = "Sample configuration for an Uptane Secondary" LICENSE = "CLOSED" -inherit allarch +SECONDARY_SERIAL_ID ?= "" +SOTA_HARDWARE_ID ?= "${MACHINE}-sndry" +SECONDARY_HARDWARE_ID ?= "${SOTA_HARDWARE_ID}" + +SECONDARY_PORT ?= "9050" +PRIMARY_IP ?= "10.0.3.1" +PRIMARY_PORT ?= "9040" SRC_URI = "\ file://30-fake_pacman.toml \ + file://35-network_config.toml \ + file://45-id_config.toml \ " do_install () { - install -m 0700 -d ${D}${libdir}/sota/conf.d + install -m 0700 -d ${D}${libdir}/sota/conf.d install -m 0644 ${WORKDIR}/30-fake_pacman.toml ${D}/${libdir}/sota/conf.d/30-fake_pacman.toml + + install -m 0644 ${WORKDIR}/35-network_config.toml ${D}/${libdir}/sota/conf.d/35-network_config.toml + sed -i -e 's|@PORT@|${SECONDARY_PORT}|g' \ + -e 's|@PRIMARY_IP@|${PRIMARY_IP}|g' \ + -e 's|@PRIMARY_PORT@|${PRIMARY_PORT}|g' \ + ${D}/${libdir}/sota/conf.d/35-network_config.toml + + install -m 0644 ${WORKDIR}/45-id_config.toml ${D}/${libdir}/sota/conf.d/45-id_config.toml + sed -i -e 's|@SERIAL@|${SECONDARY_SERIAL_ID}|g' \ + -e 's|@HWID@|${SECONDARY_HARDWARE_ID}|g' \ + ${D}/${libdir}/sota/conf.d/45-id_config.toml + } FILES_${PN} = " \ ${libdir}/sota/conf.d \ ${libdir}/sota/conf.d/30-fake_pacman.toml \ + ${libdir}/sota/conf.d/35-network_config.toml \ + ${libdir}/sota/conf.d/45-id_config.toml \ " # 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" LICENSE = "MIT" +SECONDARY_SERIAL_ID ?= "" +SOTA_HARDWARE_ID ?= "${MACHINE}-sndry" # Remove default aktualizr primary, and the provisioning configuration (which # RDEPENDS on aktualizr) -- cgit v1.2.3-54-g00ecf From 8f850df2834a8fea1936d38fc1b3787aef0bca46 Mon Sep 17 00:00:00 2001 From: Mike Sul Date: Tue, 21 May 2019 19:03:36 +0300 Subject: OTA-2541: Use MPL-2.0 license for recipes-test's recipes Signed-off-by: Mike Sul Signed-off-by: Patrick Vacek --- recipes-test/big-update/big-update_1.0.bb | 2 +- recipes-test/big-update/big-update_2.0.bb | 2 +- recipes-test/demo-network-config/primary-network-config.bb | 3 ++- recipes-test/demo-network-config/secondary-network-config.bb | 3 ++- recipes-test/demo-secondary-config/secondary-config.bb | 3 ++- recipes-test/images/primary-image.bb | 2 +- recipes-test/images/secondary-image.bb | 2 +- 7 files changed, 10 insertions(+), 7 deletions(-) (limited to 'recipes-test/demo-network-config/primary-network-config.bb') 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 @@ DESCRIPTION = "Example Package with 10MB of random, seeded content" -LICENSE = "CLOSED" +LICENSE = "MPL-2.0" SRC_URI = "file://rand_file.py" 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 @@ DESCRIPTION = "Example Package with 12MB of random, seeded content" -LICENSE = "CLOSED" +LICENSE = "MPL-2.0" SRC_URI = "file://rand_file.py" diff --git a/recipes-test/demo-network-config/primary-network-config.bb b/recipes-test/demo-network-config/primary-network-config.bb index 9725898..c7daa15 100644 --- a/recipes-test/demo-network-config/primary-network-config.bb +++ b/recipes-test/demo-network-config/primary-network-config.bb @@ -1,5 +1,6 @@ DESCRIPTION = "Sample network configuration for an Uptane Primary" -LICENSE = "CLOSED" +LICENSE = "MPL-2.0" +LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MPL-2.0;md5=815ca599c9df247a0c7f619bab123dad" inherit allarch diff --git a/recipes-test/demo-network-config/secondary-network-config.bb b/recipes-test/demo-network-config/secondary-network-config.bb index e33229d..c70d88a 100644 --- a/recipes-test/demo-network-config/secondary-network-config.bb +++ b/recipes-test/demo-network-config/secondary-network-config.bb @@ -1,5 +1,6 @@ DESCRIPTION = "Sample network configuration for an Uptane Secondary" -LICENSE = "CLOSED" +LICENSE = "MPL-2.0" +LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MPL-2.0;md5=815ca599c9df247a0c7f619bab123dad" inherit allarch diff --git a/recipes-test/demo-secondary-config/secondary-config.bb b/recipes-test/demo-secondary-config/secondary-config.bb index b05ab8e..25972d4 100644 --- a/recipes-test/demo-secondary-config/secondary-config.bb +++ b/recipes-test/demo-secondary-config/secondary-config.bb @@ -1,5 +1,6 @@ DESCRIPTION = "Sample configuration for an Uptane Secondary" -LICENSE = "CLOSED" +LICENSE = "MPL-2.0" +LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MPL-2.0;md5=815ca599c9df247a0c7f619bab123dad" SECONDARY_SERIAL_ID ?= "" SOTA_HARDWARE_ID ?= "${MACHINE}-sndry" diff --git a/recipes-test/images/primary-image.bb b/recipes-test/images/primary-image.bb index ac14233..935f7ac 100644 --- a/recipes-test/images/primary-image.bb +++ b/recipes-test/images/primary-image.bb @@ -2,7 +2,7 @@ include recipes-core/images/core-image-minimal.bb SUMMARY = "A minimal Uptane Primary image running aktualizr, for testing with a Linux secondary" -LICENSE = "MIT" +LICENSE = "MPL-2.0" IMAGE_INSTALL_remove = " \ virtual/network-configuration \ diff --git a/recipes-test/images/secondary-image.bb b/recipes-test/images/secondary-image.bb index a688bbd..4cae874 100644 --- a/recipes-test/images/secondary-image.bb +++ b/recipes-test/images/secondary-image.bb @@ -2,7 +2,7 @@ include recipes-core/images/core-image-minimal.bb SUMMARY = "A minimal Uptane Secondary image running aktualizr-secondary" -LICENSE = "MIT" +LICENSE = "MPL-2.0" SECONDARY_SERIAL_ID ?= "" SOTA_HARDWARE_ID ?= "${MACHINE}-sndry" -- cgit v1.2.3-54-g00ecf