From 441c6527710005c0cc676ae3e688c8e63fe6ee7d Mon Sep 17 00:00:00 2001 From: Luka Pivk Date: Thu, 4 Oct 2018 10:39:31 +0200 Subject: Added support to set custom commit subject and body Use OSTREE_COMMIT_BODY write custom text to ostree body Use OSTREE_COMMIT_SUBJECT to write custom subject Signed-off-by: Luka Pivk --- classes/image_types_ostree.bbclass | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'classes') diff --git a/classes/image_types_ostree.bbclass b/classes/image_types_ostree.bbclass index a5d43dc..af87e28 100644 --- a/classes/image_types_ostree.bbclass +++ b/classes/image_types_ostree.bbclass @@ -14,6 +14,9 @@ export GARAGE_TARGET_NAME OSTREE_KERNEL ??= "${KERNEL_IMAGETYPE}" +OSTREE_COMMIT_SUBJECT ??= "Commit-id: ${IMAGE_NAME}" +OSTREE_COMMIT_BODY ??= "" + export SYSTEMD_USED = "${@oe.utils.ifelse(d.getVar('VIRTUAL-RUNTIME_init_manager', True) == 'systemd', 'true', '')}" IMAGE_CMD_ostree () { @@ -160,8 +163,9 @@ IMAGE_CMD_ostree () { --tree=dir=${OSTREE_ROOTFS} \ --skip-if-unchanged \ --branch=${OSTREE_BRANCHNAME} \ - --subject="Commit-id: ${IMAGE_NAME}" - + --subject="${OSTREE_COMMIT_SUBJECT}" \ + --body="${OSTREE_COMMIT_BODY}" + rm -rf ${OSTREE_ROOTFS} } -- cgit v1.2.3-54-g00ecf From 2af450bc64021c2ebc2e82a59a209e56276bad4f Mon Sep 17 00:00:00 2001 From: Luka Pivk Date: Thu, 11 Oct 2018 20:31:40 +0200 Subject: 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 --- README.adoc | 3 +++ classes/image_types_ostree.bbclass | 7 ++++++- 2 files changed, 9 insertions(+), 1 deletion(-) (limited to 'classes') diff --git a/README.adoc b/README.adoc index 03a588a..3f9c392 100644 --- a/README.adoc +++ b/README.adoc @@ -78,6 +78,9 @@ Although we have used U-Boot so far, other boot loaders can be configured work w * `OSTREE_REPO` - path to your OSTree repository. Defaults to `$\{DEPLOY_DIR_IMAGE}/ostree_repo` * `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". +* `OSTREE_COMMIT_BODY` - Message attached to OSTree commit. Empty by default. +* `OSTREE_COMMIT_SUBJECT` - Commit subject used by OSTree. Defaults to `Commit-id: ${IMAGE_NAME}` +* `OSTREE_UPDATE_SUMMARY` - Set this to '1' to update summary of OSTree repository on each commit. '0' by default. * `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. * `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]. * `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. diff --git a/classes/image_types_ostree.bbclass b/classes/image_types_ostree.bbclass index af87e28..3bf2d0e 100644 --- a/classes/image_types_ostree.bbclass +++ b/classes/image_types_ostree.bbclass @@ -16,6 +16,7 @@ OSTREE_KERNEL ??= "${KERNEL_IMAGETYPE}" OSTREE_COMMIT_SUBJECT ??= "Commit-id: ${IMAGE_NAME}" OSTREE_COMMIT_BODY ??= "" +OSTREE_UPDATE_SUMMARY ??= "0" export SYSTEMD_USED = "${@oe.utils.ifelse(d.getVar('VIRTUAL-RUNTIME_init_manager', True) == 'systemd', 'true', '')}" @@ -165,7 +166,11 @@ IMAGE_CMD_ostree () { --branch=${OSTREE_BRANCHNAME} \ --subject="${OSTREE_COMMIT_SUBJECT}" \ --body="${OSTREE_COMMIT_BODY}" - + + if [ "${OSTREE_UPDATE_SUMMARY}" = "1" ]; then + ostree --repo=${OSTREE_REPO} summary -u + fi + rm -rf ${OSTREE_ROOTFS} } -- cgit v1.2.3-54-g00ecf