summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPatrick Vacek <patrickvacek@gmail.com>2020-01-23 16:23:48 +0100
committerGitHub <noreply@github.com>2020-01-23 16:23:48 +0100
commite81f2e7d2a74fe27a0840aacfcfe547acbdcac0c (patch)
tree2b8e320a4149aa145eb0b75917fbdc74ac92c2fb
parenta6ef1ed2784fde198baef0e6b12e4b0d86e8bb66 (diff)
parent19ff287e7b6764af2f0af29cb5bac9433fc5862d (diff)
downloadmeta-updater-e81f2e7d2a74fe27a0840aacfcfe547acbdcac0c.tar.gz
Merge pull request #663 from advancedtelematic/feat/zeus/2020.1
Feat/zeus/2020.1
-rw-r--r--.gitlab-ci.yml13
-rw-r--r--README.adoc2
-rw-r--r--classes/image_repo_manifest.bbclass2
-rw-r--r--classes/sota.bbclass4
-rw-r--r--classes/sota_sanity.bbclass8
-rw-r--r--recipes-connectivity/zabbix/zabbix_%.bbappend20
-rw-r--r--recipes-sota/aktualizr/aktualizr_git.bb26
-rw-r--r--recipes-test/demo-config/files/30-fake-pacman.toml2
-rw-r--r--recipes-test/demo-config/files/30-ostree-pacman.toml2
-rw-r--r--recipes-test/demo-config/secondary-config.bb6
-rw-r--r--scripts/qemucommand.py9
-rwxr-xr-xscripts/run-qemu-ota6
12 files changed, 70 insertions, 30 deletions
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index c201e3b..141a9f3 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -43,10 +43,6 @@ Build core-image-minimal:
43 variables: 43 variables:
44 TEST_BUILD_DIR: 'build-core-image-minimal' 44 TEST_BUILD_DIR: 'build-core-image-minimal'
45 BITBAKE_TARGETS: 'core-image-minimal' 45 BITBAKE_TARGETS: 'core-image-minimal'
46 artifacts:
47 name: "core-image-minimal_$CI_COMMIT_REF_SLUG"
48 paths:
49 - $TEST_BUILD_DIR/tmp/deploy/images/*/core-image-minimal*
50 except: 46 except:
51 - pushes 47 - pushes
52 48
@@ -58,10 +54,6 @@ Build core-image-minimal (rpi):
58 TEST_BUILD_DIR: 'build-core-image-minimal-rpi' 54 TEST_BUILD_DIR: 'build-core-image-minimal-rpi'
59 BITBAKE_TARGETS: 'core-image-minimal' 55 BITBAKE_TARGETS: 'core-image-minimal'
60 TEST_MACHINE: 'raspberrypi3' 56 TEST_MACHINE: 'raspberrypi3'
61 artifacts:
62 name: "core-image-minimal-rpi_$CI_COMMIT_REF_SLUG"
63 paths:
64 - $TEST_BUILD_DIR/tmp/deploy/images/*/core-image-minimal*
65 except: 57 except:
66 - pushes 58 - pushes
67 59
@@ -94,9 +86,8 @@ Oe-selftest rpi:
94 OE_SELFTESTS: 'updater_raspberrypi' 86 OE_SELFTESTS: 'updater_raspberrypi'
95 except: 87 except:
96 - pushes 88 - pushes
97 only: 89
98 variables: 90# Not run by default
99 - $OE_RPI
100 91
101Ptest qemux86_64: 92Ptest qemux86_64:
102 extends: .oe-selftest 93 extends: .oe-selftest
diff --git a/README.adoc b/README.adoc
index 4cccc7b..1f18af6 100644
--- a/README.adoc
+++ b/README.adoc
@@ -71,6 +71,6 @@ Get help on common problems.
71 71
72== License 72== License
73 73
74This code is licensed under the link:COPYING.MIT[MIT license], a copy of which can be found in this repository. All code is copyright HERE Europe B.V., 2016-2019. 74This code is licensed under the link:COPYING.MIT[MIT license], a copy of which can be found in this repository. All code is copyright HERE Europe B.V., 2016-2020.
75 75
76We require that contributors accept the terms of Linux Foundation's link:https://developercertificate.org/[Developer Certificate of Origin]. Please see the https://github.com/advancedtelematic/aktualizr/blob/master/CONTRIBUTING.md[contribution instructions of aktualizr] for more information. 76We require that contributors accept the terms of Linux Foundation's link:https://developercertificate.org/[Developer Certificate of Origin]. Please see the https://github.com/advancedtelematic/aktualizr/blob/master/CONTRIBUTING.md[contribution instructions of aktualizr] for more information.
diff --git a/classes/image_repo_manifest.bbclass b/classes/image_repo_manifest.bbclass
index c2e7056..0b311bd 100644
--- a/classes/image_repo_manifest.bbclass
+++ b/classes/image_repo_manifest.bbclass
@@ -9,7 +9,7 @@
9# For more information, see: 9# For more information, see:
10# https://web.archive.org/web/20161224194009/https://wiki.cyanogenmod.org/w/Doc:_Using_manifests 10# https://web.archive.org/web/20161224194009/https://wiki.cyanogenmod.org/w/Doc:_Using_manifests
11 11
12HOSTTOOLS_NONFATAL += " repo " 12HOSTTOOLS_NONFATAL += "repo python"
13 13
14# Write build information to target filesystem 14# Write build information to target filesystem
15buildinfo_manifest () { 15buildinfo_manifest () {
diff --git a/classes/sota.bbclass b/classes/sota.bbclass
index 4422741..7bf17a4 100644
--- a/classes/sota.bbclass
+++ b/classes/sota.bbclass
@@ -8,7 +8,7 @@ SOTA_DEPLOY_CREDENTIALS ?= "1"
8SOTA_HARDWARE_ID ??= "${MACHINE}" 8SOTA_HARDWARE_ID ??= "${MACHINE}"
9 9
10IMAGE_INSTALL_append_sota = " ostree os-release ${SOTA_CLIENT} ${SOTA_CLIENT_PROV}" 10IMAGE_INSTALL_append_sota = " ostree os-release ${SOTA_CLIENT} ${SOTA_CLIENT_PROV}"
11IMAGE_CLASSES += " image_types_ostree image_types_ota" 11IMAGE_CLASSES += " image_types_ostree image_types_ota image_repo_manifest"
12 12
13IMAGE_FSTYPES += "${@bb.utils.contains('DISTRO_FEATURES', 'sota', 'ostreepush garagesign garagecheck ota-ext4 wic', ' ', d)}" 13IMAGE_FSTYPES += "${@bb.utils.contains('DISTRO_FEATURES', 'sota', 'ostreepush garagesign garagecheck ota-ext4 wic', ' ', d)}"
14IMAGE_FSTYPES += "${@bb.utils.contains('BUILD_OSTREE_TARBALL', '1', 'ostree.tar.bz2', ' ', d)}" 14IMAGE_FSTYPES += "${@bb.utils.contains('BUILD_OSTREE_TARBALL', '1', 'ostree.tar.bz2', ' ', d)}"
@@ -53,4 +53,4 @@ SOTA_MACHINE_freedom-u540 ?= "freedom-u540"
53SOTA_OVERRIDES_BLACKLIST = "ostree ota" 53SOTA_OVERRIDES_BLACKLIST = "ostree ota"
54SOTA_REQUIRED_VARIABLES = "OSTREE_REPO OSTREE_BRANCHNAME OSTREE_OSNAME OSTREE_BOOTLOADER OSTREE_BOOT_PARTITION GARAGE_SIGN_REPO GARAGE_TARGET_NAME" 54SOTA_REQUIRED_VARIABLES = "OSTREE_REPO OSTREE_BRANCHNAME OSTREE_OSNAME OSTREE_BOOTLOADER OSTREE_BOOT_PARTITION GARAGE_SIGN_REPO GARAGE_TARGET_NAME"
55 55
56inherit sota_sanity sota_${SOTA_MACHINE} image_repo_manifest 56inherit sota_sanity sota_${SOTA_MACHINE}
diff --git a/classes/sota_sanity.bbclass b/classes/sota_sanity.bbclass
index 1339fb3..74973eb 100644
--- a/classes/sota_sanity.bbclass
+++ b/classes/sota_sanity.bbclass
@@ -14,10 +14,10 @@ def sota_check_variables_validity(status, d):
14 import re 14 import re
15 import os.path 15 import os.path
16 16
17 if d.getVar("OSTREE_BRANCHNAME") and re.match("^[a-zA-Z0-9_-]*$", d.getVar("OSTREE_BRANCHNAME")) is None: 17 if d.getVar("OSTREE_BRANCHNAME") and re.match("^[a-zA-Z0-9._-]*$", d.getVar("OSTREE_BRANCHNAME")) is None:
18 status.addresult("OSTREE_BRANCHNAME Should only contain characters from the character set [a-zA-Z0-9_-].\n") 18 status.addresult("OSTREE_BRANCHNAME Should only contain characters from the character set [a-zA-Z0-9._-].\n")
19 if d.getVar("SOTA_HARDWARE_ID") and re.match("^[a-zA-Z0-9_-]*$", d.getVar("SOTA_HARDWARE_ID")) is None: 19 if d.getVar("SOTA_HARDWARE_ID") and re.match("^[a-zA-Z0-9._-]*$", d.getVar("SOTA_HARDWARE_ID")) is None:
20 status.addresult("SOTA_HARDWARE_ID Should only contain characters from the character set [a-zA-Z0-9_-].\n") 20 status.addresult("SOTA_HARDWARE_ID Should only contain characters from the character set [a-zA-Z0-9._-].\n")
21 if d.getVar("SOTA_CLIENT_FEATURES") is not None: 21 if d.getVar("SOTA_CLIENT_FEATURES") is not None:
22 for feat in d.getVar("SOTA_CLIENT_FEATURES").split(' '): 22 for feat in d.getVar("SOTA_CLIENT_FEATURES").split(' '):
23 if feat not in ("hsm", "serialcan", "ubootenv", ""): 23 if feat not in ("hsm", "serialcan", "ubootenv", ""):
diff --git a/recipes-connectivity/zabbix/zabbix_%.bbappend b/recipes-connectivity/zabbix/zabbix_%.bbappend
new file mode 100644
index 0000000..c6a69b5
--- /dev/null
+++ b/recipes-connectivity/zabbix/zabbix_%.bbappend
@@ -0,0 +1,20 @@
1
2do_install_append() {
3
4 # Set the zabbix Server
5 if [ ! -z ${SOTA_COMM_CONF_ZABBIX_SERVER} ]; then
6 sed -i "s/Server=\([0-9]\{1,3\}\.\)\{3\}[0-9]\{1,3\}/Server=${SOTA_COMM_CONF_ZABBIX_SERVER}/g" ${D}${sysconfdir}/zabbix_agentd.conf
7 if ! grep -Fxq "Server=${SOTA_COMM_CONF_ZABBIX_SERVER}" ${D}${sysconfdir}/zabbix_agentd.conf; then
8 echo -e '\nServer='${SOTA_COMM_CONF_ZABBIX_SERVER} >> ${D}${sysconfdir}/zabbix_agentd.conf
9 fi
10 fi
11
12 # Set ServerActive
13 if [ ! -z ${SOTA_COMM_CONF_ZABBIX_SERVERACTIVE} ]; then
14 sed -i "s/ServerActive=\([0-9]\{1,3\}\.\)\{3\}[0-9]\{1,3\}/ServerActive=${SOTA_COMM_CONF_ZABBIX_SERVERACTIVE}/g" ${D}${sysconfdir}/zabbix_agentd.conf
15 if ! grep -Fxq "ServerActive=${SOTA_COMM_CONF_ZABBIX_SERVERACTIVE}" ${D}${sysconfdir}/zabbix_agentd.conf; then
16 echo -e '\nServerActive='${SOTA_COMM_CONF_ZABBIX_SERVERACTIVE} >> ${D}${sysconfdir}/zabbix_agentd.conf
17 fi
18
19 fi
20}
diff --git a/recipes-sota/aktualizr/aktualizr_git.bb b/recipes-sota/aktualizr/aktualizr_git.bb
index bd9c3f8..1742430 100644
--- a/recipes-sota/aktualizr/aktualizr_git.bb
+++ b/recipes-sota/aktualizr/aktualizr_git.bb
@@ -7,7 +7,7 @@ LIC_FILES_CHKSUM = "file://${S}/LICENSE;md5=815ca599c9df247a0c7f619bab123dad"
7 7
8DEPENDS = "boost curl openssl libarchive libsodium sqlite3 asn1c-native" 8DEPENDS = "boost curl openssl libarchive libsodium sqlite3 asn1c-native"
9DEPENDS_append = "${@bb.utils.contains('PTEST_ENABLED', '1', ' coreutils-native net-tools-native ostree-native aktualizr-native ', '', d)}" 9DEPENDS_append = "${@bb.utils.contains('PTEST_ENABLED', '1', ' coreutils-native net-tools-native ostree-native aktualizr-native ', '', d)}"
10RDEPENDS_${PN}_class-target = "aktualizr-configs aktualizr-hwid lshw" 10RDEPENDS_${PN}_class-target = "${PN}-configs ${PN}-hwid lshw"
11RDEPENDS_${PN}-host-tools = "aktualizr aktualizr-cert-provider ${@bb.utils.contains('PACKAGECONFIG', 'sota-tools', 'garage-deploy garage-push', '', d)}" 11RDEPENDS_${PN}-host-tools = "aktualizr aktualizr-cert-provider ${@bb.utils.contains('PACKAGECONFIG', 'sota-tools', 'garage-deploy garage-push', '', d)}"
12 12
13RDEPENDS_${PN}-ptest += "bash cmake curl net-tools python3-core python3-misc python3-modules openssl-bin sqlite3 valgrind" 13RDEPENDS_${PN}-ptest += "bash cmake curl net-tools python3-core python3-misc python3-modules openssl-bin sqlite3 valgrind"
@@ -15,7 +15,7 @@ RDEPENDS_${PN}-ptest += "bash cmake curl net-tools python3-core python3-misc pyt
15PV = "1.0+git${SRCPV}" 15PV = "1.0+git${SRCPV}"
16PR = "7" 16PR = "7"
17 17
18GARAGE_SIGN_PV = "0.7.0-61-g909b804" 18GARAGE_SIGN_PV = "0.7.0-64-gc7c279f"
19 19
20SRC_URI = " \ 20SRC_URI = " \
21 gitsm://github.com/advancedtelematic/aktualizr;branch=${BRANCH};name=aktualizr \ 21 gitsm://github.com/advancedtelematic/aktualizr;branch=${BRANCH};name=aktualizr \
@@ -27,10 +27,10 @@ SRC_URI = " \
27 ${@ d.expand("https://ats-tuf-cli-releases.s3-eu-central-1.amazonaws.com/cli-${GARAGE_SIGN_PV}.tgz;unpack=0;name=garagesign") if d.getVar('GARAGE_SIGN_AUTOVERSION') != '1' else ''} \ 27 ${@ d.expand("https://ats-tuf-cli-releases.s3-eu-central-1.amazonaws.com/cli-${GARAGE_SIGN_PV}.tgz;unpack=0;name=garagesign") if d.getVar('GARAGE_SIGN_AUTOVERSION') != '1' else ''} \
28 " 28 "
29 29
30SRC_URI[garagesign.md5sum] = "3e1ae6d49cc66fda37cef47f849d9609" 30SRC_URI[garagesign.md5sum] = "36dedbf79f71cb697a18251ea121bcc6"
31SRC_URI[garagesign.sha256sum] = "8d49b83efa222db2f092ee14348459ee1bfd048552b57c3cb5ab48db8e347d82" 31SRC_URI[garagesign.sha256sum] = "f0a8e4bb258fd65a6f1fe561132d5ab3fe25b76aec0f1873993dc65bf2167608"
32 32
33SRCREV = "6633d0d0e6353fdf8970001dc8da70e6a28203cd" 33SRCREV = "5ead19cf8aefee44e929b7e98bc5aa63e0621aac"
34BRANCH ?= "master" 34BRANCH ?= "master"
35 35
36S = "${WORKDIR}/git" 36S = "${WORKDIR}/git"
@@ -140,7 +140,7 @@ python split_hosttools_packages () {
140 140
141PACKAGES_DYNAMIC = "^aktualizr-.* ^garage-.*" 141PACKAGES_DYNAMIC = "^aktualizr-.* ^garage-.*"
142 142
143PACKAGES =+ "${PN}-resource-control ${PN}-examples ${PN}-secondary ${PN}-configs ${PN}-host-tools" 143PACKAGES =+ "${PN}-host-tools ${PN}-lib ${PN}-resource-control ${PN}-configs ${PN}-examples ${PN}-secondary ${PN}-secondary-lib ${PN}-sotatools-lib"
144 144
145ALLOW_EMPTY_${PN}-host-tools = "1" 145ALLOW_EMPTY_${PN}-host-tools = "1"
146 146
@@ -150,6 +150,10 @@ FILES_${PN} = " \
150 ${systemd_unitdir}/system/aktualizr.service \ 150 ${systemd_unitdir}/system/aktualizr.service \
151 " 151 "
152 152
153FILES_${PN}-lib = " \
154 ${libdir}/libaktualizr_lib.so \
155 "
156
153FILES_${PN}-resource-control = " \ 157FILES_${PN}-resource-control = " \
154 ${systemd_system_unitdir}/aktualizr.service.d/10-resource-control.conf \ 158 ${systemd_system_unitdir}/aktualizr.service.d/10-resource-control.conf \
155 " 159 "
@@ -169,6 +173,16 @@ FILES_${PN}-secondary = " \
169 ${systemd_unitdir}/system/aktualizr-secondary.service \ 173 ${systemd_unitdir}/system/aktualizr-secondary.service \
170 " 174 "
171 175
176FILES_${PN}-secondary-lib = " \
177 ${libdir}/libaktualizr_secondary_lib.so \
178 "
179
180FILES_${PN}-sotatools-lib = " \
181 ${libdir}/libsota_tools_lib.so \
182 "
183
184FILES_${PN}-dev = ""
185
172BBCLASSEXTEND = "native" 186BBCLASSEXTEND = "native"
173 187
174# vim:set ts=4 sw=4 sts=4 expandtab: 188# vim:set ts=4 sw=4 sts=4 expandtab:
diff --git a/recipes-test/demo-config/files/30-fake-pacman.toml b/recipes-test/demo-config/files/30-fake-pacman.toml
deleted file mode 100644
index 3fb5cf2..0000000
--- a/recipes-test/demo-config/files/30-fake-pacman.toml
+++ /dev/null
@@ -1,2 +0,0 @@
1[pacman]
2type = "fake"
diff --git a/recipes-test/demo-config/files/30-ostree-pacman.toml b/recipes-test/demo-config/files/30-ostree-pacman.toml
new file mode 100644
index 0000000..d2cf5b8
--- /dev/null
+++ b/recipes-test/demo-config/files/30-ostree-pacman.toml
@@ -0,0 +1,2 @@
1[pacman]
2type = "ostree"
diff --git a/recipes-test/demo-config/secondary-config.bb b/recipes-test/demo-config/secondary-config.bb
index ddbed89..58b18df 100644
--- a/recipes-test/demo-config/secondary-config.bb
+++ b/recipes-test/demo-config/secondary-config.bb
@@ -12,14 +12,14 @@ SOTA_HARDWARE_ID ?= "${MACHINE}-sndry"
12SECONDARY_HARDWARE_ID ?= "${SOTA_HARDWARE_ID}" 12SECONDARY_HARDWARE_ID ?= "${SOTA_HARDWARE_ID}"
13 13
14SRC_URI = "\ 14SRC_URI = "\
15 file://30-fake-pacman.toml \ 15 file://30-ostree-pacman.toml \
16 file://35-network-config.toml \ 16 file://35-network-config.toml \
17 file://45-id-config.toml \ 17 file://45-id-config.toml \
18 " 18 "
19 19
20do_install () { 20do_install () {
21 install -m 0700 -d ${D}${libdir}/sota/conf.d 21 install -m 0700 -d ${D}${libdir}/sota/conf.d
22 install -m 0644 ${WORKDIR}/30-fake-pacman.toml ${D}${libdir}/sota/conf.d/30-fake-pacman.toml 22 install -m 0644 ${WORKDIR}/30-ostree-pacman.toml ${D}${libdir}/sota/conf.d/30-ostree-pacman.toml
23 23
24 install -m 0644 ${WORKDIR}/35-network-config.toml ${D}${libdir}/sota/conf.d/35-network-config.toml 24 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' \ 25 sed -i -e 's|@PORT@|${SECONDARY_PORT}|g' \
@@ -36,7 +36,7 @@ do_install () {
36 36
37FILES_${PN} = " \ 37FILES_${PN} = " \
38 ${libdir}/sota/conf.d \ 38 ${libdir}/sota/conf.d \
39 ${libdir}/sota/conf.d/30-fake-pacman.toml \ 39 ${libdir}/sota/conf.d/30-ostree-pacman.toml \
40 ${libdir}/sota/conf.d/35-network-config.toml \ 40 ${libdir}/sota/conf.d/35-network-config.toml \
41 ${libdir}/sota/conf.d/45-id-config.toml \ 41 ${libdir}/sota/conf.d/45-id-config.toml \
42 " 42 "
diff --git a/scripts/qemucommand.py b/scripts/qemucommand.py
index cef434d..8d3ee0e 100644
--- a/scripts/qemucommand.py
+++ b/scripts/qemucommand.py
@@ -42,6 +42,8 @@ class QemuCommand(object):
42 def __init__(self, args): 42 def __init__(self, args):
43 self.dry_run = args.dry_run 43 self.dry_run = args.dry_run
44 self.overlay = args.overlay 44 self.overlay = args.overlay
45 self.host_fwd = None
46
45 if args.machine: 47 if args.machine:
46 self.machine = args.machine 48 self.machine = args.machine
47 else: 49 else:
@@ -125,10 +127,17 @@ class QemuCommand(object):
125 self.pcap = args.pcap 127 self.pcap = args.pcap
126 self.secondary_network = args.secondary_network 128 self.secondary_network = args.secondary_network
127 129
130 # Append additional port forwarding to QEMU command line.
131 if hasattr(args, 'host_forward'):
132 self.host_fwd = args.host_forward
133
128 def command_line(self): 134 def command_line(self):
129 netuser = 'user,hostfwd=tcp:0.0.0.0:%d-:22,restrict=off' % self.ssh_port 135 netuser = 'user,hostfwd=tcp:0.0.0.0:%d-:22,restrict=off' % self.ssh_port
130 if self.gdb: 136 if self.gdb:
131 netuser += ',hostfwd=tcp:0.0.0.0:2159-:2159' 137 netuser += ',hostfwd=tcp:0.0.0.0:2159-:2159'
138 if self.host_fwd:
139 netuser += ",hostfwd=" + self.host_fwd
140
132 cmdline = [ 141 cmdline = [
133 "qemu-system-x86_64", 142 "qemu-system-x86_64",
134 "-bios", self.bios 143 "-bios", self.bios
diff --git a/scripts/run-qemu-ota b/scripts/run-qemu-ota
index e2a4103..5652797 100755
--- a/scripts/run-qemu-ota
+++ b/scripts/run-qemu-ota
@@ -39,6 +39,12 @@ def main():
39 help='Give the image a second network card connected to a virtual network. ' + 39 help='Give the image a second network card connected to a virtual network. ' +
40 'This can be used to test Uptane Primary/Secondary communication.') 40 'This can be used to test Uptane Primary/Secondary communication.')
41 parser.add_argument('-n', '--dry-run', help='Print qemu command line rather then run it', action='store_true') 41 parser.add_argument('-n', '--dry-run', help='Print qemu command line rather then run it', action='store_true')
42 parser.add_argument('--host-forward',
43 help='Redirect incoming TCP or UDP connections to the host port. '
44 'Example forwarding guest port 10050 to the host port 10555:'
45 '--host-forward="tcp:0.0.0.0:10556-:10050". '
46 'For more details please refer to QEMU man page, option <hostfwd>. '
47 'https://manpages.debian.org/testing/qemu-system-x86/qemu-system-x86_64.1.en.html')
42 args = parser.parse_args() 48 args = parser.parse_args()
43 49
44 if args.overlay and not exists(args.overlay) and dirname(args.overlay) and not dirname(args.overlay) == '.': 50 if args.overlay and not exists(args.overlay) and dirname(args.overlay) and not dirname(args.overlay) == '.':