Skip to content

Commit

Permalink
Revert "Makefile: Export PLATFORM as docker build argument"
Browse files Browse the repository at this point in the history
This reverts commit bcee4dd.

Custom build arguments can now be passed through a custom
build-<PLATFORM>.yml file. Revert the mentioned commit in favor of this
new feature and to avoid mix build parameters across platforms.

Signed-off-by: Renê de Souza Pinto <rene@renesp.com.br>
  • Loading branch information
rene committed Jan 21, 2025
1 parent 135cbbf commit d059d16
Showing 1 changed file with 4 additions and 9 deletions.
13 changes: 4 additions & 9 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,6 @@ CURRENT_INSTALLER=$(CURRENT_DIR)/installer
INSTALLER_FIRMWARE_DIR=$(INSTALLER)/firmware
CURRENT_FIRMWARE_DIR=$(CURRENT_INSTALLER)/firmware
UBOOT_IMG=$(INSTALLER_FIRMWARE_DIR)/boot
BUILDARGS_FILE=build-args.conf

# not every firmware file is used on every architecture
BIOS_IMG_amd64=$(INSTALLER_FIRMWARE_DIR)/OVMF.fd $(INSTALLER_FIRMWARE_DIR)/OVMF_CODE.fd $(INSTALLER_FIRMWARE_DIR)/OVMF_VARS.fd
Expand Down Expand Up @@ -322,7 +321,6 @@ LINUXKIT_VERSION=v1.5.3
LINUXKIT_SOURCE=https://github.com/linuxkit/linuxkit
LINUXKIT_OPTS=$(if $(strip $(EVE_HASH)),--hash) $(EVE_HASH) $(if $(strip $(EVE_REL)),--release) $(EVE_REL)
LINUXKIT_PKG_TARGET=build
LINUXKIT_BUILD_ARGS=--build-arg-file $(BUILDARGS_FILE)

ifdef LIVE_FAST
# Check the makerootfs.sh and the linuxkit tool invocation, the --input-tar
Expand Down Expand Up @@ -441,7 +439,7 @@ currentversion:
#echo $(shell readlink $(CURRENT) | sed -E 's/rootfs-(.*)\.[^.]*$/\1/')
@cat $(CURRENT_DIR)/installer/eve_version

.PHONY: currentversion linuxkit pkg/kernel $(BUILDARGS_FILE)
.PHONY: currentversion linuxkit pkg/kernel

test: $(LINUXKIT) test-images-patches | $(DIST)
@echo Running tests on $(GOMODULE)
Expand All @@ -465,7 +463,7 @@ pillar-%: $(GOBUILDER) | $(DIST)
$(QUIET): $@: Succeeded

clean:
rm -rf $(DIST) $(BUILDARGS_FILE) images/out pkg-deps.mk
rm -rf $(DIST) images/out pkg-deps.mk

$(DOCKERFILE_FROM_CHECKER): $(DOCKERFILE_FROM_CHECKER_DIR)/*.go $(DOCKERFILE_FROM_CHECKER_DIR)/go.*
make -C $(DOCKERFILE_FROM_CHECKER_DIR)
Expand Down Expand Up @@ -1013,9 +1011,6 @@ else
$(QUIET): $@: Succeeded
endif

$(BUILDARGS_FILE):
@echo "PLATFORM=$(PLATFORM)" > $@

%.yml: %.yml.in $(RESCAN_DEPS) | build-tools
$(QUIET)$(PARSE_PKGS) $< > $@
$(QUIET): $@: Succeeded
Expand All @@ -1039,12 +1034,12 @@ get_pkg_build_rstats_yml = $(if $(wildcard pkg/$1/build-rstats.yml),build-rstats
get_pkg_build_kubevirt_yml = $(if $(and $(filter y,$(DEV)),$(wildcard pkg/$1/build-kubevirt-dev.yml)),build-kubevirt-dev.yml, \
$(if $(wildcard pkg/$1/build-kubevirt.yml),build-kubevirt.yml,build.yml))

eve-%: pkg/%/Dockerfile build-tools $(BUILDARGS_FILE) $(RESCAN_DEPS)
eve-%: pkg/%/Dockerfile build-tools $(RESCAN_DEPS)
$(QUIET): "$@: Begin: LINUXKIT_PKG_TARGET=$(LINUXKIT_PKG_TARGET)"
$(eval LINUXKIT_DOCKER_LOAD := $(if $(filter $(PKGS_DOCKER_LOAD),$*),--docker,))
$(eval LINUXKIT_BUILD_PLATFORMS_LIST := $(call uniq,linux/$(ZARCH) $(if $(filter $(PKGS_HOSTARCH),$*),linux/$(HOSTARCH),)))
$(eval LINUXKIT_BUILD_PLATFORMS := --platforms $(subst $(space),$(comma),$(strip $(LINUXKIT_BUILD_PLATFORMS_LIST))))
$(eval LINUXKIT_FLAGS := $(if $(filter manifest,$(LINUXKIT_PKG_TARGET)),,$(FORCE_BUILD) $(LINUXKIT_BUILD_ARGS) $(LINUXKIT_DOCKER_LOAD) $(LINUXKIT_BUILD_PLATFORMS)))
$(eval LINUXKIT_FLAGS := $(if $(filter manifest,$(LINUXKIT_PKG_TARGET)),,$(FORCE_BUILD) $(LINUXKIT_DOCKER_LOAD) $(LINUXKIT_BUILD_PLATFORMS)))
$(QUIET)$(LINUXKIT) $(DASH_V) pkg $(LINUXKIT_PKG_TARGET) $(LINUXKIT_OPTS) $(LINUXKIT_FLAGS) --build-yml $(call get_pkg_build_yml,$*) pkg/$*
$(QUIET)if [ -n "$(PRUNE)" ]; then \
$(LINUXKIT) pkg builder prune; \
Expand Down

0 comments on commit d059d16

Please sign in to comment.