Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build sonic-broadcom.bin using debug dockers for all stretch based dockers #2833

Merged
merged 29 commits into from
Jun 12, 2019
Merged
Show file tree
Hide file tree
Changes from 25 commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
941eb7d
Updated Makefile infrastructure to build debug images.
renukamanavalan Apr 5, 2019
042d51e
Dropped the regular binary using DBG_PACKAGES and a small name change…
renukamanavalan Apr 6, 2019
24f38f2
Tweaked the changes to retain the existing behavior w.r.t INSTALL_DEB…
renukamanavalan Apr 8, 2019
4443c70
1) slave.mk - Dropped unused Docker build args
renukamanavalan Apr 11, 2019
7b84e64
Reverted some changes, per review comments.
renukamanavalan Apr 11, 2019
c717e50
Merge remote-tracking branch 'upstream/master'
renukamanavalan Apr 12, 2019
60a001c
Get in sync with the new update that filters out dockers to be built …
renukamanavalan Apr 12, 2019
cefc4b8
Merge remote-tracking branch 'upstream/master'
renukamanavalan Apr 15, 2019
f659917
Mkae a template for each target that can be shared by all platforms.
renukamanavalan Apr 15, 2019
9d7aedb
A small change, that can fit better with other targets too.
renukamanavalan Apr 15, 2019
279084f
Extended debug to all stretch based docker images
renukamanavalan Apr 16, 2019
99783dd
Merge remote-tracking branch 'upstream/master'
renukamanavalan Apr 18, 2019
a2297a3
1) Combined all orchagent makefiles into one platform independent mak…
renukamanavalan Apr 18, 2019
b4b30fd
Changes per review comments:
renukamanavalan Apr 18, 2019
575e43d
Merge remote-tracking branch 'upstream/master'
renukamanavalan Apr 18, 2019
e504eb7
1) Corrected a copy/paste mistake
renukamanavalan Apr 18, 2019
0db6c0f
Fixed a copy/paste bug
renukamanavalan Apr 19, 2019
755dcee
Merge remote-tracking branch 'upstream/master'
renukamanavalan Apr 22, 2019
6f1c92b
The base syncd dockers follow a template, which defines the base dock…
renukamanavalan Apr 22, 2019
3d74bcc
Fixed spelling mistake
renukamanavalan Apr 22, 2019
e537676
Merge remote-tracking branch 'upstream/master'
renukamanavalan Apr 28, 2019
31fa832
Enable build of dbg-sonic-broadcom.bin, which uses dbg-dockers in pla…
renukamanavalan Apr 28, 2019
b9ced6f
Sync with master
renukamanavalan May 17, 2019
fbaabca
Merge remote-tracking branch 'upstream/master'
renukamanavalan May 20, 2019
af4d3da
Per review comments:
renukamanavalan May 20, 2019
fc019bb
Merge remote-tracking branch 'upstream/master'
renukamanavalan Jun 2, 2019
1ccee7d
Updated per comments.
renukamanavalan Jun 2, 2019
fe438f8
Removed changes that are no more warranted.
renukamanavalan Jun 2, 2019
3fcfc18
Merge branch 'master' into master
lguohan Jun 11, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 12 additions & 2 deletions build_image.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ IMAGE_VERSION=$(. functions.sh && sonic_get_version)

generate_onie_installer_image()
{
# clean up any temp onie image
mkdir -p `dirname $OUTPUT_ONIE_IMAGE`
sudo rm -f $OUTPUT_ONIE_IMAGE

# Copy platform-specific ONIE installer config files where onie-mk-demo.sh expects them
rm -rf ./installer/x86_64/platforms/
mkdir -p ./installer/x86_64/platforms/
Expand All @@ -35,13 +39,19 @@ generate_onie_installer_image()
$ONIE_INSTALLER_PAYLOAD
}


if [ "$IMAGE_TYPE" = "onie" ]; then
echo "Build ONIE installer"
mkdir -p `dirname $OUTPUT_ONIE_IMAGE`
sudo rm -f $OUTPUT_ONIE_IMAGE
# Clean up any old copy of target
mkdir -p `dirname $IMAGE_TARGET`
sudo rm -f $IMAGE_TARGET


generate_onie_installer_image

sudo mv $OUTPUT_ONIE_IMAGE $IMAGE_TARGET


