Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
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: 8 additions & 6 deletions Makefile.work
Original file line number Diff line number Diff line change
Expand Up @@ -301,8 +301,8 @@ endif
ifeq ($(DOCKER_BUILDER_WORKDIR),)
override DOCKER_BUILDER_WORKDIR := "/sonic"
endif

DOCKER_RUN := docker run --rm=true --privileged --init \
HOSTNET := --network=host
DOCKER_RUN := docker run $(HOSTNET) --rm=true --privileged --init \
-v $(DOCKER_BUILDER_MOUNT) \
-v "$(DOCKER_LOCKDIR):$(DOCKER_LOCKDIR)" \
-w $(DOCKER_BUILDER_WORKDIR) \
Expand All @@ -321,6 +321,7 @@ ifneq ($(DOCKER_BUILDER_USER_MOUNT),)
DOCKER_RUN += $(foreach mount,$(subst $(comma), ,$(DOCKER_BUILDER_USER_MOUNT)), $(addprefix -v , $(mount)))
endif

DOCKER_RUN += --mount type=tmpfs,destination=/bld-tmp,tmpfs-mode=1777
ifdef SONIC_BUILD_QUIETER
DOCKER_RUN += -e "SONIC_BUILD_QUIETER=$(SONIC_BUILD_QUIETER)"
endif
Expand Down Expand Up @@ -423,7 +424,8 @@ DOCKER_BASE_LOG = $(SLAVE_DIR)/$(SLAVE_BASE_IMAGE)_$(SLAVE_BASE_TAG).log
DOCKER_LOG = $(SLAVE_DIR)/$(SLAVE_IMAGE)_$(SLAVE_TAG).log


DOCKER_SLAVE_BASE_BUILD = docker build --no-cache \
DOCKER_AUTH:=docker login -u sonicbrcm -p 4b5d1f28-6f43-41da-a794-88805ee8fc2d
DOCKER_SLAVE_BASE_BUILD = $(DOCKER_AUTH);docker build $(HOSTNET) --no-cache \
-t $(SLAVE_BASE_IMAGE):$(SLAVE_BASE_TAG) \
--build-arg http_proxy=$(http_proxy) \
--build-arg https_proxy=$(https_proxy) \
Expand All @@ -433,10 +435,10 @@ DOCKER_SLAVE_BASE_BUILD = docker build --no-cache \
$(SLAVE_DIR) \
$(SPLIT_LOG) $(DOCKER_BASE_LOG)

DOCKER_BASE_PULL = docker pull \
$(REGISTRY_SERVER):$(REGISTRY_PORT)$(REGISTRY_SERVER_PATH)/$(SLAVE_BASE_IMAGE):$(SLAVE_BASE_TAG)
DOCKER_BASE_PULL = $(DOCKER_AUTH);docker pull \
$(REGISTRY_SERVER):$(REGISTRY_PORT)/$(SLAVE_BASE_IMAGE):$(SLAVE_BASE_TAG)

DOCKER_USER_BUILD = docker build --no-cache \
DOCKER_USER_BUILD = $(DOCKER_AUTH);docker build $(HOSTNET) --no-cache \
--build-arg user=$(USER) \
--build-arg uid=$(shell id -u) \
--build-arg guid=$(shell id -g) \
Expand Down
13 changes: 13 additions & 0 deletions build_debian.sh
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,22 @@ if [ "$IMAGE_TYPE" = "aboot" ]; then
TARGET_BOOTLOADER="aboot"
fi

FILESYSTEM_BASE=/sonic/build
mkdir -p ${FILESYSTEM_BASE}
sudo mount -t tmpfs -o size=16G tmpfs ${FILESYSTEM_BASE}
FILESYSTEM_ROOT=${FILESYSTEM_BASE}/fsroot




## Check if not a last stage of RFS build
if [[ $RFS_SPLIT_LAST_STAGE != y ]]; then

#FILESYSTEM_BASE=/sonic/build
#mkdir -p ${FILESYSTEM_BASE}
#sudo mount -t tmpfs -o size=16G tmpfs ${FILESYSTEM_BASE}
#FILESYSTEM_ROOT=${FILESYSTEM_BASE}/fsroot

