forked from lf-edge/eve
-
Notifications
You must be signed in to change notification settings - Fork 1
/
kernel-version.mk
72 lines (62 loc) · 2.4 KB
/
kernel-version.mk
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
# Copyright (c) 2023 Zededa, Inc.
# SPDX-License-Identifier: Apache-2.0
#
# This file is included by the main Makefile.
# Two variables are used as input for the kernel build:
# ZARCH - architecture (amd64, arm64)
# PLATFORM - platform (generic, nvidia, rt, imx*) based on these two
# variables we set kernel version, commit hash and branch
# when new kernel is built and pushed to the corresponding
# dockerhub
# KERNEL_COMMIT_xxx variable must be manually updated
#
KERNEL_COMPILER=gcc
PLATFORM?=generic
PLATFORMS_amd64=generic rt
PLATFORMS_arm64=generic nvidia imx8mp_pollux imx8mp_epc_r3720 imx8mq_evk
PLATFORMS_riscv64=generic
ARCHS=amd64 arm64 riscv64
# check if ZARCH is supported
ifeq (, $(findstring $(ZARCH), $(ARCHS)))
$(error "Unsupported architecture $(ZARCH)")
endif
# check if PLATFORM is supported
ifeq (, $(findstring $(PLATFORM), $(PLATFORMS_$(ZARCH))))
$(error "Unsupported combination of ZARCH=$(ZARCH) and PLATFORM=$(PLATFORM)")
endif
ifeq ($(ZARCH), amd64)
ifeq ($(PLATFORM), rt)
KERNEL_FLAVOR=rt
KERNEL_VERSION=v6.1.105
else
KERNEL_FLAVOR=generic
KERNEL_VERSION=v6.1.106
endif
else ifeq ($(ZARCH), arm64)
ifeq ($(PLATFORM), nvidia)
KERNEL_FLAVOR=nvidia
KERNEL_VERSION=v5.10.192
else
KERNEL_FLAVOR=generic
KERNEL_VERSION=v6.1.106
endif
else ifeq ($(ZARCH), riscv64)
KERNEL_VERSION=v6.1.106
KERNEL_FLAVOR=generic
endif
include kernel-commits.mk
# check if KERNEL_VERSION is defined
ifeq ($(origin KERNEL_VERSION), undefined)
$(error "KERNEL_VERSION is not defined. did you introduced new platform or ARCH?")
endif
# at this point ZARCH, KERNEL_VERSION and FLAVOR must be defined.
# Check that we defined a commit for combination
ifeq ($(origin KERNEL_COMMIT_$(ZARCH)_$(KERNEL_VERSION)_$(KERNEL_FLAVOR)), undefined)
$(error "KERNEL_COMMIT_$(KERNEL_FLAVOR) is not defined. did you introduce new platform or ARCH?")
endif
KERNEL_COMMIT=$(KERNEL_COMMIT_$(ZARCH)_$(KERNEL_VERSION)_$(KERNEL_FLAVOR))
KERNEL_BRANCH = eve-kernel-$(ZARCH)-$(KERNEL_VERSION)-$(KERNEL_FLAVOR)
KERNEL_DOCKER_TAG = $(KERNEL_BRANCH)-$(KERNEL_COMMIT)-$(KERNEL_COMPILER)
# one can override the whole tag from the command line and set it to
# output of make -f Makefile.eve docker-tag-${KERNEL_COMPILER} in github.com/lf-edge/eve-kernel
KERNEL_TAG ?= docker.io/lfedge/eve-kernel:$(KERNEL_DOCKER_TAG)