summaryrefslogtreecommitdiffstats
path: root/README.adoc
diff options
context:
space:
mode:
Diffstat (limited to 'README.adoc')
-rw-r--r--README.adoc52
1 files changed, 32 insertions, 20 deletions
diff --git a/README.adoc b/README.adoc
index 0097670..403e0f8 100644
--- a/README.adoc
+++ b/README.adoc
@@ -1,10 +1,10 @@
1= meta-updater 1= meta-updater
2 2
3This layer enables over-the-air updates (OTA) with https://github.com/ostreedev/ostree[OSTree] and https://github.com/advancedtelematic/rvi_sota_client[RVI SOTA client]. 3This layer enables over-the-air updates (OTA) with https://github.com/ostreedev/ostree[OSTree] and https://github.com/advancedtelematic/aktualizr[Aktualizr].
4 4
5https://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. 5https://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.
6 6
7https://github.com/advancedtelematic/rvi_sota_client[RVI SOTA client] and/or https://github.com/advancedtelematic/aktualizr[aktualizr] 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. 7https://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.
8 8
9== Build 9== Build
10 10
@@ -22,8 +22,6 @@ If you already have a Yocto-based project and you want to add atomic filesystem
22 22
23You can then build your image as usual, with bitbake. After building the root file system, bitbake will then create an https://ostree.readthedocs.io/en/latest/manual/adapting-existing/[OSTree-enabled version] of it, commit it to your local OSTree repo and (optionally) push it to a remote server. Additionally, a live disk image will be created (normally named $\{IMAGE_NAME}.-sdimg-ota e.g. core-image-raspberrypi3.rpi-sdimg-ota). You can control this behaviour through <<variables in your local.conf,OSTree-related variables in your local.conf>>. 23You can then build your image as usual, with bitbake. After building the root file system, bitbake will then create an https://ostree.readthedocs.io/en/latest/manual/adapting-existing/[OSTree-enabled version] of it, commit it to your local OSTree repo and (optionally) push it to a remote server. Additionally, a live disk image will be created (normally named $\{IMAGE_NAME}.-sdimg-ota e.g. core-image-raspberrypi3.rpi-sdimg-ota). You can control this behaviour through <<variables in your local.conf,OSTree-related variables in your local.conf>>.
24 24
25=== Build with OpenIVI
26
27=== Build in AGL 25=== Build in AGL
28 26
29With AGL you can just add agl-sota feature while configuring your build environment: 27With AGL you can just add agl-sota feature while configuring your build environment:
@@ -46,6 +44,16 @@ and get as a result an "ostree_repo" folder in your images directory (tmp/deploy
46 44
47Although aglsetup.sh hooks provide reasonable defaults for SOTA-related variables, you may want to tune some of them. 45Although aglsetup.sh hooks provide reasonable defaults for SOTA-related variables, you may want to tune some of them.
48 46
47=== Build problems
48
49Multilib systems may require adding this line to `local.conf`:
50
51....
52HOSTTOOLS += "x86_64-linux-gnu-gcc"
53....
54
55Ubuntu users that encounter an error due to missing `Python.h` should install `libpython2.7-dev` on their host machine.
56
49== Supported boards 57== Supported boards
50 58
51Currently supported platforms are 59Currently supported platforms are
@@ -67,35 +75,39 @@ Although we have used U-Boot so far, other boot loaders can be configured work w
67 75
68== SOTA-related variables in local.conf 76== SOTA-related variables in local.conf
69 77
70* OSTREE_REPO - path to your OSTree repository. Defaults to "$\{DEPLOY_DIR_IMAGE}/ostree_repo" 78* `OSTREE_REPO` - path to your OSTree repository. Defaults to `$\{DEPLOY_DIR_IMAGE}/ostree_repo`
71* OSTREE_BRANCHNAME - the branch your rootfs will be committed to. Defaults to "ota" 79* `OSTREE_OSNAME` - OS deployment name on your target device. For more information about deployments and osnames see the https://ostree.readthedocs.io/en/latest/manual/deployment/[OSTree documentation]. Defaults to "poky".
72* OSTREE_OSNAME - OS deployment name on your target device. For more information about deployments and osnames see the https://ostree.readthedocs.io/en/latest/manual/deployment/[OSTree documentation]. Defaults to "poky". 80* `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.
73* 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* `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].
74* 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 JSON credentials file in https://github.com/advancedtelematic/sota-tools#credentials[the format accepted by garage-push]. 82* `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 `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_FEATURES` - extensions to aktualizr. Multiple can be specified if separated by spaces. Valid options are `hsm` (to build with HSM support) and `secondary-example` (to install an example https://github.com/advancedtelematic/aktualizr/blob/master/docs/legacysecondary.adoc[legacy secondary interface] in the image).
84* `SOTA_LEGACY_SECONDARY_INTERFACE` - path to a legacy secondary interface installed on the device. To use the example interface from the Aktualizr repo, use `/usr/bin/example-interface` and make sure `SOTA_CLIENT_FEATURES = "secondary-example"`.
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`.
75 87
76== Usage 88== Usage
77 89
78=== OSTree 90=== OSTree
79 91
80OSTree includes its own simple http server. It just exposes the whole OSTree repository to the network so that any remote device can pull data from it to device's local repository. To use the OSTree http server, you will need OSTree installed on your build machine. (Alternatively, you could run version built inside Yocto using bitbake's http://www.openembedded.org/wiki/Devshell[devshell].) 92OSTree used to include a simple HTTP server as part of the ostree binary, but this has been removed in more recent versions. However, OSTree repositories are self-contained directories, and can be trivially served over the network using any HTTP server. For example, you could use Python's SimpleHTTPServer:
81
82To expose your repo, run ostree trivial-httpd using any free port:
83 93
84.... 94....
85ostree trivial-httpd tmp/deploy/images/qemux86-64/ostree_repo -P 57556 95cd tmp/deploy/images/qemux86-64/ostree_repo
96python -m SimpleHTTPServer <port> # port defaults to 8000
86.... 97....
87 98
88You can then run ostree from inside your device by adding your repo: 99You can then run ostree from inside your device by adding your repo:
89 100
90.... 101....
91# agl-remote identifies the remote server in your local repo 102# This behaves like adding a Git remote; you can name it anything
92ostree remote add --no-gpg-verify my-remote http://192.168.7.1:57556 ota 103ostree remote add --no-gpg-verify my-remote http://<your-ip>:<port>
93 104
94# ota is a branch name in the remote repo, set in OSTREE_BRANCHNAME 105# If OSTREE_BRANCHNAME is set in local.conf, that will be the name of the
95ostree pull my-remote ota 106# branch. If not set, it defaults to the value of MACHINE (e.g. qemux86-64).
107ostree pull my-remote <branch>
96 108
97# poky is OS name as set in OSTREE_OSNAME 109# poky is the OS name as set in OSTREE_OSNAME
98ostree admin deploy --os=poky my-remote:ota 110ostree admin deploy --os=poky my-remote:<branch>
99.... 111....
100 112
101After restarting, you will boot into the newly deployed OS image. 113After restarting, you will boot into the newly deployed OS image.
@@ -136,5 +148,5 @@ SANITY_TESTED_DISTROS=""
136* Run oe-selftest: 148* Run oe-selftest:
137 149
138``` 150```
139oe-selftest --run-tests garage_push 151oe-selftest --run-tests updater
140``` 152```