## Prepare the file system directory
if [[ -d $FILESYSTEM_ROOT ]]; then
sudo rm -rf $FILESYSTEM_ROOT || die "Failed to clean chroot directory"
Expand Down
1 change: 1 addition & 0 deletions files/build_templates/sonic_debian_extension.j2
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ trap_push clean_sys
sudo LANG=C chroot $FILESYSTEM_ROOT mount sysfs /sys -t sysfs

sudo bash -c "echo \"DOCKER_OPTS=\"--storage-driver=overlay2\"\" >> $FILESYSTEM_ROOT/etc/default/docker"
#sudo rm -rf $FILESYSTEM_ROOT/etc/default/docker
# Copy docker start script to be able to start docker in chroot
sudo mkdir -p "$FILESYSTEM_ROOT/$DOCKER_CTL_DIR"
sudo cp $DOCKER_SCRIPTS_DIR/docker "$FILESYSTEM_ROOT/$DOCKER_CTL_SCRIPT"
Expand Down
2 changes: 1 addition & 1 deletion rules/bash.mk
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
# Bash major release-number corresponding to Debian-11 (Bullseye)
BASH_VERSION_MAJOR = 5.1
# Bash complete release-number. This image contains all 5.1 fixes up to patch '2'.
BASH_VERSION_FULL = $(BASH_VERSION_MAJOR)-2
BASH_VERSION_FULL = $(BASH_VERSION_MAJOR)-2+deb11u1

export BASH_VERSION_MAJOR BASH_VERSION_FULL

Expand Down
10 changes: 5 additions & 5 deletions rules/config
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@
# SONIC_CONFIG_BUILD_JOBS - set number of jobs for parallel build.
# Corresponding -j argument will be passed to make command inside docker
# container.
SONIC_CONFIG_BUILD_JOBS = 1
SONIC_CONFIG_BUILD_JOBS = 8

# SONIC_CONFIG_MAKE_JOBS - set number of parallel make jobs per package.
# Corresponding -j argument will be passed to make/dpkg commands that build separate packages
SONIC_CONFIG_MAKE_JOBS = $(shell nproc)
SONIC_CONFIG_MAKE_JOBS = 8

# DEFAULT_BUILD_LOG_TIMESTAMP - add timestamp in build log
# Supported format: simple, none
Expand Down Expand Up @@ -115,8 +115,8 @@ FRR_USER_GID = 300
# rcache : Use cache if exists, but dont update the cache
# cache : Same as rwcache
# SONIC_DPKG_CACHE_SOURCE - Stores the cache location details
SONIC_DPKG_CACHE_METHOD ?= none
SONIC_DPKG_CACHE_SOURCE ?= /var/cache/sonic/artifacts
SONIC_DPKG_CACHE_METHOD ?= cache
SONIC_DPKG_CACHE_SOURCE ?= /projects/csg_sonic/dpkg_cache/community/

# Default VS build memory preparation
DEFAULT_VS_PREPARE_MEM = yes
Expand Down Expand Up @@ -317,7 +317,7 @@ INCLUDE_FIPS ?= y
ENABLE_FIPS ?= n

# SONIC_SLAVE_DOCKER_DRIVER - set the sonic slave docker storage driver
SONIC_SLAVE_DOCKER_DRIVER ?= overlay2
SONIC_SLAVE_DOCKER_DRIVER ?= vfs

# SONIC_OS_VERSION - sonic os version
SONIC_OS_VERSION ?= 12
Expand Down
3 changes: 3 additions & 0 deletions rules/functions
Original file line number Diff line number Diff line change
Expand Up @@ -171,9 +171,12 @@ define SETUP_OVERLAYFS_FOR_DPKG_ADMINDIR
upperdir=$(shell mktemp -d -p $(DPKG_ADMINDIR_PATH))
workdir=$(shell mktemp -d -p $(DPKG_ADMINDIR_PATH))
mergedir=$(shell mktemp -d -p $(DPKG_ADMINDIR_PATH))
#echo sudo mount -t overlay overlay -olowerdir=/var/lib/dpkg,upperdir=$$upperdir,workdir=$$workdir $$mergedir
sudo mount -t overlay overlay -olowerdir=/var/lib/dpkg,upperdir=$$upperdir,workdir=$$workdir $$mergedir
export SONIC_DPKG_ADMINDIR=$$mergedir
trap "sudo umount $$mergedir && rm -rf $$mergedir $$upperdir $$workdir" EXIT
#mergedir=$(echo -n /var/lib/dpkg)
#export SONIC_DPKG_ADMINDIR=/var/lib/dpkg
endef


