summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLuka Pivk <luka.pivk@toradex.com>2018-10-11 20:31:40 +0200
committerLucien Mueller <lucien.mueller@netmodule.com>2018-11-05 09:55:29 +0100
commite98d6f2fe469cd8e6380d45fdb17e81bc02ba2a3 (patch)
tree30d6404c2c3e474028e769ea254a4662e2b22ac5
parent90908710fe16097128c084bc6e1c2321389292f1 (diff)
downloadmeta-updater-e98d6f2fe469cd8e6380d45fdb17e81bc02ba2a3.tar.gz
Added support to automatically update ostree summary
Use OSTREE_UPDATE_SUMMARY to automatically update summary after committing to ostree repo Signed-off-by: Luka Pivk <luka.pivk@toradex.com>
-rw-r--r--README.adoc3
-rw-r--r--classes/image_types_ostree.bbclass7
2 files changed, 9 insertions, 1 deletions
diff --git a/README.adoc b/README.adoc
index aadad2d..2485801 100644
--- a/README.adoc
+++ b/README.adoc
@@ -79,6 +79,9 @@ Although we have used U-Boot so far, other boot loaders can be configured work w
79* `OSTREE_REPO` - path to your OSTree repository. Defaults to `$\{DEPLOY_DIR_IMAGE}/ostree_repo` 79* `OSTREE_REPO` - path to your OSTree repository. Defaults to `$\{DEPLOY_DIR_IMAGE}/ostree_repo`
80* `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_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".
81* `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* `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.
82* `OSTREE_COMMIT_BODY` - Message attached to OSTree commit. Empty by default.
83* `OSTREE_COMMIT_SUBJECT` - Commit subject used by OSTree. Defaults to `Commit-id: ${IMAGE_NAME}`
84* `OSTREE_UPDATE_SUMMARY` - Set this to '1' to update summary of OSTree repository on each commit. '0' by default.
82* `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]. 85* `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].
83* `SOTA_DEPLOY_CREDENTIALS` - when set to '1' (default value), deploys credentials to the built image. Override it in `local.conf` to built a generic image that can be provisioned manually after the build. 86* `SOTA_DEPLOY_CREDENTIALS` - when set to '1' (default value), deploys credentials to the built image. Override it in `local.conf` to built a generic image that can be provisioned manually after the build.
84* `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-ca-implicit-prov`], and https://github.com/advancedtelematic/aktualizr/blob/master/docs/hsm-provisioning.adoc[`aktualizr-hsm-prov`]. The default is `aktualizr-auto-prov`. This can also be set to an empty string to avoid using a provisioning recipe. 87* `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-ca-implicit-prov`], and https://github.com/advancedtelematic/aktualizr/blob/master/docs/hsm-provisioning.adoc[`aktualizr-hsm-prov`]. The default is `aktualizr-auto-prov`. This can also be set to an empty string to avoid using a provisioning recipe.
diff --git a/classes/image_types_ostree.bbclass b/classes/image_types_ostree.bbclass
index 604bac2..b2eb61d 100644
--- a/classes/image_types_ostree.bbclass
+++ b/classes/image_types_ostree.bbclass
@@ -17,6 +17,7 @@ OSTREE_KERNEL ??= "${KERNEL_IMAGETYPE}"
17 17
18OSTREE_COMMIT_SUBJECT ??= "Commit-id: ${IMAGE_NAME}" 18OSTREE_COMMIT_SUBJECT ??= "Commit-id: ${IMAGE_NAME}"
19OSTREE_COMMIT_BODY ??= "" 19OSTREE_COMMIT_BODY ??= ""
20OSTREE_UPDATE_SUMMARY ??= "0"
20 21
21export SYSTEMD_USED = "${@oe.utils.ifelse(d.getVar('VIRTUAL-RUNTIME_init_manager', True) == 'systemd', 'true', '')}" 22export SYSTEMD_USED = "${@oe.utils.ifelse(d.getVar('VIRTUAL-RUNTIME_init_manager', True) == 'systemd', 'true', '')}"
22 23
@@ -165,7 +166,11 @@ IMAGE_CMD_ostree () {
165 --branch=${OSTREE_BRANCHNAME} \ 166 --branch=${OSTREE_BRANCHNAME} \
166 --subject="${OSTREE_COMMIT_SUBJECT}" \ 167 --subject="${OSTREE_COMMIT_SUBJECT}" \
167 --body="${OSTREE_COMMIT_BODY}" 168 --body="${OSTREE_COMMIT_BODY}"
168 169
170 if [ "${OSTREE_UPDATE_SUMMARY}" = "1" ]; then
171 ostree --repo=${OSTREE_REPO} summary -u
172 fi
173
169 rm -rf ${OSTREE_ROOTFS} 174 rm -rf ${OSTREE_ROOTFS}
170} 175}
171 176