[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:
lguohan 2020-08-01 22:54:30 -07:00 committed by GitHub
parent a9dc409d61
commit 8dfc824d0b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 7 deletions

View File

@ -181,7 +181,6 @@ DOCKER_BUILD = docker build --no-cache \
SONIC_BUILD_INSTRUCTION := make \ SONIC_BUILD_INSTRUCTION := make \
-f slave.mk \ -f slave.mk \
BLDENV=$(BLDENV) \
PLATFORM=$(PLATFORM) \ PLATFORM=$(PLATFORM) \
PLATFORM_ARCH=$(PLATFORM_ARCH) \ PLATFORM_ARCH=$(PLATFORM_ARCH) \
BUILD_NUMBER=$(BUILD_NUMBER) \ BUILD_NUMBER=$(BUILD_NUMBER) \

View File

@ -24,13 +24,9 @@ SRC_PATH = src
RULES_PATH = rules RULES_PATH = rules
TARGET_PATH = target TARGET_PATH = target
DOCKERS_PATH = dockers DOCKERS_PATH = dockers
ifdef BLDENV BLDENV = $(shell lsb_release -cs)
DEBS_PATH = $(TARGET_PATH)/debs/$(BLDENV) DEBS_PATH = $(TARGET_PATH)/debs/$(BLDENV)
FILES_PATH = $(TARGET_PATH)/files/$(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_DEBS_PATH = $(TARGET_PATH)/python-debs
PYTHON_WHEELS_PATH = $(TARGET_PATH)/python-wheels PYTHON_WHEELS_PATH = $(TARGET_PATH)/python-wheels
PROJECT_ROOT = $(shell pwd) 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)_DEBS_PATH := $(STRETCH_DEBS_PATH)))
$(foreach DOCKER_IMAGE,$(SONIC_STRETCH_DBG_DOCKERS), $(eval $(DOCKER_IMAGE)_FILES_PATH := $(STRETCH_FILES_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_IMAGES := $(SONIC_JESSIE_DOCKERS)
DOCKER_DBG_IMAGES := $(SONIC_JESSIE_DBG_DOCKERS) DOCKER_DBG_IMAGES := $(SONIC_JESSIE_DBG_DOCKERS)
JESSIE_DOCKER_IMAGES = $(filter $(SONIC_JESSIE_DOCKERS),$(DOCKER_IMAGES_FOR_INSTALLERS) $(EXTRA_DOCKER_TARGETS)) JESSIE_DOCKER_IMAGES = $(filter $(SONIC_JESSIE_DOCKERS),$(DOCKER_IMAGES_FOR_INSTALLERS) $(EXTRA_DOCKER_TARGETS))