Skip to content

Commit

Permalink
ci: use profile instead of marker files
Browse files Browse the repository at this point in the history
more recent version of mkosi can use Profile & Architecture in matches
clauses.

Signed-off-by: Magnus Kulke <magnuskulke@microsoft.com>
  • Loading branch information
mkulke committed Jan 13, 2025
1 parent 6a6757a commit 291e3f3
Show file tree
Hide file tree
Showing 8 changed files with 7 additions and 36 deletions.
1 change: 0 additions & 1 deletion .github/workflows/podvm_mkosi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,6 @@ jobs:
run: |
sudo du --max-depth=2 /home/runner || true
sudo du --max-depth=2 /var/lib || true
sudo rm -rf /nix
sudo rm -rf ./build
sudo rm -rf ./mkosi.cache
Expand Down
7 changes: 0 additions & 7 deletions src/cloud-api-adaptor/podvm-mkosi/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -82,19 +79,15 @@ PHONY: image-debug
image-debug:
@echo "Enabling debug preset..."
rm -rf resources/build*Image
touch resources/buildDebugImage
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
Expand Down
Original file line number Diff line number Diff line change
@@ -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]
Packages=kernel-core
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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]
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand Down

0 comments on commit 291e3f3

Please sign in to comment.