diff --git a/Makefile b/Makefile index 347041e1b12a..ccbefc9e0138 100644 --- a/Makefile +++ b/Makefile @@ -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 # ############################################################################### @@ -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) diff --git a/rules/config b/rules/config index 1505dfd71782..5e8a3389530d 100644 --- a/rules/config +++ b/rules/config @@ -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 diff --git a/slave.mk b/slave.mk index a7cb518cb078..9ba1732e6a58 100644 --- a/slave.mk +++ b/slave.mk @@ -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 @@ -127,6 +131,7 @@ $(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 ) ############################################################################### @@ -134,6 +139,8 @@ $(info ) ## All rules must go after includes for propper targets expansion ############################################################################### +export kernel_procure_method="$(KERNEL_PROCURE_METHOD)" + ############################################################################### ## Local targets ############################################################################### @@ -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