From 3bf2c54768640a4b900f42a49d4a3008a0d9a2cf Mon Sep 17 00:00:00 2001 From: Saikrishna Arcot Date: Mon, 21 Aug 2023 10:49:54 -0700 Subject: [PATCH] Update slave.mk to assume a Bookworm base image Signed-off-by: Saikrishna Arcot --- Makefile | 14 ++++++++++---- Makefile.cache | 3 ++- rules/config | 2 +- slave.mk | 33 ++++++++++++++++++++++++++------- 4 files changed, 39 insertions(+), 13 deletions(-) diff --git a/Makefile b/Makefile index f2f59a990b..5318ce84cf 100644 --- a/Makefile +++ b/Makefile @@ -4,7 +4,7 @@ NOJESSIE ?= 1 NOSTRETCH ?= 1 NOBUSTER ?= 0 NOBULLSEYE ?= 0 -NOBOOKWORM ?= 1 +NOBOOKWORM ?= 0 override Q := @ ifeq ($(QUIET),n) @@ -52,12 +52,12 @@ ifeq ($(NOBUSTER), 0) $(MAKE_WITH_RETRY) EXTRA_DOCKER_TARGETS=$(notdir $@) BLDENV=buster -f Makefile.work buster endif ifeq ($(NOBULLSEYE), 0) - $(MAKE_WITH_RETRY) BLDENV=bullseye -f Makefile.work $@ + $(MAKE_WITH_RETRY) EXTRA_DOCKER_TARGETS=$(notdir $@) BLDENV=bullseye -f Makefile.work bullseye endif ifeq ($(NOBOOKWORM), 0) - $(MAKE_WITH_RETRY) BLDENV=bullseye -f Makefile.work $@ + $(MAKE_WITH_RETRY) BLDENV=bookworm -f Makefile.work $@ endif - BLDENV=bullseye $(MAKE) -f Makefile.work docker-cleanup + BLDENV=bookworm $(MAKE) -f Makefile.work docker-cleanup jessie: @echo "+++ Making $@ +++" @@ -77,6 +77,12 @@ ifeq ($(NOBUSTER), 0) $(MAKE) -f Makefile.work buster endif +bullseye: + @echo "+++ Making $@ +++" +ifeq ($(NOBUSTER), 0) + $(MAKE) -f Makefile.work bullseye +endif + init: @echo "+++ Making $@ +++" $(MAKE) -f Makefile.work $@ diff --git a/Makefile.cache b/Makefile.cache index 137cf9c7bb..2d9858d44a 100644 --- a/Makefile.cache +++ b/Makefile.cache @@ -78,7 +78,8 @@ SONIC_COMMON_DPKG_LIST := debian/control debian/changelog debian/rules \ SONIC_COMMON_BASE_FILES_LIST := sonic-slave-jessie/Dockerfile.j2 sonic-slave-jessie/Dockerfile.user.j2 \ sonic-slave-stretch/Dockerfile.j2 sonic-slave-stretch/Dockerfile.user.j2 \ sonic-slave-buster/Dockerfile.j2 sonic-slave-buster/Dockerfile.user.j2 \ - sonic-slave-bullseye/Dockerfile.j2 sonic-slave-bullseye/Dockerfile.user.j2 + sonic-slave-bullseye/Dockerfile.j2 sonic-slave-bullseye/Dockerfile.user.j2 \ + sonic-slave-bookworm/Dockerfile.j2 sonic-slave-bookworm/Dockerfile.user.j2 diff --git a/rules/config b/rules/config index bd77e91c59..a9969ccbda 100644 --- a/rules/config +++ b/rules/config @@ -314,7 +314,7 @@ SONIC_SLAVE_DOCKER_DRIVER ?= vfs GZ_COMPRESS_PROGRAM ?= gzip # SONIC_OS_VERSION - sonic os version -SONIC_OS_VERSION ?= 11 +SONIC_OS_VERSION ?= 12 # PIP timeout for http connection PIP_HTTP_TIMEOUT ?= 60 diff --git a/slave.mk b/slave.mk index 7069c3490a..ccc429c783 100644 --- a/slave.mk +++ b/slave.mk @@ -41,6 +41,8 @@ BUSTER_DEBS_PATH = $(TARGET_PATH)/debs/buster BUSTER_FILES_PATH = $(TARGET_PATH)/files/buster BULLSEYE_DEBS_PATH = $(TARGET_PATH)/debs/bullseye BULLSEYE_FILES_PATH = $(TARGET_PATH)/files/bullseye +BOOKWORM_DEBS_PATH = $(TARGET_PATH)/debs/bookworm +BOOKWORM_FILES_PATH = $(TARGET_PATH)/files/bookworm DBG_IMAGE_MARK = dbg DBG_SRC_ARCHIVE_FILE = $(TARGET_PATH)/sonic_src.tar.gz BUILD_WORKDIR = /sonic @@ -62,12 +64,12 @@ ifeq ($(CONFIGURED_ARCH),arm64) endif endif -IMAGE_DISTRO := bullseye +IMAGE_DISTRO := bookworm IMAGE_DISTRO_DEBS_PATH = $(TARGET_PATH)/debs/$(IMAGE_DISTRO) IMAGE_DISTRO_FILES_PATH = $(TARGET_PATH)/files/$(IMAGE_DISTRO) -# Python 2 packages will not be available in Bullseye -ifeq ($(BLDENV),bullseye) +# Python 2 packages will not be available in Bullseye and newer +ifneq ($(filter bullseye bookworm,$(BLDENV)),) ENABLE_PY2_MODULES = n else ENABLE_PY2_MODULES = y @@ -111,11 +113,13 @@ configure : $(Q)mkdir -p $(STRETCH_DEBS_PATH) $(Q)mkdir -p $(BUSTER_DEBS_PATH) $(Q)mkdir -p $(BULLSEYE_DEBS_PATH) + $(Q)mkdir -p $(BOOKWORM_DEBS_PATH) $(Q)mkdir -p $(FILES_PATH) $(Q)mkdir -p $(JESSIE_FILES_PATH) $(Q)mkdir -p $(STRETCH_FILES_PATH) $(Q)mkdir -p $(BUSTER_FILES_PATH) $(Q)mkdir -p $(BULLSEYE_FILES_PATH) + $(Q)mkdir -p $(BOOKWORM_FILES_PATH) $(Q)mkdir -p $(PYTHON_DEBS_PATH) $(Q)mkdir -p $(PYTHON_WHEELS_PATH) $(Q)mkdir -p $(DPKG_ADMINDIR_PATH) @@ -1035,6 +1039,10 @@ $(foreach DOCKER_IMAGE,$(SONIC_BUSTER_DOCKERS), $(eval $(DOCKER_IMAGE)_DEBS_PATH $(foreach DOCKER_IMAGE,$(SONIC_BUSTER_DOCKERS), $(eval $(DOCKER_IMAGE)_FILES_PATH := $(BUSTER_FILES_PATH))) $(foreach DOCKER_IMAGE,$(SONIC_BUSTER_DBG_DOCKERS), $(eval $(DOCKER_IMAGE)_DEBS_PATH := $(BUSTER_DEBS_PATH))) $(foreach DOCKER_IMAGE,$(SONIC_BUSTER_DBG_DOCKERS), $(eval $(DOCKER_IMAGE)_FILES_PATH := $(BUSTER_FILES_PATH))) +$(foreach DOCKER_IMAGE,$(SONIC_BULLSEYE_DOCKERS), $(eval $(DOCKER_IMAGE)_DEBS_PATH := $(BULLSEYE_DEBS_PATH))) +$(foreach DOCKER_IMAGE,$(SONIC_BULLSEYE_DOCKERS), $(eval $(DOCKER_IMAGE)_FILES_PATH := $(BULLSEYE_FILES_PATH))) +$(foreach DOCKER_IMAGE,$(SONIC_BULLSEYE_DBG_DOCKERS), $(eval $(DOCKER_IMAGE)_DEBS_PATH := $(BULLSEYE_DEBS_PATH))) +$(foreach DOCKER_IMAGE,$(SONIC_BULLSEYE_DBG_DOCKERS), $(eval $(DOCKER_IMAGE)_FILES_PATH := $(BULLSEYE_FILES_PATH))) ifeq ($(BLDENV),jessie) DOCKER_IMAGES := $(SONIC_JESSIE_DOCKERS) @@ -1054,8 +1062,15 @@ ifeq ($(BLDENV),buster) BUSTER_DOCKER_IMAGES = $(filter $(SONIC_BUSTER_DOCKERS),$(DOCKER_IMAGES_FOR_INSTALLERS) $(EXTRA_DOCKER_TARGETS) $(SONIC_PACKAGES_LOCAL)) BUSTER_DBG_DOCKER_IMAGES = $(filter $(SONIC_BUSTER_DBG_DOCKERS),$(DOCKER_IMAGES_FOR_INSTALLERS) $(EXTRA_DOCKER_TARGETS) $(SONIC_PACKAGES_LOCAL)) else - DOCKER_IMAGES = $(filter-out $(SONIC_JESSIE_DOCKERS) $(SONIC_STRETCH_DOCKERS) $(SONIC_BUSTER_DOCKERS),$(SONIC_DOCKER_IMAGES)) - DOCKER_DBG_IMAGES = $(filter-out $(SONIC_JESSIE_DBG_DOCKERS) $(SONIC_STRETCH_DBG_DOCKERS) $(SONIC_BUSTER_DBG_DOCKERS), $(SONIC_DOCKER_DBG_IMAGES)) +ifeq ($(BLDENV),bullseye) + DOCKER_IMAGES := $(SONIC_BULLSEYE_DOCKERS) + DOCKER_DBG_IMAGES := $(SONIC_BULLSEYE_DBG_DOCKERS) + BULLSEYE_DOCKER_IMAGES = $(filter $(SONIC_BULLSEYE_DOCKERS),$(DOCKER_IMAGES_FOR_INSTALLERS) $(EXTRA_DOCKER_TARGETS) $(SONIC_PACKAGES_LOCAL)) + BULLSEYE_DBG_DOCKER_IMAGES = $(filter $(SONIC_BULLSEYE_DBG_DOCKERS),$(DOCKER_IMAGES_FOR_INSTALLERS) $(EXTRA_DOCKER_TARGETS) $(SONIC_PACKAGES_LOCAL)) +else + DOCKER_IMAGES = $(filter-out $(SONIC_JESSIE_DOCKERS) $(SONIC_STRETCH_DOCKERS) $(SONIC_BUSTER_DOCKERS) $(SONIC_BULLSEYE_DOCKERS),$(SONIC_DOCKER_IMAGES)) + DOCKER_DBG_IMAGES = $(filter-out $(SONIC_JESSIE_DBG_DOCKERS) $(SONIC_STRETCH_DBG_DOCKERS) $(SONIC_BUSTER_DBG_DOCKERS) $(SONIC_BULLSEYE_DBG_DOCKERS), $(SONIC_DOCKER_DBG_IMAGES)) +endif endif endif endif @@ -1227,11 +1242,12 @@ DOCKER_LOAD_TARGETS = $(addsuffix -load,$(addprefix $(TARGET_PATH)/, \ $(DOCKER_IMAGES) \ $(DOCKER_DBG_IMAGES))) -ifeq ($(BLDENV),bullseye) +ifeq ($(BLDENV),bookworm) DOCKER_LOAD_TARGETS += $(addsuffix -load,$(addprefix $(TARGET_PATH)/, \ $(SONIC_JESSIE_DOCKERS) \ $(SONIC_STRETCH_DOCKERS) \ - $(SONIC_BUSTER_DOCKERS))) + $(SONIC_BUSTER_DOCKERS) \ + $(SONIC_BULLSEYE_DOCKERS))) endif @@ -1651,6 +1667,9 @@ clean :: .platform clean-logs clean-versions $$(SONIC_CLEAN_DEBS) $$(SONIC_CLEAN all : .platform $$(addprefix $(TARGET_PATH)/,$$(SONIC_ALL)) +bullseye : $$(addprefix $(TARGET_PATH)/,$$(BULLSEYE_DOCKER_IMAGES)) \ + $$(addprefix $(TARGET_PATH)/,$$(BULLSEYE_DBG_DOCKER_IMAGES)) + buster : $$(addprefix $(TARGET_PATH)/,$$(BUSTER_DOCKER_IMAGES)) \ $$(addprefix $(TARGET_PATH)/,$$(BUSTER_DBG_DOCKER_IMAGES))