summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPatrick Vacek <patrickvacek@gmail.com>2018-10-31 13:33:23 +0100
committerGitHub <noreply@github.com>2018-10-31 13:33:23 +0100
commitd1a709a28fb4a708681bc3b2d868551b1910f1f3 (patch)
treeb54d5d4577c01f269ea85ceff45934def6717e5b
parent405c54c8effd39f8bd8a6a77d3ecd298b5196f25 (diff)
parentf7c8b67ecf9b4983b380d107de98113f2af4d0cf (diff)
downloadmeta-updater-d1a709a28fb4a708681bc3b2d868551b1910f1f3.tar.gz
Merge pull request #415 from advancedtelematic/refactor/rocko/rm-implicit-writer
Refactor/rocko/rm implicit writer
-rw-r--r--CONTRIBUTING.adoc14
-rw-r--r--README.adoc11
-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, 25 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 d648774..0eb0451 100644
--- a/README.adoc
+++ b/README.adoc
@@ -210,15 +210,16 @@ oe-selftest --run-tests updater
210For 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]. 210For 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].
211 211
212== Manual provisoning 212== Manual provisoning
213
213As 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. 214As 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.
214 215
215Provisioning procedure depends on your provisioning recipe, i.e. the value of `SOTA_CLIENT_PROV` (equal to `aktualizr-auto-prov` by default). 216Provisioning procedure depends on your provisioning recipe, i.e. the value of `SOTA_CLIENT_PROV` (equal to `aktualizr-auto-prov` by default):
216 217
217* 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`. 218* 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`.
218* For `aktualizr-ca-implicit-prov` 219* For `aktualizr-ca-implicit-prov`
219** 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. 220** 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.
220** 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. 221** 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.
221* For `aktualizr-hsm-prov` 222* For `aktualizr-hsm-prov`
222** 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. 223** 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.
223** put root CA certificate (for the *server*, not for the *device*) to `/var/sota/import/root.crt`. 224** put root CA certificate (for the *server*, not for the *device*) at `/var/sota/import/root.crt`.
224** put client certificate and private key to slots 1 and 2 of the PKCS#11-compatible device. 225** 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 7ef834e..3c17b8a 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 8e4b8f5..9823943 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"
@@ -49,7 +50,6 @@ EXTRA_OECMAKE = "-DWARNING_AS_ERROR=OFF \
49 -DBUILD_LOAD_TESTS=OFF \ 50 -DBUILD_LOAD_TESTS=OFF \
50 -Dgtest_disable_pthreads=ON" 51 -Dgtest_disable_pthreads=ON"
51EXTRA_OECMAKE_append_class-target = " -DBUILD_OSTREE=ON \ 52EXTRA_OECMAKE_append_class-target = " -DBUILD_OSTREE=ON \
52 -DBUILD_ISOTP=ON \
53 ${@bb.utils.contains('SOTA_CLIENT_FEATURES', 'hsm', '-DBUILD_P11=ON', '', d)} " 53 ${@bb.utils.contains('SOTA_CLIENT_FEATURES', 'hsm', '-DBUILD_P11=ON', '', d)} "
54EXTRA_OECMAKE_append_class-native = " -DBUILD_SOTA_TOOLS=ON \ 54EXTRA_OECMAKE_append_class-native = " -DBUILD_SOTA_TOOLS=ON \
55 -DBUILD_OSTREE=OFF \ 55 -DBUILD_OSTREE=OFF \
@@ -58,8 +58,6 @@ EXTRA_OECMAKE_append_class-native = " -DBUILD_SOTA_TOOLS=ON \
58 -DGARAGE_SIGN_SHA256=${GARAGE_SIGN_SHA256}" 58 -DGARAGE_SIGN_SHA256=${GARAGE_SIGN_SHA256}"
59 59
60do_install_append () { 60do_install_append () {
61 rm -fr ${D}${libdir}/systemd
62 rm -f ${D}${libdir}/sota/sota.toml # Only needed for the Debian package
63 install -d ${D}${libdir}/sota 61 install -d ${D}${libdir}/sota
64 install -m 0644 ${S}/config/sota_autoprov.toml ${D}/${libdir}/sota/sota_autoprov.toml 62 install -m 0644 ${S}/config/sota_autoprov.toml ${D}/${libdir}/sota/sota_autoprov.toml
65 install -m 0644 ${S}/config/sota_autoprov_primary.toml ${D}/${libdir}/sota/sota_autoprov_primary.toml 63 install -m 0644 ${S}/config/sota_autoprov_primary.toml ${D}/${libdir}/sota/sota_autoprov_primary.toml
@@ -97,16 +95,12 @@ FILES_${PN} = " \
97 " 95 "
98 96
99FILES_${PN}-examples = " \ 97FILES_${PN}-examples = " \
100 ${libdir}/sota/demo_secondary.json \
101 ${bindir}/example-interface \
102 ${bindir}/isotp-test-interface \
103 ${bindir}/hmi_stub \ 98 ${bindir}/hmi_stub \
104 " 99 "
105 100
106FILES_${PN}-host-tools = " \ 101FILES_${PN}-host-tools = " \
107 ${bindir}/aktualizr-repo \ 102 ${bindir}/aktualizr-repo \
108 ${bindir}/aktualizr_cert_provider \ 103 ${bindir}/aktualizr_cert_provider \
109 ${bindir}/aktualizr_implicit_writer \
110 ${bindir}/garage-deploy \ 104 ${bindir}/garage-deploy \
111 ${bindir}/garage-push \ 105 ${bindir}/garage-push \
112 ${libdir}/sota/sota_autoprov.toml \ 106 ${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"