[build]: auto-detect bldenv in the sonic-slave docker (#5087)
use lsb_release -cs to get build env within the docker for jessie: jessie for stretch: stretch for buster: buster Signed-off-by: Guohan Lu <lguohan@gmail.com>
This commit is contained in:
parent
a9dc409d61
commit
8dfc824d0b
@ -181,7 +181,6 @@ DOCKER_BUILD = docker build --no-cache \
|
||||
|
||||
SONIC_BUILD_INSTRUCTION := make \
|
||||
-f slave.mk \
|
||||
BLDENV=$(BLDENV) \
|
||||
PLATFORM=$(PLATFORM) \
|
||||
PLATFORM_ARCH=$(PLATFORM_ARCH) \
|
||||
BUILD_NUMBER=$(BUILD_NUMBER) \
|
||||
|
8
slave.mk
8
slave.mk
@ -24,13 +24,9 @@ SRC_PATH = src
|
||||
RULES_PATH = rules
|
||||
TARGET_PATH = target
|
||||
DOCKERS_PATH = dockers
|
||||
ifdef BLDENV
|
||||
BLDENV = $(shell lsb_release -cs)
|
||||
DEBS_PATH = $(TARGET_PATH)/debs/$(BLDENV)
|
||||
FILES_PATH = $(TARGET_PATH)/files/$(BLDENV)
|
||||
else
|
||||
DEBS_PATH = $(TARGET_PATH)/debs
|
||||
FILES_PATH = $(TARGET_PATH)/files
|
||||
endif
|
||||
PYTHON_DEBS_PATH = $(TARGET_PATH)/python-debs
|
||||
PYTHON_WHEELS_PATH = $(TARGET_PATH)/python-wheels
|
||||
PROJECT_ROOT = $(shell pwd)
|
||||
@ -641,7 +637,7 @@ $(foreach DOCKER_IMAGE,$(SONIC_STRETCH_DOCKERS), $(eval $(DOCKER_IMAGE)_FILES_PA
|
||||
$(foreach DOCKER_IMAGE,$(SONIC_STRETCH_DBG_DOCKERS), $(eval $(DOCKER_IMAGE)_DEBS_PATH := $(STRETCH_DEBS_PATH)))
|
||||
$(foreach DOCKER_IMAGE,$(SONIC_STRETCH_DBG_DOCKERS), $(eval $(DOCKER_IMAGE)_FILES_PATH := $(STRETCH_FILES_PATH)))
|
||||
|
||||
ifeq ($(BLDENV),)
|
||||
ifeq ($(BLDENV),jessie)
|
||||
DOCKER_IMAGES := $(SONIC_JESSIE_DOCKERS)
|
||||
DOCKER_DBG_IMAGES := $(SONIC_JESSIE_DBG_DOCKERS)
|
||||
JESSIE_DOCKER_IMAGES = $(filter $(SONIC_JESSIE_DOCKERS),$(DOCKER_IMAGES_FOR_INSTALLERS) $(EXTRA_DOCKER_TARGETS))
|
||||
|
Loading…
Reference in New Issue
Block a user