diff options
author | Mike Sul <ext-mykhaylo.sul@here.com> | 2019-05-21 08:04:44 +0300 |
---|---|---|
committer | Mike Sul <ext-mykhaylo.sul@here.com> | 2019-05-27 10:40:00 +0300 |
commit | d0b6547fde5038cb7ab9837681ea370af24de855 (patch) | |
tree | bbe7d483d6cb7e3804b1cd524b8d691ea02b29b4 /recipes-test/demo-secondary-config | |
parent | 753f664541c84f1977f370690e38d9130bf9e2f1 (diff) | |
download | meta-updater-d0b6547fde5038cb7ab9837681ea370af24de855.tar.gz |
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 <ext-mykhaylo.sul@here.com>
Diffstat (limited to 'recipes-test/demo-secondary-config')
3 files changed, 31 insertions, 2 deletions
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 @@ | |||
1 | [network] | ||
2 | port = @PORT@ | ||
3 | primary_ip = @PRIMARY_IP@ | ||
4 | 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 @@ | |||
1 | [uptane] | ||
2 | ecu_serial = @SERIAL@ | ||
3 | 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 @@ | |||
1 | DESCRIPTION = "Sample configuration for an Uptane Secondary" | 1 | DESCRIPTION = "Sample configuration for an Uptane Secondary" |
2 | LICENSE = "CLOSED" | 2 | LICENSE = "CLOSED" |
3 | 3 | ||
4 | inherit allarch | 4 | SECONDARY_SERIAL_ID ?= "" |
5 | SOTA_HARDWARE_ID ?= "${MACHINE}-sndry" | ||
6 | SECONDARY_HARDWARE_ID ?= "${SOTA_HARDWARE_ID}" | ||
7 | |||
8 | SECONDARY_PORT ?= "9050" | ||
9 | PRIMARY_IP ?= "10.0.3.1" | ||
10 | PRIMARY_PORT ?= "9040" | ||
5 | 11 | ||
6 | SRC_URI = "\ | 12 | SRC_URI = "\ |
7 | file://30-fake_pacman.toml \ | 13 | file://30-fake_pacman.toml \ |
14 | file://35-network_config.toml \ | ||
15 | file://45-id_config.toml \ | ||
8 | " | 16 | " |
9 | 17 | ||
10 | do_install () { | 18 | do_install () { |
11 | install -m 0700 -d ${D}${libdir}/sota/conf.d | 19 | install -m 0700 -d ${D}${libdir}/sota/conf.d |
12 | install -m 0644 ${WORKDIR}/30-fake_pacman.toml ${D}/${libdir}/sota/conf.d/30-fake_pacman.toml | 20 | install -m 0644 ${WORKDIR}/30-fake_pacman.toml ${D}/${libdir}/sota/conf.d/30-fake_pacman.toml |
21 | |||
22 | install -m 0644 ${WORKDIR}/35-network_config.toml ${D}/${libdir}/sota/conf.d/35-network_config.toml | ||
23 | sed -i -e 's|@PORT@|${SECONDARY_PORT}|g' \ | ||
24 | -e 's|@PRIMARY_IP@|${PRIMARY_IP}|g' \ | ||
25 | -e 's|@PRIMARY_PORT@|${PRIMARY_PORT}|g' \ | ||
26 | ${D}/${libdir}/sota/conf.d/35-network_config.toml | ||
27 | |||
28 | install -m 0644 ${WORKDIR}/45-id_config.toml ${D}/${libdir}/sota/conf.d/45-id_config.toml | ||
29 | sed -i -e 's|@SERIAL@|${SECONDARY_SERIAL_ID}|g' \ | ||
30 | -e 's|@HWID@|${SECONDARY_HARDWARE_ID}|g' \ | ||
31 | ${D}/${libdir}/sota/conf.d/45-id_config.toml | ||
32 | |||
13 | } | 33 | } |
14 | 34 | ||
15 | FILES_${PN} = " \ | 35 | FILES_${PN} = " \ |
16 | ${libdir}/sota/conf.d \ | 36 | ${libdir}/sota/conf.d \ |
17 | ${libdir}/sota/conf.d/30-fake_pacman.toml \ | 37 | ${libdir}/sota/conf.d/30-fake_pacman.toml \ |
38 | ${libdir}/sota/conf.d/35-network_config.toml \ | ||
39 | ${libdir}/sota/conf.d/45-id_config.toml \ | ||
18 | " | 40 | " |
19 | 41 | ||
20 | # vim:set ts=4 sw=4 sts=4 expandtab: | 42 | # vim:set ts=4 sw=4 sts=4 expandtab: |