diff options
author | Anton Gerasimov <anton.gerasimov@here.com> | 2018-10-09 16:09:19 +0200 |
---|---|---|
committer | Patrick Vacek <patrickvacek@gmail.com> | 2018-10-30 13:40:19 +0100 |
commit | 6c3f7564ea6fabdb6b882ef0a6f3d24af46979d0 (patch) | |
tree | 462cc9f8e48a86f8319d09dc27a8b20fa7d90f60 | |
parent | 824e5a7c9c4241d0f32ee777768b00249b47ad8a (diff) | |
download | meta-updater-6c3f7564ea6fabdb6b882ef0a6f3d24af46979d0.tar.gz |
Document version overriding and add warnings
-rw-r--r-- | README.adoc | 10 | ||||
-rw-r--r-- | classes/image_types_ostree.bbclass | 2 | ||||
-rw-r--r-- | classes/target_version_example.bbclass | 3 |
3 files changed, 13 insertions, 2 deletions
diff --git a/README.adoc b/README.adoc index cccba9f..189a4d8 100644 --- a/README.adoc +++ b/README.adoc | |||
@@ -170,6 +170,16 @@ There are a few settings that can be controlled in `local.conf` to simplify the | |||
170 | | `TOOLCHAIN_HOST_TASK_append = " nativesdk-cmake "` | Use with `bitbake -c populate_sdk core-image-minimal` to build an SDK. See the https://github.com/advancedtelematic/aktualizr#developing-against-an-openembedded-system[aktualizr repo] for more information. | 170 | | `TOOLCHAIN_HOST_TASK_append = " nativesdk-cmake "` | Use with `bitbake -c populate_sdk core-image-minimal` to build an SDK. See the https://github.com/advancedtelematic/aktualizr#developing-against-an-openembedded-system[aktualizr repo] for more information. |
171 | |====================== | 171 | |====================== |
172 | 172 | ||
173 | === Overriding target version | ||
174 | *Warning: overriding target version is a dangerous operation, make sure you understand this section completely before doing it.* | ||
175 | |||
176 | Every time you build an image with `SOTA_PACKED_CREDENTIALS` set, a new entry in your Uptane metadata is created and you can see it in the OTA Garage UI if you're using one. Normally this version will be equal to OSTree hash of your root file system. If you want it to be different though you can override is using one of two methods: | ||
177 | |||
178 | 1. Set `GARAGE_TARGET_VERSION` variable in your `local.conf`. | ||
179 | 2. Write a recipe or a bbclass to write the desired version to `${STAGING_DATADIR_NATIVE}/target_version`. An example of such bbclass can be found in `classes/target_version_example.bbclass`. | ||
180 | |||
181 | Please note that [target name, target version] pairs are expected to be unique in the system. If you build a new target with the same target version as a previously build one, the old package will be overwritten on the update server. It can have unpredictable effect on devices that have this version installed, it is not guaranteed that information will be reported correctly for such devices or that you will be able to update them (we're doing our best though). The easiest way to avoid problems is to make sure that your overriding version is as unique as OSTree commit hash. | ||
182 | |||
173 | == QA with oe-selftest | 183 | == QA with oe-selftest |
174 | 184 | ||
175 | This layer relies on the test framework oe-selftest for quality assurance. Follow the steps below to run the tests: | 185 | This layer relies on the test framework oe-selftest for quality assurance. Follow the steps below to run the tests: |
diff --git a/classes/image_types_ostree.bbclass b/classes/image_types_ostree.bbclass index bcbb648..74282ef 100644 --- a/classes/image_types_ostree.bbclass +++ b/classes/image_types_ostree.bbclass | |||
@@ -219,8 +219,10 @@ IMAGE_CMD_garagesign () { | |||
219 | target_version=${ostree_target_hash} | 219 | target_version=${ostree_target_hash} |
220 | if [ -n "${GARAGE_TARGET_VERSION}" ]; then | 220 | if [ -n "${GARAGE_TARGET_VERSION}" ]; then |
221 | target_version=${GARAGE_TARGET_VERSION} | 221 | target_version=${GARAGE_TARGET_VERSION} |
222 | bbwarn "Target version is overriden with GARAGE_TARGET_VERSION variable. It is a dangerous operation, make sure you've read the respective secion in meta-updater/README.adoc" | ||
222 | elif [ -e "${STAGING_DATADIR_NATIVE}/target_version" ]; then | 223 | elif [ -e "${STAGING_DATADIR_NATIVE}/target_version" ]; then |
223 | target_version=$(cat "${STAGING_DATADIR_NATIVE}/target_version") | 224 | target_version=$(cat "${STAGING_DATADIR_NATIVE}/target_version") |
225 | bbwarn "Target version is overriden with target_version file. It is a dangerous operation, make sure you've read the respective secion in meta-updater/README.adoc" | ||
224 | fi | 226 | fi |
225 | 227 | ||
226 | # Push may fail due to race condition when multiple build machines try to push simultaneously | 228 | # Push may fail due to race condition when multiple build machines try to push simultaneously |
diff --git a/classes/target_version_example.bbclass b/classes/target_version_example.bbclass index 5adf159..ef119fb 100644 --- a/classes/target_version_example.bbclass +++ b/classes/target_version_example.bbclass | |||
@@ -1,5 +1,4 @@ | |||
1 | # Writes uses repo manifest version as a target version | 1 | # Writes target version to be used by garage-sign |
2 | # | ||
3 | 2 | ||
4 | HOSTTOOLS += " git " | 3 | HOSTTOOLS += " git " |
5 | 4 | ||