Skip to content

Commit

Permalink
[make] introducing new build option KERNEL_PROCURE_METHOD (#1837)
Browse files Browse the repository at this point in the history
* [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
  • Loading branch information
yxieca authored Jul 25, 2018
1 parent e3abf0c commit 3c33737
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 1 deletion.
4 changes: 3 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@
# * PASSWORD: Desired password -- default at rules/config
# * KEEP_SLAVE_ON: Keeps slave container up after building-process concludes.
# * SOURCE_FOLDER: host path to be mount as /var/$(USER)/src, only effective when KEEP_SLAVE_ON=yes
# * SONIC_BUILD_JOB: Specifying number of concurrent build job(s) to run
# * SONIC_BUILD_JOBS: Specifying number of concurrent build job(s) to run
# * KERNEL_PROCURE_METHOD: Specifying method of obtaining kernel Debian package: download or build
#
###############################################################################

Expand Down Expand Up @@ -69,6 +70,7 @@ SONIC_BUILD_INSTRUCTION := make \
PASSWORD=$(PASSWORD) \
USERNAME=$(USERNAME) \
SONIC_BUILD_JOBS=$(SONIC_BUILD_JOBS) \
KERNEL_PROCURE_METHOD=$(KERNEL_PROCURE_METHOD) \
HTTP_PROXY=$(http_proxy) \
HTTPS_PROXY=$(https_proxy) \
SONIC_ENABLE_SYSTEM_TELEMETRY=$(ENABLE_SYSTEM_TELEMETRY)
Expand Down
5 changes: 5 additions & 0 deletions rules/config
Original file line number Diff line number Diff line change
Expand Up @@ -66,3 +66,8 @@ ENABLE_ORGANIZATION_EXTENSIONS = y

# ENABLE_SYSTEM_TELEMETRY - build docker-sonic-telemetry for system telemetry support
# ENABLE_SYSTEM_TELEMETRY = y

# DEFAULT_KERNEL_PROCURE_METHOD - default method for obtaining kernel
# build: build kernel from source
# download: download pre-built kernel from Azure storage.
DEFAULT_KERNEL_PROCURE_METHOD = build
8 changes: 8 additions & 0 deletions slave.mk
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,10 @@ ifeq ($(SONIC_BUILD_JOBS),)
override SONIC_BUILD_JOBS := $(SONIC_CONFIG_BUILD_JOBS)
endif

ifeq ($(KERNEL_PROCURE_METHOD),)
override KERNEL_PROCURE_METHOD := $(DEFAULT_KERNEL_PROCURE_METHOD)
endif

MAKEFLAGS += -j $(SONIC_BUILD_JOBS)
export SONIC_CONFIG_MAKE_JOBS

Expand Down Expand Up @@ -127,13 +131,16 @@ $(info "HTTPS_PROXY" : "$(HTTPS_PROXY)")
$(info "ENABLE_SYSTEM_TELEMETRY" : "$(ENABLE_SYSTEM_TELEMETRY)")
$(info "SONIC_DEBUGGING_ON" : "$(SONIC_DEBUGGING_ON)")
$(info "SONIC_PROFILING_ON" : "$(SONIC_PROFILING_ON)")
$(info "KERNEL_PROCURE_METHOD" : "$(KERNEL_PROCURE_METHOD)")
$(info )

###############################################################################
## Generic rules section
## All rules must go after includes for propper targets expansion
###############################################################################

export kernel_procure_method="$(KERNEL_PROCURE_METHOD)"

###############################################################################
## Local targets
###############################################################################
Expand All @@ -149,6 +156,7 @@ $(addprefix $(DEBS_PATH)/, $(SONIC_COPY_DEBS)) : $(DEBS_PATH)/% : .platform
{ cp $($(deb)_PATH)/$(deb) $(DEBS_PATH)/ $(LOG) || exit 1 ; } ; )
$(FOOTER)


SONIC_TARGET_LIST += $(addprefix $(DEBS_PATH)/, $(SONIC_COPY_DEBS))

# Copy regular files from local directory
Expand Down

0 comments on commit 3c33737

Please sign in to comment.