summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorChristian Breunig <christian@breunig.cc>2026-02-21 20:45:02 +0100
committerChristian Breunig <christian@breunig.cc>2026-02-21 20:59:57 +0100
commit84b87400edcdff85f701c819daf6eeceb3805d0b (patch)
tree523c66c28db987d55aceb8f296c7add7b01f78f8 /Makefile
parent2d0c394feea707431db39f450a19cb93564c1168 (diff)
downloadvyos-build-84b87400edcdff85f701c819daf6eeceb3805d0b.tar.gz
vyos-build-84b87400edcdff85f701c819daf6eeceb3805d0b.zip
Makefile: T8294: autodetect CPU architecture for smoketests
We currently have hardcoded values for amd64 in our Makefile. When calling the smoketests helpers like: * make testc * make qemu-live * make test-interfaces All expect an amd64 ISO file - if building and arm64 ISO image on an arm64 system, all those helpers do not work as it is hardcoded to amd64.
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile37
1 files changed, 19 insertions, 18 deletions
diff --git a/Makefile b/Makefile
index da82e378..0cb5a8d6 100644
--- a/Makefile
+++ b/Makefile
@@ -1,8 +1,9 @@
SHELL := /bin/bash
-
-arch ?= $(shell dpkg --print-architecture 2>/dev/null || echo amd64)
build_dir := build
+ARCH := $(shell dpkg-architecture -qDEB_HOST_ARCH)
+ISO_PATH := $(build_dir)/live-image-$(ARCH).hybrid.iso
+
.PHONY: all
all:
@echo "Make what specifically?"
@@ -14,60 +15,60 @@ all:
.PHONY: checkiso
.ONESHELL:
checkiso:
- if [ ! -f build/live-image-$(arch).hybrid.iso ]; then
- echo "Could not find build/live-image-$(arch).hybrid.iso"
+ if [ ! -f $(ISO_PATH) ]; then
+ echo "Could not find $(ISO_PATH)"
exit 1
fi
.PHONY: test
.ONESHELL:
test: checkiso
- scripts/check-qemu-install --debug --configd --match="$(MATCH)" --smoketest --uefi --cpu 4 --memory 8 --iso build/live-image-amd64.hybrid.iso $(filter-out $@,$(MAKECMDGOALS))
+ scripts/check-qemu-install --debug --configd --match="$(MATCH)" --smoketest --uefi --cpu 4 --memory 8 --iso $(ISO_PATH) $(filter-out $@,$(MAKECMDGOALS))
.PHONY: test-no-interfaces
.ONESHELL:
test-no-interfaces: checkiso
- scripts/check-qemu-install --debug --configd --smoketest --uefi --no-interfaces --cpu 4 --memory 8 --huge-page-size 2M --huge-page-count 1800 --iso build/live-image-amd64.hybrid.iso
+ scripts/check-qemu-install --debug --configd --smoketest --uefi --no-interfaces --cpu 4 --memory 8 --huge-page-size 2M --huge-page-count 1800 --iso $(ISO_PATH) $(filter-out $@,$(MAKECMDGOALS))
.PHONY: test-no-interfaces-no-vpp
.ONESHELL:
test-no-interfaces-no-vpp: checkiso
- scripts/check-qemu-install --debug --configd --smoketest --uefi --no-interfaces --no-vpp --arch $(arch) --iso build/live-image-$(arch).hybrid.iso
+ scripts/check-qemu-install --debug --configd --smoketest --uefi --no-interfaces --no-vpp --iso $(ISO_PATH) $(filter-out $@,$(MAKECMDGOALS))
.PHONY: test-interfaces
.ONESHELL:
test-interfaces: checkiso
- scripts/check-qemu-install --debug --configd --match="interfaces_" --smoketest --uefi --iso build/live-image-amd64.hybrid.iso
+ scripts/check-qemu-install --debug --configd --match="interfaces_" --smoketest --uefi --iso $(ISO_PATH) $(filter-out $@,$(MAKECMDGOALS))
.PHONY: test-vpp
.ONESHELL:
test-vpp: checkiso
- scripts/check-qemu-install --debug --configd --match="vpp" --smoketest --uefi --cpu 4 --memory 8 --huge-page-size 2M --huge-page-count 1800 --iso build/live-image-amd64.hybrid.iso
+ scripts/check-qemu-install --debug --configd --match="vpp" --smoketest --uefi --cpu 4 --memory 8 --huge-page-size 2M --huge-page-count 1800 --iso $(ISO_PATH) $(filter-out $@,$(MAKECMDGOALS))
.PHONY: testc
.ONESHELL:
testc: checkiso
- scripts/check-qemu-install --debug --configd --match="!vpp" --cpu 2 --memory 7 --configtest --iso build/live-image-amd64.hybrid.iso $(filter-out $@,$(MAKECMDGOALS))
+ scripts/check-qemu-install --debug --configd --match="!vpp" --cpu 2 --memory 7 --configtest --iso $(ISO_PATH) $(filter-out $@,$(MAKECMDGOALS))
.PHONY: testcvpp
.ONESHELL:
testcvpp: checkiso
- scripts/check-qemu-install --debug --configd --match="vpp" --cpu 4 --memory 8 --huge-page-size 2M --huge-page-count 1800 --configtest --iso build/live-image-amd64.hybrid.iso $(filter-out $@,$(MAKECMDGOALS))
+ scripts/check-qemu-install --debug --configd --match="vpp" --cpu 4 --memory 8 --huge-page-size 2M --huge-page-count 1800 --configtest --iso $(ISO_PATH) $(filter-out $@,$(MAKECMDGOALS))
.PHONY: testraid
.ONESHELL:
testraid: checkiso
- scripts/check-qemu-install --debug --configd --raid --iso build/live-image-amd64.hybrid.iso $(filter-out $@,$(MAKECMDGOALS))
+ scripts/check-qemu-install --debug --configd --raid --iso $(ISO_PATH) $(filter-out $@,$(MAKECMDGOALS))
.PHONY: testsb
.ONESHELL:
testsb: checkiso
- scripts/check-qemu-install --debug --uefi --sbtest --iso build/live-image-amd64.hybrid.iso $(filter-out $@,$(MAKECMDGOALS))
+ scripts/check-qemu-install --debug --uefi --sbtest --iso $(ISO_PATH) $(filter-out $@,$(MAKECMDGOALS))
.PHONY: testtpm
.ONESHELL:
testtpm: checkiso
- scripts/check-qemu-install --debug --tpmtest --iso build/live-image-amd64.hybrid.iso $(filter-out $@,$(MAKECMDGOALS))
+ scripts/check-qemu-install --debug --tpmtest --iso $(ISO_PATH) $(filter-out $@,$(MAKECMDGOALS))
.PHONY: test-ci-qcow2
.ONESHELL:
@@ -76,18 +77,18 @@ test-ci-qcow2:
echo "Could not find any QCOW2 disk image"
exit 1
fi
- rm -f cloud-init-image-amd64.qcow2 ; cp $$(ls -t build/*.qcow2 | head -n 1) cloud-init-image-amd64.qcow2
- scripts/check-qemu-install --debug --cloud-init --disk cloud-init-image-amd64.qcow2 $(filter-out $@,$(MAKECMDGOALS))
+ rm -f cloud-init-image-$(ARCH).qcow2 ; cp $$(ls -t build/*.qcow2 | head -n 1) cloud-init-image-$(ARCH).qcow2
+ scripts/check-qemu-install --debug --cloud-init --disk cloud-init-image-$(ARCH).qcow2 $(filter-out $@,$(MAKECMDGOALS))
.PHONY: qemu-live
.ONESHELL:
qemu-live: checkiso
- scripts/check-qemu-install --qemu-cmd --iso build/live-image-amd64.hybrid.iso $(filter-out $@,$(MAKECMDGOALS))
+ scripts/check-qemu-install --qemu-cmd --iso $(ISO_PATH) $(filter-out $@,$(MAKECMDGOALS))
.PHONY: oci
.ONESHELL:
oci: checkiso
- scripts/iso-to-oci build/live-image-amd64.hybrid.iso
+ scripts/iso-to-oci $(ISO_PATH)
.PHONY: clean
.ONESHELL: