Skip to content

Commit 3c33737

Browse files
authored
[make] introducing new build option KERNEL_PROCURE_METHOD (#1837)
* [make] introducing new build option KERNEL_BUILD_METHOD - Kernel could be built from source files with method 'build' - Kernel could be downloaded from Azure storage with method 'download' Signed-off-by: Ying Xie <[email protected]> * Replace BUILD with PROCURE * fix typo
1 parent e3abf0c commit 3c33737

File tree

3 files changed

+16
-1
lines changed

3 files changed

+16
-1
lines changed

Makefile

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@
1515
# * PASSWORD: Desired password -- default at rules/config
1616
# * KEEP_SLAVE_ON: Keeps slave container up after building-process concludes.
1717
# * SOURCE_FOLDER: host path to be mount as /var/$(USER)/src, only effective when KEEP_SLAVE_ON=yes
18-
# * SONIC_BUILD_JOB: Specifying number of concurrent build job(s) to run
18+
# * SONIC_BUILD_JOBS: Specifying number of concurrent build job(s) to run
19+
# * KERNEL_PROCURE_METHOD: Specifying method of obtaining kernel Debian package: download or build
1920
#
2021
###############################################################################
2122

@@ -69,6 +70,7 @@ SONIC_BUILD_INSTRUCTION := make \
6970
PASSWORD=$(PASSWORD) \
7071
USERNAME=$(USERNAME) \
7172
SONIC_BUILD_JOBS=$(SONIC_BUILD_JOBS) \
73+
KERNEL_PROCURE_METHOD=$(KERNEL_PROCURE_METHOD) \
7274
HTTP_PROXY=$(http_proxy) \
7375
HTTPS_PROXY=$(https_proxy) \
7476
SONIC_ENABLE_SYSTEM_TELEMETRY=$(ENABLE_SYSTEM_TELEMETRY)

rules/config

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,3 +66,8 @@ ENABLE_ORGANIZATION_EXTENSIONS = y
6666

6767
# ENABLE_SYSTEM_TELEMETRY - build docker-sonic-telemetry for system telemetry support
6868
# ENABLE_SYSTEM_TELEMETRY = y
69+
70+
# DEFAULT_KERNEL_PROCURE_METHOD - default method for obtaining kernel
71+
# build: build kernel from source
72+
# download: download pre-built kernel from Azure storage.
73+
DEFAULT_KERNEL_PROCURE_METHOD = build

slave.mk

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,10 @@ ifeq ($(SONIC_BUILD_JOBS),)
9999
override SONIC_BUILD_JOBS := $(SONIC_CONFIG_BUILD_JOBS)
100100
endif
101101

102+
ifeq ($(KERNEL_PROCURE_METHOD),)
103+
override KERNEL_PROCURE_METHOD := $(DEFAULT_KERNEL_PROCURE_METHOD)
104+
endif
105+
102106
MAKEFLAGS += -j $(SONIC_BUILD_JOBS)
103107
export SONIC_CONFIG_MAKE_JOBS
104108

@@ -127,13 +131,16 @@ $(info "HTTPS_PROXY" : "$(HTTPS_PROXY)")
127131
$(info "ENABLE_SYSTEM_TELEMETRY" : "$(ENABLE_SYSTEM_TELEMETRY)")
128132
$(info "SONIC_DEBUGGING_ON" : "$(SONIC_DEBUGGING_ON)")
129133
$(info "SONIC_PROFILING_ON" : "$(SONIC_PROFILING_ON)")
134+
$(info "KERNEL_PROCURE_METHOD" : "$(KERNEL_PROCURE_METHOD)")
130135
$(info )
131136

132137
###############################################################################
133138
## Generic rules section
134139
## All rules must go after includes for propper targets expansion
135140
###############################################################################
136141

142+
export kernel_procure_method="$(KERNEL_PROCURE_METHOD)"
143+
137144
###############################################################################
138145
## Local targets
139146
###############################################################################
@@ -149,6 +156,7 @@ $(addprefix $(DEBS_PATH)/, $(SONIC_COPY_DEBS)) : $(DEBS_PATH)/% : .platform
149156
{ cp $($(deb)_PATH)/$(deb) $(DEBS_PATH)/ $(LOG) || exit 1 ; } ; )
150157
$(FOOTER)
151158

159+
152160
SONIC_TARGET_LIST += $(addprefix $(DEBS_PATH)/, $(SONIC_COPY_DEBS))
153161

154162
# Copy regular files from local directory

0 commit comments

Comments
 (0)