Skip to content

Commit

Permalink
podvm-mkosi: fix Architecture cannot be used in Match
Browse files Browse the repository at this point in the history
mkosi version in nix is 17.1,
which doesn't support Architecture in [Match]
As a workaround, use a flag files instead

Signed-off-by: Lei Li <[email protected]>
Signed-off-by: Lei Li <[email protected]>
  • Loading branch information
Lei Li authored and Qi Feng Huo committed Mar 29, 2024
1 parent a554e6d commit d12a5be
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 4 deletions.
7 changes: 6 additions & 1 deletion src/cloud-api-adaptor/podvm-mkosi/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -45,26 +45,31 @@ binaries:
PHONY: image
image:
@echo "Enabling production preset..."
rm -rf resources/buildDebugImage
rm -rf resources/build*Image
rm -rf ./build
@echo "Building image..."
ifeq ($(ARCH),s390x)
touch resources/buildS390xImage
mkosi --profile production.conf
../hack/build-s390x-image.sh
else
touch resources/buildBootableImage
nix develop ..#podvm-mkosi --command mkosi --environment=VARIANT_ID=production
endif

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 ($(ARCH),s390x)
touch resources/buildS390xImage
mkosi --profile debug.conf
../hack/build-s390x-image.sh
else
touch resources/buildBootableImage
nix develop ..#podvm-mkosi --command mkosi --environment=VARIANT_ID=debug
endif

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
[Match]
Distribution=fedora

Architecture=s390x
# 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

[Content]
Packages=kernel-core
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
[Match]
Distribution=fedora

Architecture=!s390x
# 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

[Content]
Packages=systemd-boot
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
[Match]
Distribution=fedora

Architecture=s390x
# 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

[Content]
Bootable=no
Expand Down

0 comments on commit d12a5be

Please sign in to comment.