diff options
author | Ricardo Salveti <ricardo@opensourcefoundries.com> | 2018-03-29 15:47:26 -0300 |
---|---|---|
committer | Ricardo Salveti <ricardo@opensourcefoundries.com> | 2018-03-29 15:47:26 -0300 |
commit | 82a9c20ffb045011b53f3188d04d79f440ee8b06 (patch) | |
tree | 8309cc593f59861ed4848dea09b09b3f04e18416 /README.adoc | |
parent | 2619e3f3312713f4077d83b2f2e5f9c7de66d12b (diff) | |
parent | b1a114da280a05cfc2b7b099c97101bd20cc6b8f (diff) | |
download | meta-updater-82a9c20ffb045011b53f3188d04d79f440ee8b06.tar.gz |
Merge remote-tracking branch 'origin/rocko' into rocko-merge
Signed-off-by: Ricardo Salveti <ricardo@opensourcefoundries.com>
Diffstat (limited to 'README.adoc')
-rw-r--r-- | README.adoc | 46 |
1 files changed, 31 insertions, 15 deletions
diff --git a/README.adoc b/README.adoc index 403e0f8..980fa81 100644 --- a/README.adoc +++ b/README.adoc | |||
@@ -17,10 +17,10 @@ If you don't already have a Yocto project that you want to add OTA to, you can u | |||
17 | If you already have a Yocto-based project and you want to add atomic filesystem updates to it, you just need to do three things: | 17 | If you already have a Yocto-based project and you want to add atomic filesystem updates to it, you just need to do three things: |
18 | 18 | ||
19 | 1. Clone the `meta-updater` layer and add it to your https://www.yoctoproject.org/docs/2.1/ref-manual/ref-manual.html#structure-build-conf-bblayers.conf[bblayers.conf]. | 19 | 1. Clone the `meta-updater` layer and add it to your https://www.yoctoproject.org/docs/2.1/ref-manual/ref-manual.html#structure-build-conf-bblayers.conf[bblayers.conf]. |
20 | 2. Clone BSP integration layer (meta-updater-$\{PLATFORM}, e.g. https://github.com/advancedtelematic/meta-updater-raspberrypi[meta-updater-raspberrypi]) and add it to your conf/bblayers.conf. If your board isn't supported yet, you could write a BSP integration for it yourself. See the <<Adding support for your board>> section for the details. | 20 | 2. Clone BSP integration layer (`meta-updater-$\{PLATFORM}`, e.g. https://github.com/advancedtelematic/meta-updater-raspberrypi[meta-updater-raspberrypi]) and add it to your `conf/bblayers.conf`. If your board isn't supported yet, you could write a BSP integration for it yourself. See the <<Adding support for your board>> section for the details. |
21 | 3. Set up your https://www.yoctoproject.org/docs/2.1/ref-manual/ref-manual.html#var-DISTRO[distro]. If you are using "poky", the default distro in Yocto, you can change it in your conf/local.conf to "poky-sota". Alternatively, if you are using your own or third party distro configuration, you can add 'INHERIT += " sota"' to it, thus combining capabilities of your distro with meta-updater features. | 21 | 3. Set up your https://www.yoctoproject.org/docs/2.1/ref-manual/ref-manual.html#var-DISTRO[distro]. If you are using "poky", the default distro in Yocto, you can change it in your `conf/local.conf` to "poky-sota". Alternatively, if you are using your own or third party distro configuration, you can add `INHERIT += " sota"` to it, thus combining capabilities of your distro with meta-updater features. |
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 <<sota-related-variables-in-localconf,variables in your local.conf>>. |
24 | 24 | ||
25 | === Build in AGL | 25 | === Build in AGL |
26 | 26 | ||
@@ -30,19 +30,19 @@ With AGL you can just add agl-sota feature while configuring your build environm | |||
30 | source meta-agl/scripts/aglsetup.sh -m porter agl-demo agl-appfw-smack agl-devel agl-sota | 30 | source meta-agl/scripts/aglsetup.sh -m porter agl-demo agl-appfw-smack agl-devel agl-sota |
31 | .... | 31 | .... |
32 | 32 | ||
33 | you can then run | 33 | You can then run: |
34 | 34 | ||
35 | .... | 35 | .... |
36 | bitbake agl-demo-platform | 36 | bitbake agl-demo-platform |
37 | .... | 37 | .... |
38 | 38 | ||
39 | and get as a result an "ostree_repo" folder in your images directory (tmp/deploy/images/$\{MACHINE}/ostree_repo). It will contain | 39 | and get as a result an `ostree_repo` folder in your images directory (`tmp/deploy/images/$\{MACHINE}/ostree_repo`). It will contain: |
40 | 40 | ||
41 | * your OSTree repository, with the rootfs committed as an OSTree deployment, | 41 | * your OSTree repository, with the rootfs committed as an OSTree deployment, |
42 | * an 'otaimg' bootstrap image, which is an OSTree physical sysroot as a burnable filesystem image, and optionally | 42 | * an `otaimg` bootstrap image, which is an OSTree physical sysroot as a burnable filesystem image, and optionally |
43 | * some machine-dependent live images (e.g. '_.rpi-sdimg-ota' for Raspberry Pi or '_.porter-sdimg-ota' Renesas Porter board). | 43 | * some machine-dependent live images (e.g. `.rpi-sdimg-ota` for Raspberry Pi or `.porter-sdimg-ota` Renesas Porter board). |
44 | 44 | ||
45 | 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. |
46 | 46 | ||
47 | === Build problems | 47 | === Build problems |
48 | 48 | ||
@@ -80,8 +80,8 @@ Although we have used U-Boot so far, other boot loaders can be configured work w | |||
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. | 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. |
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]. | 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]. |
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. | 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). | 83 | * `SOTA_CLIENT_FEATURES` - extensions to aktualizr. The only valid option is `hsm` (to build with HSM support) |
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"`. | 84 | * `SOTA_LEGACY_SECONDARY_INTERFACE` - path to a https://github.com/advancedtelematic/aktualizr/blob/master/docs/legacysecondary.adoc[legacy secondary interface] installed on the device. To use the example interface from the Aktualizr repo, use `/usr/bin/example-interface` and make sure `IMAGE_INSTALL_append` includes `aktualizr-examples`. |
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. | 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`. | 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`. |
87 | 87 | ||
@@ -133,20 +133,36 @@ The https://github.com/advancedtelematic/aktualizr[aktualizr repo] contains a to | |||
133 | garage-push --repo=/path/to/ostree-repo --ref=mybranch --credentials=/path/to/credentials.zip | 133 | garage-push --repo=/path/to/ostree-repo --ref=mybranch --credentials=/path/to/credentials.zip |
134 | .... | 134 | .... |
135 | 135 | ||
136 | You can set SOTA_PACKED_CREDENTIALS in your local.conf to make your build results be automatically synchronized with a remote server. Credentials are stored in the JSON format described in the https://github.com/advancedtelematic/aktualizr/blob/master/README.sotatools.adoc[garage-push README]. This JSON file can be optionally stored inside a zip file, although if it is stored this way, the JSON file must be named treehub.json. | 136 | You can set `SOTA_PACKED_CREDENTIALS` in your `local.conf` to automatically synchronize your build results with a remote server. Credentials are stored in an archive as described in the https://github.com/advancedtelematic/aktualizr/blob/master/docs/credentials.adoc[aktualizr documentation]. |
137 | 137 | ||
138 | === QA | 138 | == QA with `oe-selftest` |
139 | 139 | ||
140 | This layer relies on the test framework oe-selftest for quality assurance. Follow the steps below to run the tests: | 140 | This layer relies on the test framework oe-selftest for quality assurance. Follow the steps below to run the tests: |
141 | 141 | ||
142 | * Append the line below to conf/local.conf | 142 | 1. Append the line below to `conf/local.conf` to disable the warning about supported operating systems: |
143 | + | ||
144 | ``` | ||
145 | SANITY_TESTED_DISTROS = "" | ||
146 | ``` | ||
143 | 147 | ||
148 | 2. If your image does not already include an ssh daemon such as dropbear or openssh, add this line to `conf/local.conf` as well: | ||
149 | + | ||
144 | ``` | 150 | ``` |
145 | SANITY_TESTED_DISTROS="" | 151 | IMAGE_INSTALL_append = " dropbear " |
146 | ``` | 152 | ``` |
147 | 153 | ||
148 | * Run oe-selftest: | 154 | 3. Some tests require that `SOTA_PACKED_CREDENTIALS` is set in your `conf/local.conf`. See the <<sota-related-variables-in-localconf,SOTA-related variables in local.conf>> section. |
155 | |||
156 | 4. To be able to build an image for the grub tests, you will need to install https://github.com/tianocore/tianocore.github.io/wiki/OVMF[TianoCore's ovmf] package on your host system. On Debian-like systems, you can do so with this command: | ||
157 | + | ||
158 | ``` | ||
159 | sudo apt install ovmf | ||
160 | ``` | ||
149 | 161 | ||
162 | 5. Run oe-selftest: | ||
163 | + | ||
150 | ``` | 164 | ``` |
151 | oe-selftest --run-tests updater | 165 | oe-selftest --run-tests updater |
152 | ``` | 166 | ``` |
167 | |||
168 | For 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]. | ||