diff options
Diffstat (limited to 'external/meta-updater/recipes-test/demo-config')
5 files changed, 33 insertions, 11 deletions
diff --git a/external/meta-updater/recipes-test/demo-config/files/30-fake-pacman.toml b/external/meta-updater/recipes-test/demo-config/files/30-fake-pacman.toml deleted file mode 100644 index 3fb5cf2c..00000000 --- a/external/meta-updater/recipes-test/demo-config/files/30-fake-pacman.toml +++ /dev/null @@ -1,2 +0,0 @@ -[pacman] -type = "fake" diff --git a/external/meta-updater/recipes-test/demo-config/files/30-pacman-config.toml b/external/meta-updater/recipes-test/demo-config/files/30-pacman-config.toml new file mode 100644 index 00000000..750cf5c7 --- /dev/null +++ b/external/meta-updater/recipes-test/demo-config/files/30-pacman-config.toml @@ -0,0 +1,2 @@ +[pacman] +type = @UPDATE_TYPE@ diff --git a/external/meta-updater/recipes-test/demo-config/primary-config.bb b/external/meta-updater/recipes-test/demo-config/primary-config.bb index 27cb553e..5c8abb54 100644 --- a/external/meta-updater/recipes-test/demo-config/primary-config.bb +++ b/external/meta-updater/recipes-test/demo-config/primary-config.bb @@ -4,11 +4,14 @@ LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MPL-2.0;md5=815ca599c9df247a0c7 require shared-conf.inc +inherit allarch + PRIMARY_SECONDARIES ?= "${SECONDARY_IP}:${SECONDARY_PORT}" SRC_URI = "\ file://30-secondary-config.toml \ file://ip_secondary_config.json \ + ${@('file://' + d.getVar('SOTA_SECONDARY_CONFIG')) if d.getVar('SOTA_SECONDARY_CONFIG') else ''} \ " def get_secondary_addrs(d): diff --git a/external/meta-updater/recipes-test/demo-config/secondary-config.bb b/external/meta-updater/recipes-test/demo-config/secondary-config.bb index 9411646b..638f0aea 100644 --- a/external/meta-updater/recipes-test/demo-config/secondary-config.bb +++ b/external/meta-updater/recipes-test/demo-config/secondary-config.bb @@ -4,36 +4,55 @@ LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MPL-2.0;md5=815ca599c9df247a0c7 require shared-conf.inc +# Because of the dependency on MACHINE. +PACKAGE_ARCH = "${MACHINE_ARCH}" + SECONDARY_SERIAL_ID ?= "" SOTA_HARDWARE_ID ?= "${MACHINE}-sndry" SECONDARY_HARDWARE_ID ?= "${SOTA_HARDWARE_ID}" +SECONDARY_UPDATE_TYPE ?= "ostree" + +UPDATE_TYPE = "${SECONDARY_UPDATE_TYPE}" +python () { + update_type = d.getVar('UPDATE_TYPE') + if update_type not in [ 'ostree', 'file']: + bb.fatal('Unsupported type of an update specified for secondary: SECONDARY_UPDATE_TYPE = {}\n' + 'Supported update types are: ostree and file' + .format(update_type)) + + if update_type == 'file': + d.setVar('UPDATE_TYPE', 'none') +} SRC_URI = "\ - file://30-fake-pacman.toml \ + file://30-pacman-config.toml \ file://35-network-config.toml \ file://45-id-config.toml \ " + do_install () { 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 + install -m 0644 ${WORKDIR}/30-pacman-config.toml ${D}${libdir}/sota/conf.d/30-pacman-config.toml + sed -i -e 's|@UPDATE_TYPE@|${UPDATE_TYPE}|g' ${D}${libdir}/sota/conf.d/30-pacman-config.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 + ${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 + 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 + ${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/30-pacman-config.toml \ ${libdir}/sota/conf.d/35-network-config.toml \ ${libdir}/sota/conf.d/45-id-config.toml \ " diff --git a/external/meta-updater/recipes-test/demo-config/shared-conf.inc b/external/meta-updater/recipes-test/demo-config/shared-conf.inc index c5ab5987..55234068 100644 --- a/external/meta-updater/recipes-test/demo-config/shared-conf.inc +++ b/external/meta-updater/recipes-test/demo-config/shared-conf.inc @@ -1,5 +1,5 @@ -SECONDARY_IP ?= "10.0.3.2" +SECONDARY_IP ?= "192.168.254.2" SECONDARY_PORT ?= "9050" -PRIMARY_IP ?= "10.0.3.1" +PRIMARY_IP ?= "192.168.254.1" PRIMARY_PORT ?= "9040" PRIMARY_WAIT_TIMEOUT ?= "240" |