From 383e573299e00b9c09e2c23cc5b11b5a3b6e75c5 Mon Sep 17 00:00:00 2001 From: Nitesh Konkar Date: Mon, 18 Feb 2019 10:23:57 +0530 Subject: packer: Make Makefile host arch sensitive `make localunit` fails on non-amd64 archs as it unzips packer_1.3.2_linux_amd64.zip irrespective of host arch its running on. Signed-off-by: Nitesh Konkar --- contrib/cirrus/packer/Makefile | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'contrib/cirrus/packer') diff --git a/contrib/cirrus/packer/Makefile b/contrib/cirrus/packer/Makefile index 0a783e979..91a1dfeef 100644 --- a/contrib/cirrus/packer/Makefile +++ b/contrib/cirrus/packer/Makefile @@ -4,7 +4,9 @@ # e.g for names see libpod_images.yml PACKER_VER ?= 1.3.2 -PACKER_DIST_FILENAME := packer_${PACKER_VER}_linux_amd64.zip +GOARCH=$(shell go env GOARCH) +ARCH=$(uname -m) +PACKER_DIST_FILENAME := packer_${PACKER_VER}_linux_${GOARCH}.zip # Only needed for libpod_base_images target TIMESTAMP := $(shell date +%s) @@ -30,7 +32,7 @@ ${PACKER_DIST_FILENAME}: packer: ${PACKER_DIST_FILENAME} @curl -L --silent --show-error \ https://releases.hashicorp.com/packer/${PACKER_VER}/packer_${PACKER_VER}_SHA256SUMS \ - | grep 'linux_amd64' > /tmp/packer_sha256sums + | grep linux_${GOARCH} > /tmp/packer_sha256sums @sha256sum --check /tmp/packer_sha256sums @unzip -o ${PACKER_DIST_FILENAME} @touch --reference=Makefile ${PACKER_DIST_FILENAME} @@ -93,7 +95,7 @@ endif -var GOSRC=$(GOSRC) \ -var PACKER_BASE=$(PACKER_BASE) \ -var SCRIPT_BASE=$(SCRIPT_BASE) \ - -var RHEL_BASE_IMAGE_NAME=$(shell basename $(RHEL_IMAGE_FILE) | tr -d '[[:space:]]' | sed -r -e 's/\.x86_64\.raw\.xz//' | tr '[[:upper:]]' '[[:lower:]]' | tr '[[:punct:]]' '-') \ + -var RHEL_BASE_IMAGE_NAME=$(shell basename $(RHEL_IMAGE_FILE) | tr -d '[[:space:]]' | sed -r -e 's/\.${ARCH}\.raw\.xz//' | tr '[[:upper:]]' '[[:lower:]]' | tr '[[:punct:]]' '-') \ -var RHEL_IMAGE_FILE=$(RHEL_IMAGE_FILE) \ -var RHEL_CSUM_FILE=$(RHEL_CSUM_FILE) \ -var 'RHSM_COMMAND=$(RHSM_COMMAND)' \ -- cgit v1.2.3-54-g00ecf