From f2cf964b132f0ab462264daaf017a9a533dbd667 Mon Sep 17 00:00:00 2001 From: Stefan Agner Date: Fri, 2 Nov 2018 10:46:38 +0100 Subject: classes: image_types_ostree: check OSTree repo existence using ostree Currently we assume if the OSTree repo exists, that there is a OSTree repo in it. This does not need to be true in general, and when using lockfiles bitbake will create the directory before the do_image_ostree task is executed the first time. Use ostree refs to detect whether the target directory contains a OSTree repo. Signed-off-by: Stefan Agner --- classes/image_types_ostree.bbclass | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'classes') diff --git a/classes/image_types_ostree.bbclass b/classes/image_types_ostree.bbclass index 3bf2d0e..d74b7ae 100644 --- a/classes/image_types_ostree.bbclass +++ b/classes/image_types_ostree.bbclass @@ -155,7 +155,7 @@ IMAGE_CMD_ostree () { rm -f ${DEPLOY_DIR_IMAGE}/${IMAGE_LINK_NAME}.rootfs.ostree.tar.bz2 ln -s ${IMAGE_NAME}.rootfs.ostree.tar.bz2 ${DEPLOY_DIR_IMAGE}/${IMAGE_LINK_NAME}.rootfs.ostree.tar.bz2 - if [ ! -d ${OSTREE_REPO} ]; then + if ! ostree --repo=${OSTREE_REPO} refs 2>&1 > /dev/null; then ostree --repo=${OSTREE_REPO} init --mode=archive-z2 fi -- cgit v1.2.3-54-g00ecf