summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--README.adoc2
-rw-r--r--lib/oeqa/selftest/cases/updater.py45
-rwxr-xr-xrecipes-sota/aktualizr/aktualizr_git.bb15
-rw-r--r--recipes-sota/aktualizr/garage-sign-version.inc17
-rw-r--r--recipes-support/lshw/files/ldflags.patch4
-rw-r--r--recipes-support/lshw/lshw_02.17.bb (renamed from recipes-support/lshw/lshw_02.16.bb)6
-rw-r--r--scripts/qemucommand.py2
7 files changed, 77 insertions, 14 deletions
diff --git a/README.adoc b/README.adoc
index 75ee9ae..d2bd4b5 100644
--- a/README.adoc
+++ b/README.adoc
@@ -81,7 +81,7 @@ Although we have used U-Boot so far, other boot loaders can be configured work w
81* `OSTREE_INITRAMFS_IMAGE` - initramfs/initrd image that is used as a proxy while booting into OSTree deployment. Do not change this setting unless you are sure that your initramfs can serve as such a proxy. 81* `OSTREE_INITRAMFS_IMAGE` - initramfs/initrd image that is used as a proxy while booting into OSTree deployment. Do not change this setting unless you are sure that your initramfs can serve as such a proxy.
82* `SOTA_PACKED_CREDENTIALS` - when set, your ostree commit will be pushed to a remote repo as a bitbake step. This should be the path to a zipped credentials file in https://github.com/advancedtelematic/aktualizr/blob/master/docs/credentials.adoc[the format accepted by garage-push]. 82* `SOTA_PACKED_CREDENTIALS` - when set, your ostree commit will be pushed to a remote repo as a bitbake step. This should be the path to a zipped credentials file in https://github.com/advancedtelematic/aktualizr/blob/master/docs/credentials.adoc[the format accepted by garage-push].
83* `SOTA_CLIENT_PROV` - which provisioning method to use. Valid options are https://github.com/advancedtelematic/aktualizr/blob/master/docs/automatic-provisioning.adoc[`aktualizr-auto-prov`], https://github.com/advancedtelematic/aktualizr/blob/master/docs/implicit-provisioning.adoc[`aktualizr-implicit-prov`], and https://github.com/advancedtelematic/aktualizr/blob/master/docs/hsm-provisioning.adoc[`aktualizr-hsm-prov`]. The default is `aktualizr-auto-prov`. This can also be set to an empty string to avoid using a provisioning recipe. 83* `SOTA_CLIENT_PROV` - which provisioning method to use. Valid options are https://github.com/advancedtelematic/aktualizr/blob/master/docs/automatic-provisioning.adoc[`aktualizr-auto-prov`], https://github.com/advancedtelematic/aktualizr/blob/master/docs/implicit-provisioning.adoc[`aktualizr-implicit-prov`], and https://github.com/advancedtelematic/aktualizr/blob/master/docs/hsm-provisioning.adoc[`aktualizr-hsm-prov`]. The default is `aktualizr-auto-prov`. This can also be set to an empty string to avoid using a provisioning recipe.
84* `SOTA_CLIENT_FEATURES` - extensions to aktualizr. The only valid option is `hsm` (to build with HSM support) 84* `SOTA_CLIENT_FEATURES` - extensions to aktualizr. The only valid options are `hsm` (to build with HSM support) and `secondary-network` (to set up a simulated 'in-vehicle' network with support for a primary node with a DHCP server and a secondary node with a DHCP client).
85* `SOTA_SECONDARY_ECUS` - a list of paths separated by spaces of JSON configuration files for virtual secondaries on the host. These will be installed into `/var/sota/ecus` on the device. 85* `SOTA_SECONDARY_ECUS` - a list of paths separated by spaces of JSON configuration files for virtual secondaries on the host. These will be installed into `/var/sota/ecus` on the device.
86* `SOTA_VIRTUAL_SECONDARIES` - a list of paths separated by spaces of JSON configuration files for virtual secondaries installed on the device. If `SOTA_SECONDARY_ECUS` is used to install them, then you can expect them to be installed in `/var/sota/ecus`. 86* `SOTA_VIRTUAL_SECONDARIES` - a list of paths separated by spaces of JSON configuration files for virtual secondaries installed on the device. If `SOTA_SECONDARY_ECUS` is used to install them, then you can expect them to be installed in `/var/sota/ecus`.
87 87
diff --git a/lib/oeqa/selftest/cases/updater.py b/lib/oeqa/selftest/cases/updater.py
index 190d85d..8686033 100644
--- a/lib/oeqa/selftest/cases/updater.py
+++ b/lib/oeqa/selftest/cases/updater.py
@@ -193,6 +193,49 @@ class AutoProvTests(OESelftestTestCase):
193 'Legacy secondary initialization failed: ' + stderr.decode() + stdout.decode()) 193 'Legacy secondary initialization failed: ' + stderr.decode() + stdout.decode())
194 194
195 195
196class ManualControlTests(OESelftestTestCase):
197
198 def setUpLocal(self):
199 layer = "meta-updater-qemux86-64"
200 result = runCmd('bitbake-layers show-layers')
201 if re.search(layer, result.output) is None:
202 # Assume the directory layout for finding other layers. We could also
203 # make assumptions by using 'show-layers', but either way, if the
204 # layers we need aren't where we expect them, we are out of like.
205 path = os.path.abspath(os.path.dirname(__file__))
206 metadir = path + "/../../../../../"
207 self.meta_qemu = metadir + layer
208 runCmd('bitbake-layers add-layer "%s"' % self.meta_qemu)
209 else:
210 self.meta_qemu = None
211 self.append_config('MACHINE = "qemux86-64"')
212 self.append_config('SOTA_CLIENT_PROV = " aktualizr-auto-prov "')
213 self.append_config('SYSTEMD_AUTO_ENABLE_aktualizr = "disable"')
214 self.qemu, self.s = qemu_launch(machine='qemux86-64')
215
216 def tearDownLocal(self):
217 qemu_terminate(self.s)
218 if self.meta_qemu:
219 runCmd('bitbake-layers remove-layer "%s"' % self.meta_qemu, ignore_status=True)
220
221 def qemu_command(self, command):
222 return qemu_send_command(self.qemu.ssh_port, command)
223
224 def test_manual_running_mode_once(self):
225 """
226 Disable the systemd service then run aktualizr manually
227 """
228 sleep(20)
229 stdout, stderr, retcode = self.qemu_command('aktualizr-info --allow-migrate')
230 self.assertIn(b'Fetched metadata: no', stdout,
231 'Aktualizr should not have run yet' + stderr.decode() + stdout.decode())
232
233 stdout, stderr, retcode = self.qemu_command('aktualizr --running-mode=once')
234
235 stdout, stderr, retcode = self.qemu_command('aktualizr-info')
236 self.assertIn(b'Fetched metadata: yes', stdout,
237 'Aktualizr should have run' + stderr.decode() + stdout.decode())
238
196class RpiTests(OESelftestTestCase): 239class RpiTests(OESelftestTestCase):
197 240
198 def setUpLocal(self): 241 def setUpLocal(self):
@@ -554,7 +597,7 @@ class SecondaryTests(OESelftestTestCase):
554 597
555 def test_secondary_listening(self): 598 def test_secondary_listening(self):
556 print('Checking aktualizr-secondary service is listening') 599 print('Checking aktualizr-secondary service is listening')
557 stdout, stderr, retcode = self.qemu_command('echo test | nc localhost 9030') 600 stdout, stderr, retcode = self.qemu_command('aktualizr-check-discovery')
558 self.assertEqual(retcode, 0, "Unable to connect to secondary") 601 self.assertEqual(retcode, 0, "Unable to connect to secondary")
559 602
560 603
diff --git a/recipes-sota/aktualizr/aktualizr_git.bb b/recipes-sota/aktualizr/aktualizr_git.bb
index ca0bfb6..9369cbe 100755
--- a/recipes-sota/aktualizr/aktualizr_git.bb
+++ b/recipes-sota/aktualizr/aktualizr_git.bb
@@ -12,8 +12,10 @@ DEPENDS_append_class-native = "glib-2.0-native "
12RDEPENDS_${PN}_class-target = "lshw " 12RDEPENDS_${PN}_class-target = "lshw "
13RDEPENDS_${PN}_append_class-target = "${@bb.utils.contains('SOTA_CLIENT_FEATURES', 'serialcan', ' slcand-start', '', d)} " 13RDEPENDS_${PN}_append_class-target = "${@bb.utils.contains('SOTA_CLIENT_FEATURES', 'serialcan', ' slcand-start', '', d)} "
14RDEPENDS_${PN}_append_class-target = "${@bb.utils.contains('SOTA_CLIENT_FEATURES', 'hsm', ' softhsm softhsm-testtoken', '', d)}" 14RDEPENDS_${PN}_append_class-target = "${@bb.utils.contains('SOTA_CLIENT_FEATURES', 'hsm', ' softhsm softhsm-testtoken', '', d)}"
15RDEPENDS_${PN}_append_class-target = " ${@oe.utils.ifelse(d.getVar('OSTREE_BOOTLOADER', True) == 'u-boot', 'u-boot-fw-utils', '')}" 15RDEPENDS_${PN}_append_class-target = " ${@bb.utils.contains('SOTA_CLIENT_FEATURES', 'ubootenv', ' u-boot-fw-utils aktualizr-uboot-env-rollback', '', d)} "
16RDEPENDS_${PN}_append_class-target = " ${@bb.utils.contains('SOTA_CLIENT_FEATURES', 'ubootenv', ' aktualizr-uboot-env-rollback', '', d)} " 16
17RDEPENDS_${PN}_append_class-target = " ${PN}-tools "
18RDEPENDS_${PN}-secondary_append_class-target = " ${PN}-tools "
17 19
18PV = "1.0+git${SRCPV}" 20PV = "1.0+git${SRCPV}"
19PR = "7" 21PR = "7"
@@ -25,7 +27,7 @@ SRC_URI = " \
25 file://aktualizr-secondary.socket \ 27 file://aktualizr-secondary.socket \
26 file://aktualizr-serialcan.service \ 28 file://aktualizr-serialcan.service \
27 " 29 "
28SRCREV = "767098f45e2e05d5bbd817f9b3b3aa44844da8ec" 30SRCREV = "062ab7756c375ee2c913d3197cafe4ee2f97ef2a"
29BRANCH ?= "master" 31BRANCH ?= "master"
30 32
31S = "${WORKDIR}/git" 33S = "${WORKDIR}/git"
@@ -85,7 +87,7 @@ do_install_append_class-native () {
85 install -m 0644 ${B}/src/sota_tools/garage-sign/lib/* ${D}${libdir} 87 install -m 0644 ${B}/src/sota_tools/garage-sign/lib/* ${D}${libdir}
86} 88}
87 89
88PACKAGES =+ " ${PN}-examples ${PN}-host-tools ${PN}-secondary " 90PACKAGES =+ " ${PN}-examples ${PN}-host-tools ${PN}-tools ${PN}-secondary "
89 91
90FILES_${PN} = " \ 92FILES_${PN} = " \
91 ${bindir}/aktualizr \ 93 ${bindir}/aktualizr \
@@ -100,6 +102,7 @@ FILES_${PN}-examples = " \
100 ${libdir}/sota/demo_secondary.json \ 102 ${libdir}/sota/demo_secondary.json \
101 ${bindir}/example-interface \ 103 ${bindir}/example-interface \
102 ${bindir}/isotp-test-interface \ 104 ${bindir}/isotp-test-interface \
105 ${bindir}/hmi_stub \
103 " 106 "
104 107
105FILES_${PN}-host-tools = " \ 108FILES_${PN}-host-tools = " \
@@ -116,6 +119,10 @@ FILES_${PN}-host-tools = " \
116 ${libdir}/sota/sota_uboot_env.toml \ 119 ${libdir}/sota/sota_uboot_env.toml \
117 " 120 "
118 121
122FILES_${PN}-tools = " \
123 ${bindir}/aktualizr-check-discovery \
124 "
125
119FILES_${PN}-secondary = " \ 126FILES_${PN}-secondary = " \
120 ${bindir}/aktualizr-secondary \ 127 ${bindir}/aktualizr-secondary \
121 ${libdir}/sota/sota_secondary.toml \ 128 ${libdir}/sota/sota_secondary.toml \
diff --git a/recipes-sota/aktualizr/garage-sign-version.inc b/recipes-sota/aktualizr/garage-sign-version.inc
index f2d04e8..1b89a3d 100644
--- a/recipes-sota/aktualizr/garage-sign-version.inc
+++ b/recipes-sota/aktualizr/garage-sign-version.inc
@@ -11,8 +11,21 @@ python () {
11 url = url_file.read().decode().strip(' \t\n') + '/health/version' 11 url = url_file.read().decode().strip(' \t\n') + '/health/version'
12 except (KeyError, ValueError, RuntimeError): 12 except (KeyError, ValueError, RuntimeError):
13 return 13 return
14 r = urllib.request.urlopen(url) 14 connected = False
15 if r.code != 200: 15 tries = 3
16 for i in range(tries):
17 try:
18 r = urllib.request.urlopen(url)
19 if r.code == 200:
20 connected = True
21 break
22 else:
23 print('Bad return code from server ' + url + ': ' + str(r.code) +
24 ' (attempt ' + str(i + 1) + ' of ' + str(tries) + ')')
25 except urllib.error.URLError as e:
26 print('Error connecting to server ' + url + ': ' + str(e) +
27 ' (attempt ' + str(i + 1) + ' of ' + str(tries) + ')')
28 if not connected:
16 return 29 return
17 resp = r.read().decode('utf-8') 30 resp = r.read().decode('utf-8')
18 j = json.loads(resp) 31 j = json.loads(resp)
diff --git a/recipes-support/lshw/files/ldflags.patch b/recipes-support/lshw/files/ldflags.patch
index 83e0410..d95699d 100644
--- a/recipes-support/lshw/files/ldflags.patch
+++ b/recipes-support/lshw/files/ldflags.patch
@@ -1,6 +1,6 @@
1diff -Naur /home/anton/lshw-old/src/Makefile lshw-B.02.16/src/Makefile 1diff -Naur /home/anton/lshw-old/src/Makefile lshw-B.02.17/src/Makefile
2--- /home/anton/lshw-old/src/Makefile 2017-02-07 16:21:52.554738182 +0100 2--- /home/anton/lshw-old/src/Makefile 2017-02-07 16:21:52.554738182 +0100
3+++ lshw-B.02.16/src/Makefile 2017-02-07 16:22:45.578588072 +0100 3+++ lshw-B.02.17/src/Makefile 2017-02-07 16:22:45.578588072 +0100
4@@ -25,9 +25,9 @@ 4@@ -25,9 +25,9 @@
5 ifeq ($(SQLITE), 1) 5 ifeq ($(SQLITE), 1)
6 CXXFLAGS+= -DSQLITE $(shell pkg-config --cflags sqlite3) 6 CXXFLAGS+= -DSQLITE $(shell pkg-config --cflags sqlite3)
diff --git a/recipes-support/lshw/lshw_02.16.bb b/recipes-support/lshw/lshw_02.17.bb
index 99901ff..1ecc4c1 100644
--- a/recipes-support/lshw/lshw_02.16.bb
+++ b/recipes-support/lshw/lshw_02.17.bb
@@ -9,7 +9,7 @@ SUMMARY = "Hardware lister"
9HOMEPAGE = "http://ezix.org/project/wiki/HardwareLiSter" 9HOMEPAGE = "http://ezix.org/project/wiki/HardwareLiSter"
10SECTION = "console/tools" 10SECTION = "console/tools"
11LICENSE = "GPLv2+" 11LICENSE = "GPLv2+"
12LIC_FILES_CHKSUM = "file://COPYING;md5=94d55d512a9ba36caa9b7df079bae19f" 12LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263"
13DEPENDS = "pciutils \ 13DEPENDS = "pciutils \
14 usbutils" 14 usbutils"
15COMPATIBLE_HOST = "(i.86|x86_64|arm|aarch64).*-linux" 15COMPATIBLE_HOST = "(i.86|x86_64|arm|aarch64).*-linux"
@@ -19,8 +19,8 @@ SRC_URI="http://ezix.org/software/files/lshw-B.${PV}.tar.gz \
19 file://ldflags.patch \ 19 file://ldflags.patch \
20 " 20 "
21 21
22SRC_URI[md5sum] = "67479167add605e8f001097c30e96d0d" 22SRC_URI[md5sum] = "a5feb796cb302850eaf5b4530888e3ed"
23SRC_URI[sha256sum] = "809882429555b93259785cc261dbff04c16c93d064db5f445a51945bc47157cb" 23SRC_URI[sha256sum] = "eb9cc053fa0f1e78685cb695596e73931bfb55d2377e3bc3b8b94aff4c5a489c"
24 24
25S="${WORKDIR}/lshw-B.${PV}" 25S="${WORKDIR}/lshw-B.${PV}"
26 26
diff --git a/scripts/qemucommand.py b/scripts/qemucommand.py
index 4918314..86362f7 100644
--- a/scripts/qemucommand.py
+++ b/scripts/qemucommand.py
@@ -115,7 +115,7 @@ class QemuCommand(object):
115 else: 115 else:
116 cmdline.append('-nographic') 116 cmdline.append('-nographic')
117 if self.kvm: 117 if self.kvm:
118 cmdline.append('-enable-kvm') 118 cmdline += ['-enable-kvm', '-cpu', 'host']
119 else: 119 else:
120 cmdline += ['-cpu', 'Haswell'] 120 cmdline += ['-cpu', 'Haswell']
121 if self.overlay: 121 if self.overlay: