Skip to content

Commit 77e0e79

Browse files
committed
Makefile: Add platform variant to eve container's TAG and rootfs version
In order to push the eve container for different variants, we must set different TAGs. Following the same approach for pkg/fw and pkg/nvidia, this commit adds the platform variant to the eve container's TAG when building for non-generic platforms. Nothing changes for generic (and specially x86) platforms. Additionally, EVE-OS images must be differentiated across platform variants, so a remote controller can provide the same version for different platforms, e.g., generic, nvidia-jp5, nvidia-jp6. The platform variant is also added to the rootfs version (except for the default 'generic' platform). The new TAG scheme changes from: <HASH/EVE_RELEASE>-<HV>-<ARCH> To: <HASH/EVE_RELEASE>-<PLATFORM_VARIANT>-<HV>-<ARCH> The PLATFORM variant is added right after the hash/release in order to keep the tuple <HV>-<ARCH>, keeping compatibilty with any script/tool that expects this kind of tag. Signed-off-by: Renê de Souza Pinto <[email protected]>
1 parent 65676fd commit 77e0e79

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

Makefile

+10-1
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,12 @@ ifeq ($(DEV),y)
101101
DEV_TAG:=-dev
102102
endif
103103

104+
ifeq ($(PLATFORM),generic)
105+
TAGPLAT=
106+
else
107+
TAGPLAT=$(PLATFORM)
108+
endif
109+
104110
# ROOTFS_VERSION used to construct the installer directory
105111
# set this to the current tag only if we are building from a tag
106112
ROOTFS_VERSION:=$(if $(findstring snapshot,$(REPO_TAG)),$(EVE_SNAPSHOT_VERSION)-$(REPO_BRANCH)-$(REPO_SHA)$(REPO_DIRTY_TAG)$(DEV_TAG),$(REPO_TAG))
@@ -109,6 +115,9 @@ ROOTFS_VERSION:=$(if $(findstring snapshot,$(REPO_TAG)),$(EVE_SNAPSHOT_VERSION)-
109115
SHORT_KERNEL_TAG=$(subst docker.io/lfedge/eve-kernel:eve-kernel-,k-,$(KERNEL_TAG))
110116
ROOTFS_VERSION:=$(if $(SHORT_KERNEL_TAG),$(ROOTFS_VERSION)-$(SHORT_KERNEL_TAG),$(ROOTFS_VERSION))
111117

118+
# For non-generic platforms, include the variant to the rootfs version
119+
ROOTFS_VERSION:=$(if $(TAGPLAT),$(ROOTFS_VERSION)-$(TAGPLAT),$(ROOTFS_VERSION))
120+
112121
HOSTARCH:=$(subst aarch64,arm64,$(subst x86_64,amd64,$(shell uname -m)))
113122
# by default, take the host architecture as the target architecture, but can override with `make ZARCH=foo`
114123
# assuming that the toolchain supports it, of course...
@@ -883,7 +892,7 @@ eve: $(INSTALLER) $(EVE_ARTIFACTS) current $(RUNME) $(BUILD_YML) | $(BUILD_DIR)
883892
$(PARSE_PKGS) pkg/eve/Dockerfile.in > $|/Dockerfile
884893
$(LINUXKIT) $(DASH_V) pkg $(LINUXKIT_PKG_TARGET) $(LINUXKIT_ORG_TARGET) --platforms linux/$(ZARCH) --hash-path $(CURDIR) --hash $(ROOTFS_VERSION)-$(HV) --docker $(if $(strip $(EVE_REL)),--release) $(EVE_REL)$(if $(strip $(EVE_REL)),-$(HV)) $(FORCE_BUILD) $|
885894
$(QUIET)if [ -n "$(EVE_REL)" ] && [ $(HV) = $(HV_DEFAULT) ]; then \
886-
$(LINUXKIT) $(DASH_V) pkg $(LINUXKIT_PKG_TARGET) $(LINUXKIT_ORG_TARGET) --platforms linux/$(ZARCH) --hash-path $(CURDIR) --hash $(EVE_REL)-$(HV) --docker --release $(EVE_REL) $(FORCE_BUILD) $| ;\
895+
$(LINUXKIT) $(DASH_V) pkg $(LINUXKIT_PKG_TARGET) $(LINUXKIT_ORG_TARGET) --platforms linux/$(ZARCH) --hash-path $(CURDIR) --hash $(EVE_REL)-$(if $(TAGPLAT),$(TAGPLAT)-)$(HV) --docker --release $(EVE_REL) $(FORCE_BUILD) $| ;\
887896
fi
888897
$(QUIET): $@: Succeeded
889898

0 commit comments

Comments
 (0)