renukamanavalan marked this conversation as resolved.
Show resolved Hide resolved
## Build a raw partition dump image using the ONIE installer that can be
## used to dd' in-lieu of using the onie-nos-installer. Used while migrating
## into SONiC from other NOS.
Expand Down
5 changes: 5 additions & 0 deletions files/build_templates/sonic_debian_extension.j2
Original file line number Diff line number Diff line change
Expand Up @@ -286,6 +286,11 @@ sudo chroot $FILESYSTEM_ROOT docker info
{% set imagename = imagefilename.split('.')|first -%}
sudo LANG=C chroot $FILESYSTEM_ROOT docker load < {{image}}
sudo LANG=C chroot $FILESYSTEM_ROOT docker tag {{imagename}}:latest {{imagename}}:$(sonic_get_version)
{% if imagename.endswith('-dbg') %}
{% set imagebasename = imagename.replace('-dbg', '') -%}
sudo LANG=C chroot $FILESYSTEM_ROOT docker tag {{imagename}}:latest {{imagebasename}}:$(sonic_get_version)
sudo LANG=C chroot $FILESYSTEM_ROOT docker tag {{imagename}}:latest {{imagebasename}}:latest
{% endif %}
{% endfor %}
sudo chroot $FILESYSTEM_ROOT service docker stop
sudo rm $FILESYSTEM_ROOT/etc/init.d/docker
Expand Down
2 changes: 1 addition & 1 deletion onie-image.conf
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ FILESYSTEM_DOCKERFS=dockerfs.tar.gz
DOCKERFS_DIR=docker

## Output file name for onie installer
OUTPUT_ONIE_IMAGE=target/sonic-$TARGET_MACHINE.bin
OUTPUT_ONIE_IMAGE=target/sonic-$TARGET_MACHINE-tmp.bin

## Output file name for raw image
OUTPUT_RAW_IMAGE=target/sonic-$TARGET_MACHINE.raw
Expand Down
6 changes: 5 additions & 1 deletion platform/broadcom/one-image.mk
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# sonic broadcom one image installer

SONIC_ONE_IMAGE = sonic-broadcom.bin
SONIC_ONE_IMAGE_STEM = sonic-broadcom
SONIC_ONE_IMAGE = $(SONIC_ONE_IMAGE_STEM).bin
$(SONIC_ONE_IMAGE)_MACHINE = broadcom
$(SONIC_ONE_IMAGE)_IMAGE_TYPE = onie
$(SONIC_ONE_IMAGE)_INSTALLS += $(BRCM_OPENNSL_KERNEL)
Expand Down Expand Up @@ -38,4 +39,7 @@ $(SONIC_ONE_IMAGE)_LAZY_INSTALLS += $(DELL_S6000_PLATFORM_MODULE) \
$(ALPHANETWORKS_SNH60A0_320FV2_PLATFORM_MODULE) \
$(ALPHANETWORKS_SNH60B0_640F_PLATFORM_MODULE)
$(SONIC_ONE_IMAGE)_DOCKERS += $(SONIC_INSTALL_DOCKER_IMAGES)
$(SONIC_ONE_IMAGE)_DBG_DOCKERS += $(SONIC_INSTALL_DOCKER_DBG_IMAGES)
$(SONIC_ONE_IMAGE)_DBG_DOCKERS += $(filter-out $(patsubst %-$(DBG_IMAGE_MARK).gz,%.gz, $(SONIC_INSTALL_DOCKER_DBG_IMAGES)), $(SONIC_INSTALL_DOCKER_IMAGES))
SONIC_INSTALLERS += $(SONIC_ONE_IMAGE)
SONIC_DBG_INSTALLERS += $(DBG_IMAGE_MARK)-$(SONIC_ONE_IMAGE)
renukamanavalan marked this conversation as resolved.
Show resolved Hide resolved
44 changes: 23 additions & 21 deletions slave.mk
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ PROJECT_ROOT = $(shell pwd)
STRETCH_DEBS_PATH = $(TARGET_PATH)/debs/stretch
STRETCH_FILES_PATH = $(TARGET_PATH)/files/stretch
DBG_IMAGE_MARK = dbg
SUFFIX_DBG_IMAGE_MARK = -dbg