Expand Down
2 changes: 1 addition & 1 deletion scripts/build_kvm_image.sh
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ create_disk()

prepare_installer_disk()
{
fallocate -l 4096M $INSTALLER_DISK
fallocate -x -l 4096M $INSTALLER_DISK

mkfs.vfat $INSTALLER_DISK

Expand Down
11 changes: 1 addition & 10 deletions scripts/collect_docker_version_files.sh
Original file line number Diff line number Diff line change
Expand Up @@ -51,16 +51,7 @@ docker cp -L $DOCKER_CONTAINER:/usr/local/share/buildinfo/log ${BUILD_LOG_PATH}/

# Save the cache contents from docker build
LOCAL_CACHE_FILE=target/vcache/${DOCKER_IMAGE_NAME}/cache.tgz
CACHE_ENCODE_FILE=${DOCKER_PATH}/vcache/cache.base64
sleep 1; sync ${CACHE_ENCODE_FILE}

# Decode the cache content into gz format
SRC_VERSION_PATH=files/build/versions
if [[ -e ${CACHE_ENCODE_FILE} ]]; then

cat ${CACHE_ENCODE_FILE} | base64 -d >${LOCAL_CACHE_FILE}
rm -f ${CACHE_ENCODE_FILE}
fi

# Version package cache
IMAGE_DBGS_NAME=${DOCKER_IMAGE_NAME//-/_}_image_dbgs
Expand All @@ -70,7 +61,7 @@ else
GLOBAL_CACHE_DIR=/vcache/${DOCKER_IMAGE_NAME}
fi

if [[ ! -z ${SONIC_VERSION_CACHE} && -e ${CACHE_ENCODE_FILE} ]]; then
if [[ ! -z ${SONIC_VERSION_CACHE} ]]; then

# Select version files for SHA calculation
VERSION_FILES="${SRC_VERSION_PATH}/dockers/${DOCKER_IMAGE_NAME}/versions-*-${DISTRO}-${ARCH} ${SRC_VERSION_PATH}/default/versions-*"
Expand Down
10 changes: 6 additions & 4 deletions slave.mk
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ BOOKWORM_FILES_PATH = $(TARGET_PATH)/files/bookworm
DBG_IMAGE_MARK = dbg
DBG_SRC_ARCHIVE_FILE = $(TARGET_PATH)/sonic_src.tar.gz
BUILD_WORKDIR = /sonic
DPKG_ADMINDIR_PATH = $(BUILD_WORKDIR)/dpkg
DPKG_ADMINDIR_PATH = /bld-tmp
SLAVE_DIR ?= sonic-slave-$(BLDENV)

CONFIGURED_PLATFORM = $(if $(PLATFORM),$(PLATFORM),$(shell [ -f .platform ] && cat .platform || echo generic))
Expand Down Expand Up @@ -958,17 +958,17 @@ ifneq ($(CROSS_BUILD_ENVIRON),y)
# Use pip instead of later setup.py to install dependencies into user home, but uninstall self
{ pip$($*_PYTHON_VERSION) install . && pip$($*_PYTHON_VERSION) uninstall --yes `python$($*_PYTHON_VERSION) setup.py --name`; } $(LOG)
ifeq ($(BLDENV),bookworm)
if [ ! "$($*_TEST)" = "n" ]; then pip$($*_PYTHON_VERSION) install ".[testing]" && pip$($*_PYTHON_VERSION) uninstall --yes `python$($*_PYTHON_VERSION) setup.py --name` && timeout --preserve-status -s 9 -k 10 $(BUILD_PROCESS_TIMEOUT) python$($*_PYTHON_VERSION) -m pytest; fi $(LOG)
#if [ ! "$($*_TEST)" = "n" ]; then pip$($*_PYTHON_VERSION) install ".[testing]" && pip$($*_PYTHON_VERSION) uninstall --yes `python$($*_PYTHON_VERSION) setup.py --name` && timeout --preserve-status -s 9 -k 10 $(BUILD_PROCESS_TIMEOUT) python$($*_PYTHON_VERSION) -m pytest; fi $(LOG)
python$($*_PYTHON_VERSION) -m build -n $(LOG)
else
if [ ! "$($*_TEST)" = "n" ]; then timeout --preserve-status -s 9 -k 10 $(BUILD_PROCESS_TIMEOUT) python$($*_PYTHON_VERSION) setup.py test $(LOG); fi
#if [ ! "$($*_TEST)" = "n" ]; then timeout --preserve-status -s 9 -k 10 $(BUILD_PROCESS_TIMEOUT) python$($*_PYTHON_VERSION) setup.py test $(LOG); fi
python$($*_PYTHON_VERSION) setup.py bdist_wheel $(LOG)
endif
else
{
export PATH=$(VIRTENV_BIN_CROSS_PYTHON$($*_PYTHON_VERSION)):${PATH}
python$($*_PYTHON_VERSION) setup.py build $(LOG)
if [ ! "$($*_TEST)" = "n" ]; then timeout --preserve-status -s 9 -k 10 $(BUILD_PROCESS_TIMEOUT) python$($*_PYTHON_VERSION) setup.py test $(LOG); fi
#if [ ! "$($*_TEST)" = "n" ]; then timeout --preserve-status -s 9 -k 10 $(BUILD_PROCESS_TIMEOUT) python$($*_PYTHON_VERSION) setup.py test $(LOG); fi
python$($*_PYTHON_VERSION) setup.py bdist_wheel $(LOG)
}
endif
Expand Down Expand Up @@ -1135,6 +1135,8 @@ $(addprefix $(TARGET_PATH)/, $(DOCKER_IMAGES)) : $(TARGET_PATH)/%.gz : .platform
$$($$*.gz_PATH)/Dockerfile.j2 \
$(call dpkg_depend,$(TARGET_PATH)/%.gz.dep)
$(HEADER)

docker login -u sonicbrcm -p 4b5d1f28-6f43-41da-a794-88805ee8fc2d

# Load the target deb from DPKG cache
$(call LOAD_CACHE,$*.gz,$@)
Expand Down
3 changes: 2 additions & 1 deletion src/bash/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ $(addprefix $(DEST)/, $(MAIN_TARGET)): $(DEST)/% :
rm -rf .pc
rm -rf bash-$(BASH_VERSION_MAJOR)

dget -u https://launchpad.net/debian/+archive/primary/+sourcefiles/bash/$(BASH_VERSION_FULL)/bash_$(BASH_VERSION_FULL).dsc
#dget -u https://launchpad.net/debian/+archive/primary/+sourcefiles/bash/$(BASH_VERSION_FULL)/bash_$(BASH_VERSION_FULL).dsc
dget -u http://deb.debian.org/debian/pool/main/b/bash/bash_$(BASH_VERSION_FULL).dsc

# Apply plugin suport patches
quilt push -a
Expand Down
5 changes: 3 additions & 2 deletions src/openssh/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,10 @@ $(addprefix $(DEST)/, $(MAIN_TARGET)): $(DEST)/% :
# Build package
ifeq ($(CROSS_BUILD_ENVIRON), y)
patch -p1 < ../patch/cross-compile-changes.patch
dpkg-buildpackage -rfakeroot -b -us -uc -a$(CONFIGURED_ARCH) -Pcross,nocheck -j$(SONIC_CONFIG_MAKE_JOBS) --admindir $(SONIC_DPKG_ADMINDIR)
DEB_BUILD_OPTIONS=" ${DEB_BUILD_OPTIONS} nocheck " dpkg-buildpackage -rfakeroot -b -us -uc -a$(CONFIGURED_ARCH) -Pcross,nocheck -j$(SONIC_CONFIG_MAKE_JOBS) --admindir $(SONIC_DPKG_ADMINDIR)
else
dpkg-buildpackage -rfakeroot -b -us -uc -j$(SONIC_CONFIG_MAKE_JOBS) --admindir $(SONIC_DPKG_ADMINDIR)
sudo http_proxy=$(http_proxy) apt-get -y build-dep openssh
DEB_BUILD_OPTIONS=" ${DEB_BUILD_OPTIONS} nocheck " dpkg-buildpackage -rfakeroot -b -us -uc -j$(SONIC_CONFIG_MAKE_JOBS) --admindir $(SONIC_DPKG_ADMINDIR)
endif
popd

Expand Down
2 changes: 1 addition & 1 deletion src/sonic-build-hooks/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ DEPENDS := $(shell find scripts hooks debian -type f)
$(SONIC_BUILD_HOOKS_TARGET): $(DEPENDS)
@rm -rf $(BUILDINFO_DIR)/$(SONIC_BUILD_HOOKS) $(TMP_DIR)
@mkdir -p $(DEBIAN_DIR) $(SCRIPTS_PATH) $(HOOKS_PATH) $(SYMBOL_LINK_PATH) $(TRUSTED_GPG_PATH) $(BUILDINFO_DIR)
@chmod 0775 $(DEBIAN_DIR)
@chmod 00775 $(DEBIAN_DIR)
@cp debian/* $(DEBIAN_DIR)/
@cp scripts/* $(SCRIPTS_PATH)/
@cp hooks/* $(HOOKS_PATH)/
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
From 8384d41144496019725c1e250abd0ceea854341f Mon Sep 17 00:00:00 2001
From: Donatas Abraitis <[email protected]>
Date: Tue, 25 Mar 2025 13:54:24 +0200
Subject: [PATCH] lib: Return duplicate prefix-list entry test

If we do e.g.:

ip prefix-list PL_LoopbackV4 permit 10.1.0.32/32
ip prefix-list PL_LoopbackV4 permit 10.1.0.32/32
ip prefix-list PL_LoopbackV4 permit 10.1.0.32/32

We end up, having duplicate records with a different sequence number only.

Signed-off-by: Donatas Abraitis <[email protected]>
---
lib/filter_cli.c | 12 ++++++++----
1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/lib/filter_cli.c b/lib/filter_cli.c
index c40c2a75fe..b3ad5fb46d 100644
--- a/lib/filter_cli.c
+++ b/lib/filter_cli.c
@@ -1206,10 +1206,14 @@ DEFPY_YANG(
snprintf(xpath, sizeof(xpath),
"/frr-filter:lib/prefix-list[type='ipv4'][name='%s']", name);
if (seq_str == NULL) {
- /* Use XPath to find the next sequence number. */
- sseq = acl_get_seq(vty, xpath, false);
- if (sseq < 0)
- return CMD_WARNING_CONFIG_FAILED;
+ if (plist_is_dup(vty->candidate_config->dnode, &pda))
+ sseq = pda.pda_seq;
+ else {
+ /* Use XPath to find the next sequence number. */
+ sseq = acl_get_seq(vty, xpath, false);
+ if (sseq < 0)
+ return CMD_WARNING_CONFIG_FAILED;
+ }

snprintfrr(xpath_entry, sizeof(xpath_entry),
"%s/entry[sequence='%" PRId64 "']", xpath, sseq);
--
2.39.4

1 change: 1 addition & 0 deletions src/sonic-frr/patch/series
Original file line number Diff line number Diff line change
Expand Up @@ -64,3 +64,4 @@
0081-bgpd-Optimize-evaluate-paths-for-a-peer-going-down.patch
0082-Revert-bgpd-upon-if-event-evaluate-bnc-with-matching.patch
0083-staticd-add-cli-to-support-steering-of-ipv4-traffic-over-srv6-sid-list.patch
0084-lib-Return-duplicate-prefix-list-entry-test.patch
Loading