diff options
author | Mykhaylo Sul <ext-mykhaylo.sul@here.com> | 2020-02-05 12:58:57 +0100 |
---|---|---|
committer | Patrick Vacek <patrickvacek@gmail.com> | 2020-02-28 13:42:47 +0100 |
commit | 10fbeb709344f295f3780fafcc15f4b31b79dfe5 (patch) | |
tree | cde2c2fc571e0531c8e3778852617a3e85058ebb /recipes-test/demo-config | |
parent | 00c3c2a1220cbea3dc07a603cac25dfd63acabc8 (diff) | |
download | meta-updater-10fbeb709344f295f3780fafcc15f4b31b79dfe5.tar.gz |
OTA-4388: Conf variable to specify an update type for secondary
Signed-off-by: Mykhaylo Sul <ext-mykhaylo.sul@here.com>
Diffstat (limited to 'recipes-test/demo-config')
-rw-r--r-- | recipes-test/demo-config/files/30-ostree-pacman.toml | 2 | ||||
-rw-r--r-- | recipes-test/demo-config/files/30-pacman-config.toml | 2 | ||||
-rw-r--r-- | recipes-test/demo-config/secondary-config.bb | 22 |
3 files changed, 21 insertions, 5 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] | ||
2 | type = "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] | ||
2 | type = @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}" | |||
10 | SECONDARY_SERIAL_ID ?= "" | 10 | SECONDARY_SERIAL_ID ?= "" |
11 | SOTA_HARDWARE_ID ?= "${MACHINE}-sndry" | 11 | SOTA_HARDWARE_ID ?= "${MACHINE}-sndry" |
12 | SECONDARY_HARDWARE_ID ?= "${SOTA_HARDWARE_ID}" | 12 | SECONDARY_HARDWARE_ID ?= "${SOTA_HARDWARE_ID}" |
13 | SECONDARY_UPDATE_TYPE ?= "ostree" | ||
14 | |||
15 | UPDATE_TYPE = "${SECONDARY_UPDATE_TYPE}" | ||
16 | python () { | ||
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 | ||
14 | SRC_URI = "\ | 27 | SRC_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 | |||
20 | do_install () { | 34 | do_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 | ||
37 | FILES_${PN} = " \ | 53 | FILES_${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 | " |