CONFIGURED_PLATFORM := $(shell [ -f .platform ] && cat .platform || echo generic)
PLATFORM_PATH = platform/$(CONFIGURED_PLATFORM)
Expand Down Expand Up @@ -574,17 +575,17 @@ $(addprefix $(TARGET_PATH)/, $(SONIC_INSTALLERS)) : $(TARGET_PATH)/% : \
onie-image.conf \
build_debian.sh \
build_image.sh \
$$(addsuffix -install,$$(addprefix $(STRETCH_DEBS_PATH)/,$$($$*_DEPENDS))) \
$$(addprefix $(STRETCH_DEBS_PATH)/,$$($$*_INSTALLS)) \
$$(addprefix $(STRETCH_DEBS_PATH)/,$$($$*_LAZY_INSTALLS)) \
$$(addsuffix -install,$$(addprefix $(STRETCH_DEBS_PATH)/,$$($$(subst $(SUFFIX_DBG_IMAGE_MARK),$(NULL),$$*)_DEPENDS))) \
$$(addprefix $(STRETCH_DEBS_PATH)/,$$($$(subst $(SUFFIX_DBG_IMAGE_MARK),$(NULL),$$*)_INSTALLS)) \
renukamanavalan marked this conversation as resolved.
Show resolved Hide resolved
$$(addprefix $(STRETCH_DEBS_PATH)/,$$($$(subst $(SUFFIX_DBG_IMAGE_MARK),$(NULL),$$*)_LAZY_INSTALLS)) \
$(addprefix $(STRETCH_DEBS_PATH)/,$(INITRAMFS_TOOLS) \
$(LINUX_KERNEL) \
$(SONIC_DEVICE_DATA) \
$(PYTHON_CLICK) \
$(LIBPAM_TACPLUS) \
$(LIBNSS_TACPLUS)) \
$$(addprefix $(TARGET_PATH)/,$$($$*_DOCKERS)) \
$$(addprefix $(FILES_PATH)/,$$($$*_FILES)) \
$$(addprefix $(FILES_PATH)/,$$($$(subst $(SUFFIX_DBG_IMAGE_MARK),$(NULL),$$*)_FILES)) \
$(addprefix $(STRETCH_FILES_PATH)/,$(IXGBE_DRIVER)) \
$(addprefix $(PYTHON_DEBS_PATH)/,$(SONIC_UTILS)) \
$(addprefix $(PYTHON_WHEELS_PATH)/,$(SONIC_CONFIG_ENGINE)) \
Expand All @@ -598,15 +599,15 @@ $(addprefix $(TARGET_PATH)/, $(SONIC_INSTALLERS)) : $(TARGET_PATH)/% : \
export linux_kernel="$(STRTCH_DEBS_PATH)/$(LINUX_KERNEL)"
export onie_recovery_image="$(FILES_PATH)/$(ONIE_RECOVERY_IMAGE)"
export kversion="$(KVERSION)"
export image_type="$($*_IMAGE_TYPE)"
export image_type="$($(subst $(SUFFIX_DBG_IMAGE_MARK),$(NULL),$*)_IMAGE_TYPE)"
export sonicadmin_user="$(USERNAME)"
export sonic_asic_platform="$(CONFIGURED_PLATFORM)"
export enable_organization_extensions="$(ENABLE_ORGANIZATION_EXTENSIONS)"
export enable_dhcp_graph_service="$(ENABLE_DHCP_GRAPH_SERVICE)"
export shutdown_bgp_on_start="$(SHUTDOWN_BGP_ON_START)"
export enable_pfcwd_on_start="$(ENABLE_PFCWD_ON_START)"
export installer_debs="$(addprefix $(STRETCH_DEBS_PATH)/,$($*_INSTALLS))"
export lazy_installer_debs="$(foreach deb, $($*_LAZY_INSTALLS),$(foreach device, $($(deb)_PLATFORM),$(addprefix $(device)@, $(STRETCH_DEBS_PATH)/$(deb))))"
export installer_debs="$(addprefix $(STRETCH_DEBS_PATH)/,$($(subst $(SUFFIX_DBG_IMAGE_MARK),$(NULL),$*)_INSTALLS))"
export lazy_installer_debs="$(foreach deb, $($(subst $(SUFFIX_DBG_IMAGE_MARK),$(NULL),$*)_LAZY_INSTALLS),$(foreach device, $($(deb)_PLATFORM),$(addprefix $(device)@, $(STRETCH_DEBS_PATH)/$(deb))))"
export installer_images="$(addprefix $(TARGET_PATH)/,$($*_DOCKERS))"
export config_engine_wheel_path="$(addprefix $(PYTHON_WHEELS_PATH)/,$(SONIC_CONFIG_ENGINE))"
export swsssdk_py2_wheel_path="$(addprefix $(PYTHON_WHEELS_PATH)/,$(SWSSSDK_PY2))"
Expand All @@ -616,19 +617,19 @@ $(addprefix $(TARGET_PATH)/, $(SONIC_INSTALLERS)) : $(TARGET_PATH)/% : \
$(foreach docker, $($*_DOCKERS),\
export docker_image="$(docker)"
export docker_image_name="$(basename $(docker))"
export docker_container_name="$($(docker)_CONTAINER_NAME)"
$(eval $(docker)_RUN_OPT += $($(docker)_$($*_IMAGE_TYPE)_RUN_OPT))
export docker_image_run_opt="$($(docker)_RUN_OPT)"
j2 files/build_templates/docker_image_ctl.j2 > $($(docker)_CONTAINER_NAME).sh
if [ -f files/build_templates/$($(docker)_CONTAINER_NAME).service.j2 ]; then
j2 files/build_templates/$($(docker)_CONTAINER_NAME).service.j2 > $($(docker)_CONTAINER_NAME).service
export docker_container_name="$($(docker:-dbg.gz=.gz)_CONTAINER_NAME)"
$(eval $(docker:-dbg.gz=.gz)_RUN_OPT += $($(docker:-dbg.gz=.gz)_$($(subst $(SUFFIX_DBG_IMAGE_MARK),$(NULL),$*)_IMAGE_TYPE)_RUN_OPT))
export docker_image_run_opt="$($(docker:-dbg.gz=.gz)_RUN_OPT)"
j2 files/build_templates/docker_image_ctl.j2 > $($(docker:-dbg.gz=.gz)_CONTAINER_NAME).sh
if [ -f files/build_templates/$($(docker:-dbg.gz=.gz)_CONTAINER_NAME).service.j2 ]; then
j2 files/build_templates/$($(docker:-dbg.gz=.gz)_CONTAINER_NAME).service.j2 > $($(docker:-dbg.gz=.gz)_CONTAINER_NAME).service
fi
chmod +x $($(docker)_CONTAINER_NAME).sh
chmod +x $($(docker:-dbg.gz=.gz)_CONTAINER_NAME).sh
)

