diff --git a/Makefile b/Makefile index f3908ce55c4c..c949171a899a 100644 --- a/Makefile +++ b/Makefile @@ -1,20 +1,20 @@ # SONiC make file -NOSTRETCH ?= 0 +NOJESSIE ?= 0 %:: @echo "+++ --- Making $@ --- +++" -ifeq ($(NOSTRETCH), 0) - BLDENV=stretch EXTRA_STRETCH_TARGETS=$(notdir $@) make -f Makefile.work stretch +ifeq ($(NOJESSIE), 0) + EXTRA_JESSIE_TARGETS=$(notdir $@) make -f Makefile.work jessie endif - make -f Makefile.work $@ + BLDENV=stretch make -f Makefile.work $@ -stretch: +jessie: @echo "+++ Making $@ +++" -ifeq ($(NOSTRETCH), 0) - BLDENV=stretch make -f Makefile.work stretch +ifeq ($(NOJESSIE), 0) + make -f Makefile.work jessie endif clean reset init configure showtag sonic-slave-build sonic-slave-bash : @echo "+++ Making $@ +++" - make -f Makefile.work $@ + BLDENV=stretch make -f Makefile.work $@ diff --git a/Makefile.work b/Makefile.work index 95e7a2af444e..975b9a5dcd21 100644 --- a/Makefile.work +++ b/Makefile.work @@ -20,11 +20,10 @@ # * Please note that with current Stretch build structure, # * user of KEEP_SLAVE_ON feature will have to be conscious # * about which docker to stay inside after build is done. -# * - If user desires to stay inside Stretch docker, please issue -# * make KEEP_SLAVE_ON=yes stretch # * - If user desires to stay inside Jessie docker, please issue -# * (a successful "make stretch" may be needed before the following command) -# * make NOSTRETCH=1 KEEP_SLAVE_ON=yes +# * make KEEP_SLAVE_ON=yes jessie +# * - If user desires to stay inside Stretch docker, please issue +# * make NOJESSIE=1 KEEP_SLAVE_ON=yes # * SOURCE_FOLDER: host path to be mount as /var/$(USER)/src, only effective when KEEP_SLAVE_ON=yes # * SONIC_BUILD_JOBS: Specifying number of concurrent build job(s) to run # * VS_PREPARE_MEM: Prepare memory in VS build (drop cache and compact). @@ -123,7 +122,7 @@ SONIC_BUILD_INSTRUCTION := make \ HTTP_PROXY=$(http_proxy) \ HTTPS_PROXY=$(https_proxy) \ SONIC_ENABLE_SYSTEM_TELEMETRY=$(ENABLE_SYSTEM_TELEMETRY) \ - EXTRA_STRETCH_TARGETS=$(EXTRA_STRETCH_TARGETS) \ + EXTRA_JESSIE_TARGETS=$(EXTRA_JESSIE_TARGETS) \ $(SONIC_OVERRIDE_BUILD_VARS) .PHONY: sonic-slave-build sonic-slave-bash init reset diff --git a/README.md b/README.md index 84d08bd664a5..4f9ed41d22b1 100644 --- a/README.md +++ b/README.md @@ -71,9 +71,6 @@ To build SONiC installer image and docker images, run the following commands: # Execute make configure once to configure ASIC make configure PLATFORM=[ASIC_VENDOR] - # Build Debian Stretch required targets (Manual execution optional; will also be executed as part of the build) - BLDENV=stretch make stretch - # Build SONiC image make all diff --git a/build_debian.sh b/build_debian.sh index 1108c455722f..aac95008aee3 100755 --- a/build_debian.sh +++ b/build_debian.sh @@ -160,7 +160,7 @@ sudo chmod +x $FILESYSTEM_ROOT/etc/initramfs-tools/hooks/union-fsck pushd $FILESYSTEM_ROOT/usr/share/initramfs-tools/scripts/init-bottom && sudo patch -p1 < $OLDPWD/files/initramfs-tools/udev.patch; popd ## Install latest intel ixgbe driver -sudo cp target/files/stretch/ixgbe.ko $FILESYSTEM_ROOT/lib/modules/${LINUX_KERNEL_VERSION}-amd64/kernel/drivers/net/ethernet/intel/ixgbe/ixgbe.ko +sudo cp $files_path/ixgbe.ko $FILESYSTEM_ROOT/lib/modules/${LINUX_KERNEL_VERSION}-amd64/kernel/drivers/net/ethernet/intel/ixgbe/ixgbe.ko ## Install docker echo '[INFO] Install docker' diff --git a/files/build_templates/sonic_debian_extension.j2 b/files/build_templates/sonic_debian_extension.j2 index 2aa8e5da60c0..03ae5f317de6 100644 --- a/files/build_templates/sonic_debian_extension.j2 +++ b/files/build_templates/sonic_debian_extension.j2 @@ -111,6 +111,8 @@ sudo dpkg --root=$FILESYSTEM_ROOT -i $debs_path/python-click*_all.deb || \ # Install python pexpect used by sonic-utilities consutil # using pip install instead to get a more recent version than is available through debian sudo https_proxy=$https_proxy LANG=C chroot $FILESYSTEM_ROOT pip install pexpect +# Install python click-default-group by sonic-utilities +sudo https_proxy=$https_proxy LANG=C chroot $FILESYSTEM_ROOT pip install click-default-group==1.2 # Install tabulate >= 0.8.1 via pip in order to support multi-line row output for sonic-utilities sudo https_proxy=$https_proxy LANG=C chroot $FILESYSTEM_ROOT pip install tabulate==0.8.2 @@ -325,10 +327,10 @@ sudo cp {{src}} $FILESYSTEM_ROOT/{{dst}} {% if sonic_asic_platform == "mellanox" %} sudo mkdir -p $FILESYSTEM_ROOT/etc/mlnx/ -sudo cp target/files/$MLNX_SPC_FW_FILE $FILESYSTEM_ROOT/etc/mlnx/fw-SPC.mfa -sudo cp target/files/$MLNX_SPC2_FW_FILE $FILESYSTEM_ROOT/etc/mlnx/fw-SPC2.mfa -sudo cp target/files/$ISSU_VERSION_FILE $FILESYSTEM_ROOT/etc/mlnx/issu-version -sudo cp target/files/$MLNX_FFB_SCRIPT $FILESYSTEM_ROOT/usr/bin/mlnx-ffb.sh +sudo cp $files_path/$MLNX_SPC_FW_FILE $FILESYSTEM_ROOT/etc/mlnx/fw-SPC.mfa +sudo cp $files_path/$MLNX_SPC2_FW_FILE $FILESYSTEM_ROOT/etc/mlnx/fw-SPC2.mfa +sudo cp $files_path/$ISSU_VERSION_FILE $FILESYSTEM_ROOT/etc/mlnx/issu-version +sudo cp $files_path/$MLNX_FFB_SCRIPT $FILESYSTEM_ROOT/usr/bin/mlnx-ffb.sh j2 platform/mellanox/mlnx-fw-upgrade.j2 | sudo tee $FILESYSTEM_ROOT/usr/bin/mlnx-fw-upgrade.sh sudo chmod 755 $FILESYSTEM_ROOT/usr/bin/mlnx-fw-upgrade.sh {% endif %} diff --git a/rules/docker-base-stretch.mk b/rules/docker-base-stretch.mk index 898e018f9b10..a2495ed31659 100644 --- a/rules/docker-base-stretch.mk +++ b/rules/docker-base-stretch.mk @@ -16,4 +16,5 @@ ifeq ($(INSTALL_DEBUG_TOOLS),y) $(DOCKER_BASE_STRETCH)_DBG_PACKAGES += $($(DOCKER_BASE_STRETCH)_DBG_IMAGE_PACKAGES) endif +SONIC_DOCKER_IMAGES += $(DOCKER_BASE_STRETCH) SONIC_STRETCH_DOCKERS += $(DOCKER_BASE_STRETCH) diff --git a/rules/docker-config-engine-stretch.mk b/rules/docker-config-engine-stretch.mk index a18ed380f6f2..2a1e36d28833 100644 --- a/rules/docker-config-engine-stretch.mk +++ b/rules/docker-config-engine-stretch.mk @@ -9,4 +9,5 @@ $(DOCKER_CONFIG_ENGINE_STRETCH)_LOAD_DOCKERS += $(DOCKER_BASE_STRETCH) $(DOCKER_CONFIG_ENGINE_STRETCH)_DBG_DEPENDS = $($(DOCKER_BASE_STRETCH)_DBG_DEPENDS) $(DOCKER_CONFIG_ENGINE_STRETCH)_DBG_IMAGE_PACKAGES = $($(DOCKER_BASE_STRETCH)_DBG_IMAGE_PACKAGES) +SONIC_DOCKER_IMAGES += $(DOCKER_CONFIG_ENGINE_STRETCH) SONIC_STRETCH_DOCKERS += $(DOCKER_CONFIG_ENGINE_STRETCH) diff --git a/rules/docker-ptf.mk b/rules/docker-ptf.mk index 2782c45339bd..aa517bf16d74 100644 --- a/rules/docker-ptf.mk +++ b/rules/docker-ptf.mk @@ -4,3 +4,4 @@ DOCKER_PTF = docker-ptf.gz $(DOCKER_PTF)_PATH = $(DOCKERS_PATH)/docker-ptf $(DOCKER_PTF)_DEPENDS += $(LIBTHRIFT) $(PYTHON_THRIFT) $(PTF) SONIC_DOCKER_IMAGES += $(DOCKER_PTF) +SONIC_JESSIE_DOCKERS += $(DOCKER_PTF) diff --git a/slave.mk b/slave.mk index 0e6e2adcb37f..6cedda612024 100644 --- a/slave.mk +++ b/slave.mk @@ -471,17 +471,17 @@ $(addprefix $(TARGET_PATH)/, $(SONIC_SIMPLE_DOCKER_IMAGES)) : $(TARGET_PATH)/%.g SONIC_TARGET_LIST += $(addprefix $(TARGET_PATH)/, $(SONIC_SIMPLE_DOCKER_IMAGES)) -# Build stretch docker images only in stretch slave docker, +# Build jessie docker images only in jessie slave docker, # jessie docker images only in jessie slave docker -ifeq ($(BLDENV),stretch) +ifeq ($(BLDENV),) DOCKER_IMAGES_FOR_INSTALLERS := $(sort $(foreach installer,$(SONIC_INSTALLERS),$($(installer)_DOCKERS))) - DOCKER_IMAGES := $(SONIC_STRETCH_DOCKERS) - DOCKER_DBG_IMAGES := $(SONIC_STRETCH_DBG_DOCKERS) - SONIC_STRETCH_DOCKERS_FOR_INSTALLERS = $(filter $(SONIC_STRETCH_DOCKERS),$(DOCKER_IMAGES_FOR_INSTALLERS) $(EXTRA_STRETCH_TARGETS)) - SONIC_STRETCH_DBG_DOCKERS_FOR_INSTALLERS = $(filter $(SONIC_STRETCH_DBG_DOCKERS), $(patsubst %.gz,%-$(DBG_IMAGE_MARK).gz, $(SONIC_STRETCH_DOCKERS_FOR_INSTALLERS))) + DOCKER_IMAGES := $(SONIC_JESSIE_DOCKERS) + DOCKER_DBG_IMAGES := $(SONIC_JESSIE_DBG_DOCKERS) + SONIC_JESSIE_DOCKERS_FOR_INSTALLERS = $(filter $(SONIC_JESSIE_DOCKERS),$(DOCKER_IMAGES_FOR_INSTALLERS) $(EXTRA_JESSIE_TARGETS)) + SONIC_JESSIE_DBG_DOCKERS_FOR_INSTALLERS = $(filter $(SONIC_JESSIE_DBG_DOCKERS), $(patsubst %.gz,%-$(DBG_IMAGE_MARK).gz, $(SONIC_JESSIE_DOCKERS_FOR_INSTALLERS))) else - DOCKER_IMAGES := $(filter-out $(SONIC_STRETCH_DOCKERS), $(SONIC_DOCKER_IMAGES)) - DOCKER_DBG_IMAGES := $(filter-out $(SONIC_STRETCH_DBG_DOCKERS), $(SONIC_DOCKER_DBG_IMAGES)) + DOCKER_IMAGES := $(filter-out $(SONIC_JESSIE_DOCKERS), $(SONIC_DOCKER_IMAGES)) + DOCKER_DBG_IMAGES := $(filter-out $(SONIC_JESSIE_DBG_DOCKERS), $(SONIC_DOCKER_DBG_IMAGES)) endif # Targets for building docker images @@ -593,6 +593,7 @@ $(addprefix $(TARGET_PATH)/, $(SONIC_INSTALLERS)) : $(TARGET_PATH)/% : \ $(HEADER) # Pass initramfs and linux kernel explicitly. They are used for all platforms export debs_path="$(STRETCH_DEBS_PATH)" + export files_path="$(FILES_PATH)" export python_debs_path="$(PYTHON_DEBS_PATH)" export initramfs_tools="$(STRETCH_DEBS_PATH)/$(INITRAMFS_TOOLS)" export linux_kernel="$(STRTCH_DEBS_PATH)/$(LINUX_KERNEL)" @@ -719,6 +720,7 @@ stretch : $$(addprefix $(DEBS_PATH)/,$$(SONIC_STRETCH_DEBS)) \ $$(addprefix $(TARGET_PATH)/,$$(SONIC_STRETCH_DOCKERS_FOR_INSTALLERS)) \ $$(addprefix $(TARGET_PATH)/,$$(SONIC_STRETCH_DBG_DOCKERS_FOR_INSTALLERS)) +jessie : $$(addprefix $(TARGET_PATH)/,$$(SONIC_JESSIE_DOCKERS_FOR_INSTALLERS)) ############################################################################### ## Standard targets diff --git a/sonic-slave-stretch/Dockerfile b/sonic-slave-stretch/Dockerfile index 5cb328f6b257..9d94d11197e0 100644 --- a/sonic-slave-stretch/Dockerfile +++ b/sonic-slave-stretch/Dockerfile @@ -232,6 +232,10 @@ RUN apt-get update && apt-get install -y \ python3-colorama \ # For initramfs bash-completion \ +# For sonic vs image build + dosfstools \ + qemu-kvm \ + libvirt-clients \ # For lm-sensors librrd8 \ librrd-dev \ @@ -282,6 +286,9 @@ RUN pip3 install redis # For supervisor build RUN pip install meld3 mock +# For vs image build +RUN pip install pexpect==4.6.0 + # For sonic-utilities build RUN pip install mockredispy==2.9.3 RUN pip install pytest-runner==4.4