diff options
Diffstat (limited to 'README.adoc')
-rw-r--r-- | README.adoc | 52 |
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 | ||
3 | This 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]. | 3 | This layer enables over-the-air updates (OTA) with https://github.com/ostreedev/ostree[OSTree] and https://github.com/advancedtelematic/aktualizr[Aktualizr]. |
4 | 4 | ||
5 | https://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. | 5 | https://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 | ||
7 | https://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. | 7 | https://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 | ||
23 | You 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>>. | 23 | You 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 | ||
29 | With AGL you can just add agl-sota feature while configuring your build environment: | 27 | With 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 | ||
47 | Although aglsetup.sh hooks provide reasonable defaults for SOTA-related variables, you may want to tune some of them. | 45 | Although aglsetup.sh hooks provide reasonable defaults for SOTA-related variables, you may want to tune some of them. |
48 | 46 | ||
47 | === Build problems | ||
48 | |||
49 | Multilib systems may require adding this line to `local.conf`: | ||
50 | |||
51 | .... | ||
52 | HOSTTOOLS += "x86_64-linux-gnu-gcc" | ||
53 | .... | ||
54 | |||
55 | Ubuntu 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 | ||
51 | Currently supported platforms are | 59 | Currently 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 | ||
80 | OSTree 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].) | 92 | OSTree 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 | |||
82 | To expose your repo, run ostree trivial-httpd using any free port: | ||
83 | 93 | ||
84 | .... | 94 | .... |
85 | ostree trivial-httpd tmp/deploy/images/qemux86-64/ostree_repo -P 57556 | 95 | cd tmp/deploy/images/qemux86-64/ostree_repo |
96 | python -m SimpleHTTPServer <port> # port defaults to 8000 | ||
86 | .... | 97 | .... |
87 | 98 | ||
88 | You can then run ostree from inside your device by adding your repo: | 99 | You 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 |
92 | ostree remote add --no-gpg-verify my-remote http://192.168.7.1:57556 ota | 103 | ostree 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 |
95 | ostree pull my-remote ota | 106 | # branch. If not set, it defaults to the value of MACHINE (e.g. qemux86-64). |
107 | ostree 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 |
98 | ostree admin deploy --os=poky my-remote:ota | 110 | ostree admin deploy --os=poky my-remote:<branch> |
99 | .... | 111 | .... |
100 | 112 | ||
101 | After restarting, you will boot into the newly deployed OS image. | 113 | After 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 | ``` |
139 | oe-selftest --run-tests garage_push | 151 | oe-selftest --run-tests updater |
140 | ``` | 152 | ``` |