export installer_start_scripts="$(foreach docker, $($*_DOCKERS),$(addsuffix .sh, $($(docker)_CONTAINER_NAME)))"
export installer_services="$(foreach docker, $($*_DOCKERS),$(addsuffix .service, $($(docker)_CONTAINER_NAME)))"
export installer_extra_files="$(foreach docker, $($*_DOCKERS), $(foreach file, $($(docker)_BASE_IMAGE_FILES), $($(docker)_PATH)/base_image_files/$(file)))"
export installer_start_scripts="$(foreach docker, $($*_DOCKERS),$(addsuffix .sh, $($(docker:-dbg.gz=.gz)_CONTAINER_NAME)))"
export installer_services="$(foreach docker, $($*_DOCKERS),$(addsuffix .service, $($(docker:-dbg.gz=.gz)_CONTAINER_NAME)))"
export installer_extra_files="$(foreach docker, $($*_DOCKERS), $(foreach file, $($(docker:-dbg.gz=.gz)_BASE_IMAGE_FILES), $($(docker:-dbg.gz=.gz)_PATH)/base_image_files/$(file)))"

j2 -f env files/initramfs-tools/union-mount.j2 onie-image.conf > files/initramfs-tools/union-mount
j2 -f env files/initramfs-tools/arista-convertfs.j2 onie-image.conf > files/initramfs-tools/arista-convertfs
Expand All @@ -646,13 +647,14 @@ $(addprefix $(TARGET_PATH)/, $(SONIC_INSTALLERS)) : $(TARGET_PATH)/% : \

USERNAME="$(USERNAME)" \
PASSWORD="$(PASSWORD)" \
TARGET_MACHINE=$($*_MACHINE) \
IMAGE_TYPE=$($*_IMAGE_TYPE) \
TARGET_MACHINE=$($(subst $(SUFFIX_DBG_IMAGE_MARK),$(NULL),$*)_MACHINE) \
IMAGE_TYPE=$($(subst $(SUFFIX_DBG_IMAGE_MARK),$(NULL),$*)_IMAGE_TYPE) \
IMAGE_TARGET=$@ \
./build_image.sh $(LOG)

$(foreach docker, $($*_DOCKERS), \
rm -f $($(docker)_CONTAINER_NAME).sh
rm -f $($(docker)_CONTAINER_NAME).service
rm -f $($(docker:-dbg.gz=.gz)_CONTAINER_NAME).sh
rm -f $($(docker:-dbg.gz=.gz)_CONTAINER_NAME).service
)

$(if $($*_DOCKERS),
Expand Down