From e54d04d96d8c3e418a6a8026861c4e684477860a Mon Sep 17 00:00:00 2001 From: Magnus Kulke Date: Fri, 10 Jan 2025 12:37:45 +0100 Subject: [PATCH] ci: use profile instead of marker files more recent version of mkosi can use Profile & Architecture in matches clauses. Signed-off-by: Magnus Kulke --- src/cloud-api-adaptor/podvm-mkosi/Makefile | 6 ------ .../mkosi.presets/system/mkosi.conf.d/fedora-bootable.conf | 7 +------ .../system/mkosi.conf.d/fedora-debug-aux.conf | 7 ++----- .../system/mkosi.conf.d/fedora-debug-keys.conf | 3 +-- .../mkosi.presets/system/mkosi.conf.d/fedora-debug.conf | 4 +--- .../mkosi.presets/system/mkosi.conf.d/fedora-s390x.conf | 7 +------ 6 files changed, 6 insertions(+), 28 deletions(-) diff --git a/src/cloud-api-adaptor/podvm-mkosi/Makefile b/src/cloud-api-adaptor/podvm-mkosi/Makefile index 9e28750e87..0052d7d9e5 100644 --- a/src/cloud-api-adaptor/podvm-mkosi/Makefile +++ b/src/cloud-api-adaptor/podvm-mkosi/Makefile @@ -65,15 +65,12 @@ image: rm -rf ./build @echo "Building image..." ifeq ($(SE_BOOT),true) - touch resources/buildS390xImage sudo mkosi --profile production.conf --image system sudo -E ../hack/build-s390x-se-image.sh else ifeq ($(ARCH),s390x) - touch resources/buildS390xImage sudo mkosi --profile production.conf --image system sudo -E ../hack/build-s390x-image.sh else - touch resources/buildBootableImage mkosi --profile production.conf qemu-img convert -f raw -O qcow2 build/system.raw build/podvm-$(PODVM_DISTRO)-$(ARCH).qcow2 endif @@ -86,15 +83,12 @@ image-debug: rm -rf ./build @echo "Building debug image..." ifeq ($(SE_BOOT),true) - touch resources/buildS390xImage sudo mkosi --profile debug.conf sudo -E ../hack/build-s390x-se-image.sh else ifeq ($(ARCH),s390x) - touch resources/buildS390xImage sudo mkosi --profile debug.conf sudo -E ../hack/build-s390x-image.sh else - touch resources/buildBootableImage mkosi --profile debug.conf qemu-img convert -f raw -O qcow2 build/system.raw build/podvm-$(PODVM_DISTRO)-$(ARCH).qcow2 endif diff --git a/src/cloud-api-adaptor/podvm-mkosi/mkosi.presets/system/mkosi.conf.d/fedora-bootable.conf b/src/cloud-api-adaptor/podvm-mkosi/mkosi.presets/system/mkosi.conf.d/fedora-bootable.conf index 432feea101..9130e25575 100644 --- a/src/cloud-api-adaptor/podvm-mkosi/mkosi.presets/system/mkosi.conf.d/fedora-bootable.conf +++ b/src/cloud-api-adaptor/podvm-mkosi/mkosi.presets/system/mkosi.conf.d/fedora-bootable.conf @@ -1,11 +1,6 @@ [Match] Distribution=fedora - -# mkosi version in nix is 17.1, -# which doesn't support Architecture in [Match] -# As a workaround, use a flag file instead. -#Architecture=!s390x -PathExists=../../resources/buildBootableImage +Architecture=!s390x [Content] Packages=systemd-boot diff --git a/src/cloud-api-adaptor/podvm-mkosi/mkosi.presets/system/mkosi.conf.d/fedora-debug-aux.conf b/src/cloud-api-adaptor/podvm-mkosi/mkosi.presets/system/mkosi.conf.d/fedora-debug-aux.conf index 564920f610..3d659eebef 100644 --- a/src/cloud-api-adaptor/podvm-mkosi/mkosi.presets/system/mkosi.conf.d/fedora-debug-aux.conf +++ b/src/cloud-api-adaptor/podvm-mkosi/mkosi.presets/system/mkosi.conf.d/fedora-debug-aux.conf @@ -1,12 +1,9 @@ [Match] Distribution=fedora - -PathExists=../../resources/buildDebugImage - +Profile=debug # Overwrite default ssh config, but conflict with # cloud-init which is installed for s390x. -#Architecture=!s390x -PathExists=../../resources/buildBootableImage +Architecture=!s390x [Content] ExtraTrees=../../mkosi.skeleton-debug diff --git a/src/cloud-api-adaptor/podvm-mkosi/mkosi.presets/system/mkosi.conf.d/fedora-debug-keys.conf b/src/cloud-api-adaptor/podvm-mkosi/mkosi.presets/system/mkosi.conf.d/fedora-debug-keys.conf index e6c2ab8758..284a7f40c8 100644 --- a/src/cloud-api-adaptor/podvm-mkosi/mkosi.presets/system/mkosi.conf.d/fedora-debug-keys.conf +++ b/src/cloud-api-adaptor/podvm-mkosi/mkosi.presets/system/mkosi.conf.d/fedora-debug-keys.conf @@ -1,7 +1,6 @@ [Match] Distribution=fedora -# Only for debug images and if authorized_keys exists -PathExists=../../resources/buildDebugImage +Profile=debug PathExists=../../resources/authorized_keys [Content] diff --git a/src/cloud-api-adaptor/podvm-mkosi/mkosi.presets/system/mkosi.conf.d/fedora-debug.conf b/src/cloud-api-adaptor/podvm-mkosi/mkosi.presets/system/mkosi.conf.d/fedora-debug.conf index f8b3d1e04c..d94602ff8d 100644 --- a/src/cloud-api-adaptor/podvm-mkosi/mkosi.presets/system/mkosi.conf.d/fedora-debug.conf +++ b/src/cloud-api-adaptor/podvm-mkosi/mkosi.presets/system/mkosi.conf.d/fedora-debug.conf @@ -1,8 +1,6 @@ [Match] Distribution=fedora -# This is a little hack to define different image types in a mkosi config. -# There is also imageId, but it renames the output, which is not what we want. -PathExists=../../resources/buildDebugImage +Profile=debug [Content] Autologin=true diff --git a/src/cloud-api-adaptor/podvm-mkosi/mkosi.presets/system/mkosi.conf.d/fedora-s390x.conf b/src/cloud-api-adaptor/podvm-mkosi/mkosi.presets/system/mkosi.conf.d/fedora-s390x.conf index 10fa3af540..f1832a20b6 100644 --- a/src/cloud-api-adaptor/podvm-mkosi/mkosi.presets/system/mkosi.conf.d/fedora-s390x.conf +++ b/src/cloud-api-adaptor/podvm-mkosi/mkosi.presets/system/mkosi.conf.d/fedora-s390x.conf @@ -1,11 +1,6 @@ [Match] Distribution=fedora - -# mkosi version in nix is 17.1, -# which doesn't support Architecture in [Match] -# As a workaround, use a flag file instead. -#Architecture=s390x -PathExists=../../resources/buildS390xImage +Architecture=s390x [Content] Bootable=no