From: Andrew Ruthven <p...@catalyst.net.nz> --- Makefile | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-)
diff --git a/Makefile b/Makefile index 9f4a6d7..21962e1 100644 --- a/Makefile +++ b/Makefile @@ -5,6 +5,8 @@ UPPER_CLOUD = $(shell echo $(CLOUD) | tr '[:lower:]' '[:upper:]') UPPER_DIST = $(shell echo $(DIST) | tr '[:lower:]' '[:upper:]') PWD := $(shell readlink -f .) SPACE = 8 +ARCH = $(shell dpkg --print-architecture) +UPPER_ARCH = $(shell echo $(ARCH) | tr '[:lower:]' '[:upper:]') VALID_CLOUDS = (azure|ec2|gce|openstack|vm|vagrant) VALID_DISTS = (stretch|buster) @@ -23,7 +25,7 @@ help: @echo " WHERE <DIST> is buster or stretch" @echo " And <CLOUD> is azure, ec2, gce, openstack, vagrant" -_image.raw: config_space/basefiles/$(UPPER_DIST).tar.gz +_image.raw: config_space/basefiles/$(UPPER_DIST)_$(UPPER_ARCH).tar.gz @echo $(CLOUD) | egrep -q "$(VALID_CLOUDS)" || { \ echo "$(CLOUD) is an invalid. Valid clouds are $(VALID_CLOUDS)"; exit 1; } @echo $(DIST) | egrep -q "$(VALID_DISTS)" || { \ @@ -31,11 +33,11 @@ _image.raw: config_space/basefiles/$(UPPER_DIST).tar.gz sudo fai-diskimage -v \ --hostname debian-$(DIST) \ --size $(SPACE)G \ - --class DEBIAN,$(UPPER_DIST),AMD64,GRUB_PC,CLOUD,$(UPPER_CLOUD) \ - --cspace $(PWD)/config_space $(CLOUD)-$(DIST)-image.raw + --class DEBIAN,$(UPPER_DIST),$(UPPER_ARCH),$(UPPER_DIST)_$(UPPER_ARCH),GRUB_PC,CLOUD,$(UPPER_CLOUD) \ + --cspace $(PWD)/config_space $(CLOUD)-$(DIST)-$(ARCH)-image.raw if [ "$(FORMAT_NEEDED)" = "vhd" ]; then \ qemu-img convert -f raw -o subformat=fixed,force_size -O vpc \ - $(CLOUD)-$(DIST)-image.raw $(CLOUD)-$(DIST)-image.vhd; fi + $(CLOUD)-$(DIST)-$(ARCH)-image.raw $(CLOUD)-$(DIST)-$(ARCH)-image.vhd; fi buster-image-%: find config_space/basefiles -type f -atime +1 -print0 | xargs -0 -r rm ${MAKE} _image.raw CLOUD=$* DIST=buster @@ -44,9 +46,9 @@ stretch-image-%: find config_space/basefiles -type f -atime +1 -print0 | xargs -0 -r rm ${MAKE} _image.raw CLOUD=$* DIST=stretch -config_space/basefiles/$(UPPER_DIST).tar.gz: +config_space/basefiles/$(UPPER_DIST)_$(UPPER_ARCH).tar.gz: $(eval DIR := $(shell mktemp -d)) - sudo debootstrap $(DIST) $(DIR) http://deb.debian.org/debian + sudo debootstrap --arch=$(ARCH) $(DIST) $(DIR) http://deb.debian.org/debian (cd $(DIR); sudo tar cfz $(PWD)/$@ *) sudo chown $(USER) $@ rm -rf $(DIR) -- 2.15.0.rc1