diff options
author | Patrick Vacek <patrickvacek@gmail.com> | 2018-11-05 10:58:00 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-11-05 10:58:00 +0100 |
commit | aad99c3f0c2a6d4ce0252946112022a271c8c76d (patch) | |
tree | 60a78aeb5b933eb733133c9b9458a4cce520c1b7 /classes | |
parent | 1a3336314a0efe0609461010b6ea68f5f6e61173 (diff) | |
parent | 718230f01c87c719c16c9ebd9ae6cd943cb15a12 (diff) | |
download | meta-updater-aad99c3f0c2a6d4ce0252946112022a271c8c76d.tar.gz |
Merge pull request #416 from advancedtelematic/feat/OTA-627/sumo/targetversion-forwardport
Feat/ota 627/sumo/targetversion forwardport
Diffstat (limited to 'classes')
-rw-r--r-- | classes/image_types_ostree.bbclass | 6 | ||||
-rw-r--r-- | classes/image_types_ota.bbclass | 2 | ||||
-rw-r--r-- | classes/target_version_example.bbclass | 10 |
3 files changed, 17 insertions, 1 deletions
diff --git a/classes/image_types_ostree.bbclass b/classes/image_types_ostree.bbclass index b2eb61d..819cc6d 100644 --- a/classes/image_types_ostree.bbclass +++ b/classes/image_types_ostree.bbclass | |||
@@ -193,7 +193,7 @@ IMAGE_CMD_ostreepush () { | |||
193 | } | 193 | } |
194 | 194 | ||
195 | IMAGE_TYPEDEP_garagesign = "ostreepush" | 195 | IMAGE_TYPEDEP_garagesign = "ostreepush" |
196 | do_image_garage_sign[depends] += "aktualizr-native:do_populate_sysroot" | 196 | do_image_garagesign[depends] += "aktualizr-native:do_populate_sysroot" |
197 | IMAGE_CMD_garagesign () { | 197 | IMAGE_CMD_garagesign () { |
198 | if [ -n "${SOTA_PACKED_CREDENTIALS}" ]; then | 198 | if [ -n "${SOTA_PACKED_CREDENTIALS}" ]; then |
199 | # if credentials are issued by a server that doesn't support offline signing, exit silently | 199 | # if credentials are issued by a server that doesn't support offline signing, exit silently |
@@ -219,6 +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" | ||
223 | elif [ -e "${STAGING_DATADIR_NATIVE}/target_version" ]; then | ||
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" | ||
222 | fi | 226 | fi |
223 | 227 | ||
224 | # 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/image_types_ota.bbclass b/classes/image_types_ota.bbclass index 4a51f24..df3bc7c 100644 --- a/classes/image_types_ota.bbclass +++ b/classes/image_types_ota.bbclass | |||
@@ -111,6 +111,8 @@ IMAGE_CMD_otaimg () { | |||
111 | target_version=${ostree_target_hash} | 111 | target_version=${ostree_target_hash} |
112 | if [ -n "${GARAGE_TARGET_VERSION}" ]; then | 112 | if [ -n "${GARAGE_TARGET_VERSION}" ]; then |
113 | target_version=${GARAGE_TARGET_VERSION} | 113 | target_version=${GARAGE_TARGET_VERSION} |
114 | elif [ -e "${STAGING_DATADIR_NATIVE}/target_version" ]; then | ||
115 | target_version=$(cat "${STAGING_DATADIR_NATIVE}/target_version") | ||
114 | fi | 116 | fi |
115 | mkdir -p ${PHYS_SYSROOT}/ostree/deploy/${OSTREE_OSNAME}/var/sota/import | 117 | mkdir -p ${PHYS_SYSROOT}/ostree/deploy/${OSTREE_OSNAME}/var/sota/import |
116 | echo "{\"${ostree_target_hash}\":\"${GARAGE_TARGET_NAME}-${target_version}\"}" > ${PHYS_SYSROOT}/ostree/deploy/${OSTREE_OSNAME}/var/sota/import/installed_versions | 118 | echo "{\"${ostree_target_hash}\":\"${GARAGE_TARGET_NAME}-${target_version}\"}" > ${PHYS_SYSROOT}/ostree/deploy/${OSTREE_OSNAME}/var/sota/import/installed_versions |
diff --git a/classes/target_version_example.bbclass b/classes/target_version_example.bbclass new file mode 100644 index 0000000..ef119fb --- /dev/null +++ b/classes/target_version_example.bbclass | |||
@@ -0,0 +1,10 @@ | |||
1 | # Writes target version to be used by garage-sign | ||
2 | |||
3 | HOSTTOOLS += " git " | ||
4 | |||
5 | deploy_target_version () { | ||
6 | version=$(git --git-dir=${METADIR}/.repo/manifests/.git/ rev-parse HEAD) | ||
7 | echo -n ${version} > ${STAGING_DATADIR_NATIVE}/target_version | ||
8 | } | ||
9 | |||
10 | IMAGE_PREPROCESS_COMMAND += "deploy_target_version;" | ||