From 511fca5a7bca179700610d1b87c2f24a251a24cf Mon Sep 17 00:00:00 2001 From: Fabian Vogt Date: Thu, 10 Oct 2024 17:39:12 +0200 Subject: [PATCH 1/3] Always pass --image-version to mkosi Otherwise image builds which use %v fail, sometimes in weird ways. --- build-recipe-mkosi | 3 +++ 1 file changed, 3 insertions(+) diff --git a/build-recipe-mkosi b/build-recipe-mkosi index 99159a3f0..65a05aef7 100644 --- a/build-recipe-mkosi +++ b/build-recipe-mkosi @@ -92,6 +92,9 @@ recipe_build_mkosi() { local image_version="" if [ -n "$RELEASE" ]; then image_version="--image-version=${RELEASE}" + else + # Provide some fallback value for %v specifiers + image_version="--image-version=0" fi set -- mkosi \ --directory "$TOPDIR/SOURCES" \ From a4c19907b52e5749c60f54ab14c7a2620dc1e142 Mon Sep 17 00:00:00 2001 From: Fabian Vogt Date: Thu, 10 Oct 2024 17:39:53 +0200 Subject: [PATCH 2/3] Do not publish the mkosi recipe It would conflict between separate builds in the same repo. --- build-recipe-mkosi | 4 ---- 1 file changed, 4 deletions(-) diff --git a/build-recipe-mkosi b/build-recipe-mkosi index 65a05aef7..b69cdd778 100644 --- a/build-recipe-mkosi +++ b/build-recipe-mkosi @@ -124,10 +124,6 @@ recipe_build_mkosi() { rmdir "$d" done - # copy recipe source file so that it can be published - cp "$BUILD_ROOT/$TOPDIR/SOURCES/$RECIPEFILE" \ - "$BUILD_ROOT/$TOPDIR/OTHER/" - # if present, compress the manifest file(s) which can be quite large for f in "$BUILD_ROOT/$TOPDIR"/OTHER/*.manifest; do if [ ! -f "$f" ]; then From b0433107422a6199625af1550b7f028cf430055a Mon Sep 17 00:00:00 2001 From: Fabian Vogt Date: Thu, 10 Oct 2024 17:53:59 +0200 Subject: [PATCH 3/3] Create .sha256 files after mkosi builds Just do it for all files in OTHER. --- build-recipe-mkosi | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/build-recipe-mkosi b/build-recipe-mkosi index b69cdd778..b1e48e037 100644 --- a/build-recipe-mkosi +++ b/build-recipe-mkosi @@ -132,6 +132,16 @@ recipe_build_mkosi() { gzip -9 -f "$f" done + cat <<-EOF > "$BUILD_ROOT/checksum.sh" + echo "Create sha256 files..." + cd "/$TOPDIR"/OTHER + for f in *; do + [ -f "\$f" ] || continue + /usr/bin/sha256sum "\$f" > "\$f.sha256" + done + EOF + chroot "$BUILD_ROOT" sh /checksum.sh + # shellcheck disable=SC2034 BUILD_SUCCEEDED=true }