hook
hook copied to clipboard
[Feature Request] Let the user choose which architecture to build
The target architecture(s) (amd64 or arm64) should be configurable.
Expected Behaviour
I would like to be able to choose which architecture I want to build without patching rules.mk.
Current Behaviour
The targets actually build both amd64 and arm64.
Possible Solution
The dirty way, patching rules.mk:
diff --git a/rules.mk b/rules.mk
index b2c5133..717e1da 100644
--- a/rules.mk
+++ b/rules.mk
@@ -22,7 +22,7 @@ ifeq ($(ARCH),aarch64)
ARCH = arm64
endif
-arches := amd64 arm64
+arches := amd64
modes := rel dbg
hook-bootkit-deps := $(wildcard hook-bootkit/*)
@@ -87,7 +87,7 @@ push-hook-bootkit push-hook-docker:
docker buildx build --platform $$platforms --push -t $(ORG)/$(container):$T $(container)
.PHONY: dist
-dist: out/$T/rel/amd64/hook.tar out/$T/rel/arm64/hook.tar ## Build tarballs for distribution
+dist: out/$T/rel/amd64/hook.tar ## Build tarballs for distribution
dbg-dist: out/$T/dbg/$(ARCH)/hook.tar ## Build debug enabled tarball
dist dbg-dist:
for f in $^; do
ubuntu@factory:~/tinkerbell/hook$ git diff > ../hook.patch
ubuntu@factory:~/tinkerbell/hook$ cat ../hook.patch
diff --git a/rules.mk b/rules.mk
index b2c5133..717e1da 100644
--- a/rules.mk
+++ b/rules.mk
@@ -22,7 +22,7 @@ ifeq ($(ARCH),aarch64)
ARCH = arm64
endif
-arches := amd64 arm64
+arches := amd64
modes := rel dbg
hook-bootkit-deps := $(wildcard hook-bootkit/*)
@@ -87,7 +87,7 @@ push-hook-bootkit push-hook-docker:
docker buildx build --platform $$platforms --push -t $(ORG)/$(container):$T $(container)
.PHONY: dist
-dist: out/$T/rel/amd64/hook.tar out/$T/rel/arm64/hook.tar ## Build tarballs for distribution
+dist: out/$T/rel/amd64/hook.tar ## Build tarballs for distribution
dbg-dist: out/$T/dbg/$(ARCH)/hook.tar ## Build debug enabled tarball
dist dbg-dist:
for f in $^; do
Context
Three reasons:
- I only need one architecture, the one I am using
- I want to reduce my building time skipping arm64
- I want to avoid possible building failures outside of my scope