summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPatrick Vacek <patrickvacek@gmail.com>2018-11-13 17:13:49 +0100
committerGitHub <noreply@github.com>2018-11-13 17:13:49 +0100
commitdc878039e6059ac5835c4d11c1c561603c62e810 (patch)
tree79856b19cbcd8c342d52a9ad491310b011fb8ec4
parentd1a709a28fb4a708681bc3b2d868551b1910f1f3 (diff)
parent691eb035bea3a55f7e4257ce837865bec244830e (diff)
downloadmeta-updater-dc878039e6059ac5835c4d11c1c561603c62e810.tar.gz
Merge pull request #429 from advancedtelematic/fix/rocko/newline-etc
Fix/rocko/newline etc
-rw-r--r--CONTRIBUTING.adoc11
-rw-r--r--README.adoc11
-rw-r--r--classes/image_types_ostree.bbclass8
-rw-r--r--recipes-sota/aktualizr/aktualizr-auto-prov.bb4
-rw-r--r--recipes-sota/aktualizr/aktualizr-ca-implicit-prov.bb1
-rw-r--r--recipes-sota/aktualizr/aktualizr-hsm-prov.bb1
-rwxr-xr-xrecipes-sota/aktualizr/aktualizr_git.bb14
-rw-r--r--recipes-sota/aktualizr/environment.inc11
-rw-r--r--recipes-sota/aktualizr/files/aktualizr-secondary.service1
-rw-r--r--recipes-sota/aktualizr/files/aktualizr.service2
-rw-r--r--recipes-test/images/secondary-image.bb4
11 files changed, 33 insertions, 35 deletions
diff --git a/CONTRIBUTING.adoc b/CONTRIBUTING.adoc
index 3d0f14d..f12b95d 100644
--- a/CONTRIBUTING.adoc
+++ b/CONTRIBUTING.adoc
@@ -1,6 +1,15 @@
1= Contributing 1= Contributing
2 2
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:
4
5* thud
6* sumo
7* rocko
8
9Previously, some older branches were also regularly supported, and while they should still be stable, they have not been updated or actively maintained for a while. These branches include:
10
11* pyro
12* morty
4 13
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. 14If 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 15
diff --git a/README.adoc b/README.adoc
index 0eb0451..2f74c1d 100644
--- a/README.adoc
+++ b/README.adoc
@@ -6,7 +6,7 @@ This layer enables over-the-air updates (OTA) with https://github.com/ostreedev/
6 6
7https://github.com/ostreedev/ostree[OSTree] is a tool for atomic full file system upgrades with rollback capability. OSTree has several advantages over traditional dual-bank systems, but the most important one is that it minimizes network bandwidth and data storage footprint by sharing files with the same contents across file system deployments. 7https://github.com/ostreedev/ostree[OSTree] is a tool for atomic full file system upgrades with rollback capability. OSTree has several advantages over traditional dual-bank systems, but the most important one is that it minimizes network bandwidth and data storage footprint by sharing files with the same contents across file system deployments.
8 8
9https://github.com/advancedtelematic/aktualizr[Aktualizr] (and https://github.com/advancedtelematic/rvi_sota_client[RVI SOTA client]) add authentication and provisioning capabilities to OTA and are integrated with OSTree. You can connect with the open-source https://github.com/advancedtelematic/rvi_sota_server[RVI SOTA server] or sign up for a free account at https://app.atsgarage.com[ATS Garage] to get started. 9https://github.com/advancedtelematic/aktualizr[Aktualizr] (and https://github.com/advancedtelematic/rvi_sota_client[RVI SOTA client]) add authentication and provisioning capabilities to OTA and are integrated with OSTree. You can connect with these open-source applications or sign up for a free account at https://connect.ota.here.com/[HERE OTA Connect] to get started.
10 10
11[discrete] 11[discrete]
12== Table of Contents 12== Table of Contents
@@ -17,7 +17,7 @@ toc::[]
17 17
18=== Quickstart 18=== Quickstart
19 19
20If you don't already have a Yocto project that you want to add OTA to, you can use the https://docs.atsgarage.com/quickstarts/raspberry-pi.html[ATS Garage Quickstart] project to rapidly get up and running on a Raspberry Pi. It takes a standard https://www.yoctoproject.org/tools-resources/projects/poky[poky] distribution, and adds OTA and OSTree capabilities. 20If you don't already have a Yocto project that you want to add OTA to, you can use the https://docs.atsgarage.com/quickstarts/raspberry-pi.html[HERE OTA Connect Quickstart] project to rapidly get up and running on a Raspberry Pi. It takes a standard https://www.yoctoproject.org/tools-resources/projects/poky[poky] distribution, and adds OTA and OSTree capabilities.
21 21
22=== Adding meta-updater capabilities to your build 22=== Adding meta-updater capabilities to your build
23 23
@@ -83,8 +83,7 @@ Although we have used U-Boot so far, other boot loaders can be configured work w
83* `SOTA_DEPLOY_CREDENTIALS` - when set to '1' (default value), deploys credentials to the built image. Override it in `local.conf` to built a generic image that can be provisioned manually after the build. 83* `SOTA_DEPLOY_CREDENTIALS` - when set to '1' (default value), deploys credentials to the built image. Override it in `local.conf` to built a generic image that can be provisioned manually after the build.
84* `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-ca-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_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-ca-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.
85* `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_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).
86* `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_SECONDARY_CONFIG_DIR` - a directory containing JSON configuration files for virtual secondaries on the host. These will be installed into `/etc/sota/ecus` on the device and automatically provided to aktualizr.
87* `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`.
88 87
89== Usage 88== Usage
90 89
@@ -128,7 +127,7 @@ ostree admin deploy --os=agl agl-snapshot:agl-ota
128 127
129=== garage-push 128=== garage-push
130 129
131The https://github.com/advancedtelematic/aktualizr[aktualizr repo] contains a tool, garage-push, which lets you push the changes in OSTree repository generated by bitbake process. It communicates with an http server capable of querying files with HEAD requests and uploading them with POST requests. In particular, this can be used with http://www.atsgarage.com/[ATS Garage]. garage-push is used as follows: 130The https://github.com/advancedtelematic/aktualizr[aktualizr repo] contains a tool, garage-push, which lets you push the changes in OSTree repository generated by bitbake process. It communicates with an http server capable of querying files with HEAD requests and uploading them with POST requests. In particular, this can be used with https://connect.ota.here.com/[HERE OTA Connect]. garage-push is used as follows:
132 131
133.... 132....
134garage-push --repo=/path/to/ostree-repo --ref=mybranch --credentials=/path/to/credentials.zip 133garage-push --repo=/path/to/ostree-repo --ref=mybranch --credentials=/path/to/credentials.zip
@@ -145,7 +144,7 @@ First, you can set `SOTA_CLIENT_PROV` to control which provisioning recipe is us
145Second, you can write recipes to install additional config files with customized options. A few recipes already exist to address common needs and provide an example: 144Second, you can write recipes to install additional config files with customized options. A few recipes already exist to address common needs and provide an example:
146 145
147* link:recipes-sota/config/aktualizr-example-interface.bb[aktualizr-example-interface.bb] will configure aktualizr to connect to an example interface for a legacy flasher. This is intended to be used in conjunction with the `aktualizr-examples` package. See https://github.com/advancedtelematic/aktualizr/blob/master/docs/legacysecondary.adoc[legacysecondary.adoc] in the aktualizr repo for more information. 146* link:recipes-sota/config/aktualizr-example-interface.bb[aktualizr-example-interface.bb] will configure aktualizr to connect to an example interface for a legacy flasher. This is intended to be used in conjunction with the `aktualizr-examples` package. See https://github.com/advancedtelematic/aktualizr/blob/master/docs/legacysecondary.adoc[legacysecondary.adoc] in the aktualizr repo for more information.
148* link:recipes-sota/config/aktualizr-disable-send-ip.bb[aktualizr-disable-send-ip.bb] disables the reporting of networking information to the server. This is enabled by default and supported by https://app.atsgarage.com[ATS Garage]. However, if you are using a different server that does not support this feature, you may want to disable it in aktualizr. 147* link:recipes-sota/config/aktualizr-disable-send-ip.bb[aktualizr-disable-send-ip.bb] disables the reporting of networking information to the server. This is enabled by default and supported by https://connect.ota.here.com/[HERE OTA Connect]. However, if you are using a different server that does not support this feature, you may want to disable it in aktualizr.
149* link:recipes-sota/config/aktualizr-log-debug.bb[aktualizr-log-debug.bb] sets the log level of aktualizr to 0 (trace). The default is 2 (info). This recipe is intended for development and debugging purposes. 148* link:recipes-sota/config/aktualizr-log-debug.bb[aktualizr-log-debug.bb] sets the log level of aktualizr to 0 (trace). The default is 2 (info). This recipe is intended for development and debugging purposes.
150 149
151To use these recipes, you will need to add them to your image with a line such as `IMAGE_INSTALL_append = " aktualizr-log-debug "` in your `local.conf`. 150To use these recipes, you will need to add them to your image with a line such as `IMAGE_INSTALL_append = " aktualizr-log-debug "` in your `local.conf`.
diff --git a/classes/image_types_ostree.bbclass b/classes/image_types_ostree.bbclass
index 5a17096..e7ff2c4 100644
--- a/classes/image_types_ostree.bbclass
+++ b/classes/image_types_ostree.bbclass
@@ -6,6 +6,7 @@ do_image_ostree[depends] += "ostree-native:do_populate_sysroot \
6 unzip-native:do_populate_sysroot \ 6 unzip-native:do_populate_sysroot \
7 virtual/kernel:do_deploy \ 7 virtual/kernel:do_deploy \
8 ${OSTREE_INITRAMFS_IMAGE}:do_image_complete" 8 ${OSTREE_INITRAMFS_IMAGE}:do_image_complete"
9do_image_ostree[lockfiles] += "${OSTREE_REPO}/ostree.lock"
9 10
10export OSTREE_REPO 11export OSTREE_REPO
11export OSTREE_BRANCHNAME 12export OSTREE_BRANCHNAME
@@ -122,11 +123,6 @@ IMAGE_CMD_ostree () {
122 ln -sf var/roothome root 123 ln -sf var/roothome root
123 fi 124 fi
124 125
125 if [ -n "${SOTA_SECONDARY_ECUS}" ]; then
126 mkdir -p var/sota/ecus
127 cp ${SOTA_SECONDARY_ECUS} var/sota/ecus
128 fi
129
130 # Creating boot directories is required for "ostree admin deploy" 126 # Creating boot directories is required for "ostree admin deploy"
131 127
132 mkdir -p boot/loader.0 128 mkdir -p boot/loader.0
@@ -151,7 +147,7 @@ IMAGE_CMD_ostree () {
151 rm -f ${DEPLOY_DIR_IMAGE}/${IMAGE_LINK_NAME}.rootfs.ostree.tar.bz2 147 rm -f ${DEPLOY_DIR_IMAGE}/${IMAGE_LINK_NAME}.rootfs.ostree.tar.bz2
152 ln -s ${IMAGE_NAME}.rootfs.ostree.tar.bz2 ${DEPLOY_DIR_IMAGE}/${IMAGE_LINK_NAME}.rootfs.ostree.tar.bz2 148 ln -s ${IMAGE_NAME}.rootfs.ostree.tar.bz2 ${DEPLOY_DIR_IMAGE}/${IMAGE_LINK_NAME}.rootfs.ostree.tar.bz2
153 149
154 if [ ! -d ${OSTREE_REPO} ]; then 150 if ! ostree --repo=${OSTREE_REPO} refs 2>&1 > /dev/null; then
155 ostree --repo=${OSTREE_REPO} init --mode=archive-z2 151 ostree --repo=${OSTREE_REPO} init --mode=archive-z2
156 fi 152 fi
157 153
diff --git a/recipes-sota/aktualizr/aktualizr-auto-prov.bb b/recipes-sota/aktualizr/aktualizr-auto-prov.bb
index 01f21fa..f506cab 100644
--- a/recipes-sota/aktualizr/aktualizr-auto-prov.bb
+++ b/recipes-sota/aktualizr/aktualizr-auto-prov.bb
@@ -12,7 +12,6 @@ PR = "6"
12 12
13SRC_URI = "" 13SRC_URI = ""
14 14
15require environment.inc
16require credentials.inc 15require credentials.inc
17 16
18do_install() { 17do_install() {
@@ -30,7 +29,6 @@ do_install() {
30 fi 29 fi
31 30
32 install -m 0700 -d ${D}${libdir}/sota/conf.d 31 install -m 0700 -d ${D}${libdir}/sota/conf.d
33 install -m 0700 -d ${D}${localstatedir}/sota
34 aktualizr_toml=${@bb.utils.contains('SOTA_CLIENT_FEATURES', 'secondary-network', 'sota_autoprov_primary.toml', 'sota_autoprov.toml', d)} 32 aktualizr_toml=${@bb.utils.contains('SOTA_CLIENT_FEATURES', 'secondary-network', 'sota_autoprov_primary.toml', 'sota_autoprov.toml', d)}
35 33
36 install -m 0644 ${STAGING_DIR_NATIVE}${libdir}/sota/${aktualizr_toml} \ 34 install -m 0644 ${STAGING_DIR_NATIVE}${libdir}/sota/${aktualizr_toml} \
@@ -40,8 +38,6 @@ do_install() {
40FILES_${PN} = " \ 38FILES_${PN} = " \
41 ${libdir}/sota/conf.d \ 39 ${libdir}/sota/conf.d \
42 ${libdir}/sota/conf.d/20-${aktualizr_toml} \ 40 ${libdir}/sota/conf.d/20-${aktualizr_toml} \
43 ${localstatedir}/sota \
44 ${localstatedir}/sota/sota_provisioning_credentials.zip \
45 " 41 "
46 42
47# vim:set ts=4 sw=4 sts=4 expandtab: 43# vim:set ts=4 sw=4 sts=4 expandtab:
diff --git a/recipes-sota/aktualizr/aktualizr-ca-implicit-prov.bb b/recipes-sota/aktualizr/aktualizr-ca-implicit-prov.bb
index 2763185..5893ed2 100644
--- a/recipes-sota/aktualizr/aktualizr-ca-implicit-prov.bb
+++ b/recipes-sota/aktualizr/aktualizr-ca-implicit-prov.bb
@@ -15,7 +15,6 @@ RDEPENDS_${PN}_append = "${@' aktualizr-ca-implicit-prov-creds' if d.getVar('SOT
15PV = "1.0" 15PV = "1.0"
16PR = "1" 16PR = "1"
17 17
18require environment.inc
19require credentials.inc 18require credentials.inc
20 19
21do_install() { 20do_install() {
diff --git a/recipes-sota/aktualizr/aktualizr-hsm-prov.bb b/recipes-sota/aktualizr/aktualizr-hsm-prov.bb
index 151b543..08fffe9 100644
--- a/recipes-sota/aktualizr/aktualizr-hsm-prov.bb
+++ b/recipes-sota/aktualizr/aktualizr-hsm-prov.bb
@@ -12,7 +12,6 @@ SRC_URI = ""
12PV = "1.0" 12PV = "1.0"
13PR = "6" 13PR = "6"
14 14
15require environment.inc
16require credentials.inc 15require credentials.inc
17 16
18do_install() { 17do_install() {
diff --git a/recipes-sota/aktualizr/aktualizr_git.bb b/recipes-sota/aktualizr/aktualizr_git.bb
index 9823943..9cc7c7a 100755
--- a/recipes-sota/aktualizr/aktualizr_git.bb
+++ b/recipes-sota/aktualizr/aktualizr_git.bb
@@ -27,7 +27,7 @@ SRC_URI = " \
27 file://aktualizr-serialcan.service \ 27 file://aktualizr-serialcan.service \
28 " 28 "
29 29
30SRCREV = "3c1c77c005fc1f872f1e12080528ed6f8a32bbf3" 30SRCREV = "4621a15779db38531fb386478232a9e8593e53f4"
31BRANCH ?= "master" 31BRANCH ?= "master"
32 32
33S = "${WORKDIR}/git" 33S = "${WORKDIR}/git"
@@ -70,6 +70,17 @@ do_install_append () {
70 install -m 0644 ${WORKDIR}/aktualizr-secondary.service ${D}${systemd_unitdir}/system/aktualizr-secondary.service 70 install -m 0644 ${WORKDIR}/aktualizr-secondary.service ${D}${systemd_unitdir}/system/aktualizr-secondary.service
71 install -m 0700 -d ${D}${libdir}/sota/conf.d 71 install -m 0700 -d ${D}${libdir}/sota/conf.d
72 install -m 0700 -d ${D}${sysconfdir}/sota/conf.d 72 install -m 0700 -d ${D}${sysconfdir}/sota/conf.d
73
74 if [ -n "${SOTA_SECONDARY_CONFIG_DIR}" ]; then
75 if [ -d "${SOTA_SECONDARY_CONFIG_DIR}" ]; then
76 install -m 0700 -d ${D}${sysconfdir}/sota/ecus
77 install -m 0644 "${SOTA_SECONDARY_CONFIG_DIR}"/* ${D}${sysconfdir}/sota/ecus/
78 echo "[uptane]\nsecondary_configs_dir = /etc/sota/ecus/\n" > ${D}${libdir}/sota/conf.d/30-secondary-configs-dir.toml
79 else
80 bbwarn "SOTA_SECONDARY_CONFIG_DIR is set to an invalid directory (${SOTA_SECONDARY_CONFIG_DIR})"
81 fi
82 fi
83
73} 84}
74 85
75do_install_append_class-target () { 86do_install_append_class-target () {
@@ -92,6 +103,7 @@ FILES_${PN} = " \
92 ${systemd_unitdir}/system/aktualizr.service \ 103 ${systemd_unitdir}/system/aktualizr.service \
93 ${libdir}/sota/conf.d \ 104 ${libdir}/sota/conf.d \
94 ${sysconfdir}/sota/conf.d \ 105 ${sysconfdir}/sota/conf.d \
106 ${sysconfdir}/sota/ecus/* \
95 " 107 "
96 108
97FILES_${PN}-examples = " \ 109FILES_${PN}-examples = " \
diff --git a/recipes-sota/aktualizr/environment.inc b/recipes-sota/aktualizr/environment.inc
deleted file mode 100644
index 16e789e..0000000
--- a/recipes-sota/aktualizr/environment.inc
+++ /dev/null
@@ -1,11 +0,0 @@
1export SOTA_VIRTUAL_SECONDARIES
2
3do_install_append() {
4 for sec in ${SOTA_VIRTUAL_SECONDARIES}; do
5 AKTUALIZR_PARAMETERS_VIRTUALSECS="${AKTUALIZR_PARAMETERS_VIRTUALSECS} --secondary-config $sec"
6 done
7
8 echo "AKTUALIZR_CMDLINE_PARAMETERS=${AKTUALIZR_PARAMETERS_VIRTUALSECS}" > ${D}${libdir}/sota/sota.env
9}
10
11FILES_${PN}_append = " ${libdir}/sota/sota.env"
diff --git a/recipes-sota/aktualizr/files/aktualizr-secondary.service b/recipes-sota/aktualizr/files/aktualizr-secondary.service
index a1e0e1b..9628ee3 100644
--- a/recipes-sota/aktualizr/files/aktualizr-secondary.service
+++ b/recipes-sota/aktualizr/files/aktualizr-secondary.service
@@ -4,6 +4,5 @@ Description=Aktualizr SOTA Client (UPTANE Secondary)
4[Service] 4[Service]
5RestartSec=10 5RestartSec=10
6Restart=always 6Restart=always
7EnvironmentFile=-/etc/sota/sota.env
8ExecStart=/usr/bin/aktualizr-secondary --config /usr/lib/sota/sota_secondary.toml 7ExecStart=/usr/bin/aktualizr-secondary --config /usr/lib/sota/sota_secondary.toml
9 8
diff --git a/recipes-sota/aktualizr/files/aktualizr.service b/recipes-sota/aktualizr/files/aktualizr.service
index 6de4474..726809e 100644
--- a/recipes-sota/aktualizr/files/aktualizr.service
+++ b/recipes-sota/aktualizr/files/aktualizr.service
@@ -5,8 +5,6 @@ After=network.target
5[Service] 5[Service]
6RestartSec=10 6RestartSec=10
7Restart=always 7Restart=always
8EnvironmentFile=/usr/lib/sota/sota.env
9EnvironmentFile=-/etc/sota/sota.env
10ExecStart=/usr/bin/aktualizr $AKTUALIZR_CMDLINE_PARAMETERS 8ExecStart=/usr/bin/aktualizr $AKTUALIZR_CMDLINE_PARAMETERS
11 9
12[Install] 10[Install]
diff --git a/recipes-test/images/secondary-image.bb b/recipes-test/images/secondary-image.bb
index 9adbdc5..1a41169 100644
--- a/recipes-test/images/secondary-image.bb
+++ b/recipes-test/images/secondary-image.bb
@@ -10,9 +10,11 @@ LICENSE = "MIT"
10IMAGE_INSTALL_remove = " \ 10IMAGE_INSTALL_remove = " \
11 aktualizr \ 11 aktualizr \
12 aktualizr-auto-prov \ 12 aktualizr-auto-prov \
13 aktualizr-auto-prov-creds \
13 aktualizr-ca-implicit-prov \ 14 aktualizr-ca-implicit-prov \
15 aktualizr-ca-implicit-prov-creds \
14 aktualizr-hsm-prov \ 16 aktualizr-hsm-prov \
15 aktualizr-implicit-prov \ 17 aktualizr-uboot-env-rollback \
16 connman \ 18 connman \
17 connman-client \ 19 connman-client \
18 " 20 "