summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPatrick Vacek <patrickvacek@gmail.com>2018-10-31 13:33:43 +0100
committerGitHub <noreply@github.com>2018-10-31 13:33:43 +0100
commitfdbf88415985ac4543bdf8737cc4607e489fa04f (patch)
tree05bc166dc4a98cb6fe31ed21588780be48a25a97
parent2e9c1d49b6853063029d6f4da637d2478d43c774 (diff)
parent55fef35b5c81dd3aeb030edbd609b915e2b27f80 (diff)
downloadmeta-updater-fdbf88415985ac4543bdf8737cc4607e489fa04f.tar.gz
Merge pull request #414 from advancedtelematic/refactor/sumo/rm-implicit-writer
Refactor/sumo/rm implicit writer
-rw-r--r--CONTRIBUTING.adoc14
-rw-r--r--README.adoc12
-rw-r--r--lib/oeqa/selftest/cases/updater.py13
-rwxr-xr-xrecipes-sota/aktualizr/aktualizr_git.bb10
-rw-r--r--recipes-sota/config/aktualizr-example-interface.bb21
-rw-r--r--recipes-sota/config/files/30-example-interface.toml2
-rw-r--r--recipes-sota/ostree/ostree_git.bb2
-rw-r--r--recipes-support/libgsystem/libgsystem_git.bb40
8 files changed, 26 insertions, 88 deletions
diff --git a/CONTRIBUTING.adoc b/CONTRIBUTING.adoc
index 93a0815..3d0f14d 100644
--- a/CONTRIBUTING.adoc
+++ b/CONTRIBUTING.adoc
@@ -3,3 +3,17 @@
3We welcome pull requests from anyone. The master branch is the primary branch for development, and if you wish to add new functionality, it probably belongs there. We attempt to maintain recent previous branches and welcome bug fixes and backports for those. Currently, the actively maintained branches are sumo, rocko, and pyro. Previously, morty was also a stable branch, but it has not been updated or actively maintained for a while. 3We welcome pull requests from anyone. The master branch is the primary branch for development, and if you wish to add new functionality, it probably belongs there. We attempt to maintain recent previous branches and welcome bug fixes and backports for those. Currently, the actively maintained branches are sumo, rocko, and pyro. Previously, morty was also a stable branch, but it has not been updated or actively maintained for a while.
4 4
5If you are developing with meta-updater, it may be helpful to read the README and other documentation for link:README.adoc[this repo], https://github.com/advancedtelematic/aktualizr[aktualizr], and the https://github.com/advancedtelematic/updater-repo/[updater-repo], particularly the sections about development and debugging. 5If you are developing with meta-updater, it may be helpful to read the README and other documentation for link:README.adoc[this repo], https://github.com/advancedtelematic/aktualizr[aktualizr], and the https://github.com/advancedtelematic/updater-repo/[updater-repo], particularly the sections about development and debugging.
6
7== Contributor checklist
8
9* OTA-enabled build succeeds for at least one platform, the resulting image boots, and an update can be installed. This check is absolutely necessary for every pull request unless it only touches documentation.
10* If your change touches platform code (like `classes/sota_<platform>.bbclass`), please check building and updating on this particular platform.
11* oe-selftest succeeds. To test meta-updater, run `oe-selftest -r updater` from a build directory with `MACHINE` set to `qemux86-64`.
12* Updates are forwards- and backwards-compatible. You should be able to update an OTA-enabled build before the change is applied to the version with change applied and vice versa. One should pay double attention to the compatibility when bootloader code is affected.
13* The patch/branch should be based on the latest version of the target branch. This may mean that rebasing is necessary if other PRs are merged before yours is approved.
14
15We understand that completing all these tasks might be overly tedious due to build times in Yocto. Please add a comment to your PR describing the tests you've done.
16
17== Approval
18
19PR approval should be accompanied by a comment describing what tests have been done by the reviewer.
diff --git a/README.adoc b/README.adoc
index 8b761b6..aadad2d 100644
--- a/README.adoc
+++ b/README.adoc
@@ -200,14 +200,16 @@ oe-selftest --run-tests updater
200For more information about oe-selftest, including details about how to run individual test modules or classes, please refer to the https://wiki.yoctoproject.org/wiki/Oe-selftest[Yocto Project wiki]. 200For more information about oe-selftest, including details about how to run individual test modules or classes, please refer to the https://wiki.yoctoproject.org/wiki/Oe-selftest[Yocto Project wiki].
201 201
202== Manual provisoning 202== Manual provisoning
203
203As described in <<sota-related-variables-in-localconf,SOTA-related variables in local.conf>> section you can set `SOTA_DEPLOY_CREDENTIALS` to `0` to prevent deploying credentials to the built `wic` image. In this case you get a generic image that you can use e.g. on a production line to flash a series of devices. The cost of this approach is that this image is half-baked and should be provisioned before it can connect to the backend. 204As described in <<sota-related-variables-in-localconf,SOTA-related variables in local.conf>> section you can set `SOTA_DEPLOY_CREDENTIALS` to `0` to prevent deploying credentials to the built `wic` image. In this case you get a generic image that you can use e.g. on a production line to flash a series of devices. The cost of this approach is that this image is half-baked and should be provisioned before it can connect to the backend.
204 205
205Provisioning procedure depends on your provisioning recipe, i.e. the value of `SOTA_CLIENT_PROV` (equal to `aktualizr-auto-prov` by default). 206Provisioning procedure depends on your provisioning recipe, i.e. the value of `SOTA_CLIENT_PROV` (equal to `aktualizr-auto-prov` by default):
207
206* For `aktualizr-auto-prov` put your `credentials.zip` to `/var/sota/sota_provisioning_credentials.zip` on the filesystem of a running device. If you have the filesystem of our device mounted to your build machine, prefix all paths with `/ostree/deploy/poky` as in `/ostree/deploy/poky/var/sota/sota_provisioning_credentials.zip`. 208* For `aktualizr-auto-prov` put your `credentials.zip` to `/var/sota/sota_provisioning_credentials.zip` on the filesystem of a running device. If you have the filesystem of our device mounted to your build machine, prefix all paths with `/ostree/deploy/poky` as in `/ostree/deploy/poky/var/sota/sota_provisioning_credentials.zip`.
207* For `aktualizr-ca-implicit-prov` 209* For `aktualizr-ca-implicit-prov`
208** put URL to the used backend (together with protocol prefix and port number) to `/var/sota/gateway.url`. If you're using HERE OTA Connect, you can find the URL in `autoprov.url` file in your credentials archive. 210** put URL to the backend server (together with protocol prefix and port number) at `/var/sota/gateway.url`. If you're using HERE OTA Connect, you can find the URL in the `autoprov.url` file in your credentials archive.
209** put client certificate, private key and root CA certificate (for the *server*, not for the *device*) to `/var/sota/import/client.pem`, `/var/sota/import/pkey.pem` and `/var/sota/import/root.crt` respectively. 211** put client certificate, private key and root CA certificate (for the *server*, not for the *device*) at `/var/sota/import/client.pem`, `/var/sota/import/pkey.pem` and `/var/sota/import/root.crt` respectively.
210* For `aktualizr-hsm-prov` 212* For `aktualizr-hsm-prov`
211** put URL to the used backend (together with protocol prefix and port number) to `/var/sota/gateway.url`. If you're using HERE OTA Connect, you can find the URL in `autoprov.url` file in your credentials archive. 213** put URL to the server backend (together with protocol prefix and port number) at `/var/sota/gateway.url`. If you're using HERE OTA Connect, you can find the URL in the `autoprov.url` file in your credentials archive.
212** put root CA certificate (for the *server*, not for the *device*) to `/var/sota/import/root.crt`. 214** put root CA certificate (for the *server*, not for the *device*) at `/var/sota/import/root.crt`.
213** put client certificate and private key to slots 1 and 2 of the PKCS#11-compatible device. 215** put client certificate and private key to slots 1 and 2 of the PKCS#11-compatible device.
diff --git a/lib/oeqa/selftest/cases/updater.py b/lib/oeqa/selftest/cases/updater.py
index 38bdcbf..715a137 100644
--- a/lib/oeqa/selftest/cases/updater.py
+++ b/lib/oeqa/selftest/cases/updater.py
@@ -102,9 +102,6 @@ class AktualizrToolsTests(OESelftestTestCase):
102 logger.info('Running bitbake to build aktualizr-native tools') 102 logger.info('Running bitbake to build aktualizr-native tools')
103 bitbake('aktualizr-native') 103 bitbake('aktualizr-native')
104 104
105 def test_implicit_writer_help(self):
106 akt_native_run(self, 'aktualizr_implicit_writer --help')
107
108 def test_cert_provider_help(self): 105 def test_cert_provider_help(self):
109 akt_native_run(self, 'aktualizr_cert_provider --help') 106 akt_native_run(self, 'aktualizr_cert_provider --help')
110 107
@@ -150,8 +147,6 @@ class AutoProvTests(OESelftestTestCase):
150 self.meta_qemu = None 147 self.meta_qemu = None
151 self.append_config('MACHINE = "qemux86-64"') 148 self.append_config('MACHINE = "qemux86-64"')
152 self.append_config('SOTA_CLIENT_PROV = " aktualizr-auto-prov "') 149 self.append_config('SOTA_CLIENT_PROV = " aktualizr-auto-prov "')
153 # Test aktualizr-example-interface package.
154 self.append_config('IMAGE_INSTALL_append = " aktualizr-examples aktualizr-example-interface "')
155 self.qemu, self.s = qemu_launch(machine='qemux86-64') 150 self.qemu, self.s = qemu_launch(machine='qemux86-64')
156 151
157 def tearDownLocal(self): 152 def tearDownLocal(self):
@@ -185,12 +180,6 @@ class AutoProvTests(OESelftestTestCase):
185 self.assertTrue(ran_ok, 'aktualizr-info failed: ' + stderr.decode() + stdout.decode()) 180 self.assertTrue(ran_ok, 'aktualizr-info failed: ' + stderr.decode() + stdout.decode())
186 181
187 verifyProvisioned(self, machine) 182 verifyProvisioned(self, machine)
188 # Test aktualizr-example-interface package.
189 stdout, stderr, retcode = self.qemu_command('aktualizr-info')
190 self.assertIn(b'hardware ID: example1', stdout,
191 'Legacy secondary initialization failed: ' + stderr.decode() + stdout.decode())
192 self.assertIn(b'hardware ID: example2', stdout,
193 'Legacy secondary initialization failed: ' + stderr.decode() + stdout.decode())
194 183
195 184
196class ManualControlTests(OESelftestTestCase): 185class ManualControlTests(OESelftestTestCase):
@@ -236,6 +225,7 @@ class ManualControlTests(OESelftestTestCase):
236 self.assertIn(b'Fetched metadata: yes', stdout, 225 self.assertIn(b'Fetched metadata: yes', stdout,
237 'Aktualizr should have run' + stderr.decode() + stdout.decode()) 226 'Aktualizr should have run' + stderr.decode() + stdout.decode())
238 227
228
239class RpiTests(OESelftestTestCase): 229class RpiTests(OESelftestTestCase):
240 230
241 def setUpLocal(self): 231 def setUpLocal(self):
@@ -562,6 +552,7 @@ class HsmTests(OESelftestTestCase):
562 552
563 verifyProvisioned(self, machine) 553 verifyProvisioned(self, machine)
564 554
555
565class SecondaryTests(OESelftestTestCase): 556class SecondaryTests(OESelftestTestCase):
566 @classmethod 557 @classmethod
567 def setUpClass(cls): 558 def setUpClass(cls):
diff --git a/recipes-sota/aktualizr/aktualizr_git.bb b/recipes-sota/aktualizr/aktualizr_git.bb
index 29164ed..50a9f16 100755
--- a/recipes-sota/aktualizr/aktualizr_git.bb
+++ b/recipes-sota/aktualizr/aktualizr_git.bb
@@ -26,7 +26,8 @@ SRC_URI = " \
26 file://aktualizr-secondary.socket \ 26 file://aktualizr-secondary.socket \
27 file://aktualizr-serialcan.service \ 27 file://aktualizr-serialcan.service \
28 " 28 "
29SRCREV = "512ad74c0b5339ca7775d8c9461b565a9e6ff5b3" 29
30SRCREV = "3c1c77c005fc1f872f1e12080528ed6f8a32bbf3"
30BRANCH ?= "master" 31BRANCH ?= "master"
31 32
32S = "${WORKDIR}/git" 33S = "${WORKDIR}/git"
@@ -48,7 +49,6 @@ EXTRA_OECMAKE = "-DWARNING_AS_ERROR=OFF \
48 -DAKTUALIZR_VERSION=${PV} \ 49 -DAKTUALIZR_VERSION=${PV} \
49 -DBUILD_LOAD_TESTS=OFF" 50 -DBUILD_LOAD_TESTS=OFF"
50EXTRA_OECMAKE_append_class-target = " -DBUILD_OSTREE=ON \ 51EXTRA_OECMAKE_append_class-target = " -DBUILD_OSTREE=ON \
51 -DBUILD_ISOTP=ON \
52 ${@bb.utils.contains('SOTA_CLIENT_FEATURES', 'hsm', '-DBUILD_P11=ON', '', d)} " 52 ${@bb.utils.contains('SOTA_CLIENT_FEATURES', 'hsm', '-DBUILD_P11=ON', '', d)} "
53EXTRA_OECMAKE_append_class-native = " -DBUILD_SOTA_TOOLS=ON \ 53EXTRA_OECMAKE_append_class-native = " -DBUILD_SOTA_TOOLS=ON \
54 -DBUILD_OSTREE=OFF \ 54 -DBUILD_OSTREE=OFF \
@@ -57,8 +57,6 @@ EXTRA_OECMAKE_append_class-native = " -DBUILD_SOTA_TOOLS=ON \
57 -DGARAGE_SIGN_SHA256=${GARAGE_SIGN_SHA256}" 57 -DGARAGE_SIGN_SHA256=${GARAGE_SIGN_SHA256}"
58 58
59do_install_append () { 59do_install_append () {
60 rm -fr ${D}${libdir}/systemd
61 rm -f ${D}${libdir}/sota/sota.toml # Only needed for the Debian package
62 install -d ${D}${libdir}/sota 60 install -d ${D}${libdir}/sota
63 install -m 0644 ${S}/config/sota_autoprov.toml ${D}/${libdir}/sota/sota_autoprov.toml 61 install -m 0644 ${S}/config/sota_autoprov.toml ${D}/${libdir}/sota/sota_autoprov.toml
64 install -m 0644 ${S}/config/sota_autoprov_primary.toml ${D}/${libdir}/sota/sota_autoprov_primary.toml 62 install -m 0644 ${S}/config/sota_autoprov_primary.toml ${D}/${libdir}/sota/sota_autoprov_primary.toml
@@ -96,16 +94,12 @@ FILES_${PN} = " \
96 " 94 "
97 95
98FILES_${PN}-examples = " \ 96FILES_${PN}-examples = " \
99 ${libdir}/sota/demo_secondary.json \
100 ${bindir}/example-interface \
101 ${bindir}/isotp-test-interface \
102 ${bindir}/hmi_stub \ 97 ${bindir}/hmi_stub \
103 " 98 "
104 99
105FILES_${PN}-host-tools = " \ 100FILES_${PN}-host-tools = " \
106 ${bindir}/aktualizr-repo \ 101 ${bindir}/aktualizr-repo \
107 ${bindir}/aktualizr_cert_provider \ 102 ${bindir}/aktualizr_cert_provider \
108 ${bindir}/aktualizr_implicit_writer \
109 ${bindir}/garage-deploy \ 103 ${bindir}/garage-deploy \
110 ${bindir}/garage-push \ 104 ${bindir}/garage-push \
111 ${libdir}/sota/sota_autoprov.toml \ 105 ${libdir}/sota/sota_autoprov.toml \
diff --git a/recipes-sota/config/aktualizr-example-interface.bb b/recipes-sota/config/aktualizr-example-interface.bb
deleted file mode 100644
index ac75352..0000000
--- a/recipes-sota/config/aktualizr-example-interface.bb
+++ /dev/null
@@ -1,21 +0,0 @@
1SUMMARY = "Aktualizr example interface"
2DESCRIPTION = "Aktualizr example interface for legacy secondaries"
3HOMEPAGE = "https://github.com/advancedtelematic/aktualizr"
4SECTION = "base"
5LICENSE = "MPL-2.0"
6LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MPL-2.0;md5=815ca599c9df247a0c7f619bab123dad"
7
8SRC_URI = " \
9 file://30-example-interface.toml \
10 "
11
12do_install_append () {
13 install -m 0700 -d ${D}${libdir}/sota/conf.d
14 install -m 0644 ${WORKDIR}/30-example-interface.toml ${D}${libdir}/sota/conf.d/30-example-interface.toml
15}
16
17FILES_${PN} = " \
18 ${libdir}/sota/conf.d/30-example-interface.toml \
19 "
20
21# vim:set ts=4 sw=4 sts=4 expandtab:
diff --git a/recipes-sota/config/files/30-example-interface.toml b/recipes-sota/config/files/30-example-interface.toml
deleted file mode 100644
index fc4e9ec..0000000
--- a/recipes-sota/config/files/30-example-interface.toml
+++ /dev/null
@@ -1,2 +0,0 @@
1[uptane]
2legacy_interface = "/usr/bin/example-interface"
diff --git a/recipes-sota/ostree/ostree_git.bb b/recipes-sota/ostree/ostree_git.bb
index 501d636..3e3c951 100644
--- a/recipes-sota/ostree/ostree_git.bb
+++ b/recipes-sota/ostree/ostree_git.bb
@@ -15,7 +15,7 @@ S = "${WORKDIR}/git"
15 15
16BBCLASSEXTEND = "native" 16BBCLASSEXTEND = "native"
17 17
18DEPENDS += "attr bison-native libarchive libcap glib-2.0 gpgme libgsystem fuse e2fsprogs curl xz" 18DEPENDS += "attr bison-native libarchive libcap glib-2.0 gpgme fuse e2fsprogs curl xz"
19DEPENDS += "${@bb.utils.filter('DISTRO_FEATURES', 'systemd', d)}" 19DEPENDS += "${@bb.utils.filter('DISTRO_FEATURES', 'systemd', d)}"
20RDEPENDS_${PN}-dracut = "bash" 20RDEPENDS_${PN}-dracut = "bash"
21 21
diff --git a/recipes-support/libgsystem/libgsystem_git.bb b/recipes-support/libgsystem/libgsystem_git.bb
deleted file mode 100644
index e2b362f..0000000
--- a/recipes-support/libgsystem/libgsystem_git.bb
+++ /dev/null
@@ -1,40 +0,0 @@
1SUMMARY = "GIO-based library, targeted primarily for use by operating system components"
2LICENSE = "GPLv2+"
3LIC_FILES_CHKSUM = "file://COPYING;md5=5f30f0716dfdd0d91eb439ebec522ec2"
4
5SRC_URI = "gitsm://github.com/GNOME/libgsystem.git"
6SRCREV="d606bec68ddfea78de4b03c3f3568afb71bdc1ce"
7
8S = "${WORKDIR}/git"
9
10inherit autotools-brokensep gobject-introspection
11
12DEPENDS += "attr glib-2.0 pkgconfig libcap gtk-doc-native gpgme"
13RDEPENDS_${PN} = "xz "
14RDEPENDS_${PN}_append = "${@bb.utils.contains('DISTRO_FEATURES', 'systemd', ' systemd', '', d)}"
15
16RDEPENDS_${PN}_remove_class-native = "systemd-native"
17
18BBCLASSEXTEND = "native"
19
20export STAGING_INCDIR
21export STAGING_LIBDIR
22
23do_configure() {
24 #NOCONFIGURE=true ./autogen.sh
25 autoreconf -vfi
26 oe_runconf
27}
28
29do_compile_prepend() {
30 export BUILD_SYS="${BUILD_SYS}"
31 export HOST_SYS="${HOST_SYS}"
32}
33
34FILES_${PN} += " \
35 ${datadir} \
36 ${datadir}/gir-1.0 \
37 ${datadir}/gir-1.0/GSystem-1.0.gir \
38 ${libdir}/girepository-1.0/ \
39 ${libdir}/girepository-1.0/GSystem-1.0.typelib \
40"