[build]: fix dpkg admindir corruption issue in parallel build (#6408)

Fix #119

when parallel build is enable, multiple dpkg-buildpackage
instances are running at the same time. /var/lib/dpkg is shared
by all instances and the /var/lib/dpkg/updates could be corrupted
and cause the build failure.

the fix is to use overlay fs to mount separate /var/lib/dpkg
for each dpkg-buildpackage instance so that they are not affecting
each other.

Signed-off-by: Guohan Lu <lguohan@gmail.com>
This commit is contained in:
lguohan 2021-01-12 06:03:12 -08:00 committed by Guohan Lu
parent 264ecb181c
commit 45b724fe76
36 changed files with 54 additions and 38 deletions

View File

@ -7,7 +7,7 @@ MAIN_TARGET = $(BRCM_XLR_GTS_PLATFORM_MODULE)
$(addprefix $(DEST)/, $(MAIN_TARGET)): $(DEST)/% : $(addprefix $(DEST)/, $(MAIN_TARGET)): $(DEST)/% :
# Build the package # Build the package
export PYBUILD_INSTALL_ARGS_python2=--install-scripts=/dev/null export PYBUILD_INSTALL_ARGS_python2=--install-scripts=/dev/null
dpkg-buildpackage -rfakeroot -b -us -uc -j$(SONIC_CONFIG_MAKE_JOBS) dpkg-buildpackage -rfakeroot -b -us -uc -j$(SONIC_CONFIG_MAKE_JOBS) --admindir $(SONIC_DPKG_ADMINDIR)
mv $(addprefix ../, $* $(EXTRA_TARGETS)) $(DEST)/ mv $(addprefix ../, $* $(EXTRA_TARGETS)) $(DEST)/

View File

@ -153,3 +153,15 @@ if [ -n "$(1)" ]; then \
done; \ done; \
fi fi
endef endef
###############################################################################
## Setup overlay fs for dpkg admin directory /var/lib/dpkg
###############################################################################
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))
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
endef

View File

@ -41,6 +41,7 @@ BUSTER_DEBS_PATH = $(TARGET_PATH)/debs/buster
BUSTER_FILES_PATH = $(TARGET_PATH)/files/buster BUSTER_FILES_PATH = $(TARGET_PATH)/files/buster
DBG_IMAGE_MARK = dbg DBG_IMAGE_MARK = dbg
DBG_SRC_ARCHIVE_FILE = $(TARGET_PATH)/sonic_src.tar.gz DBG_SRC_ARCHIVE_FILE = $(TARGET_PATH)/sonic_src.tar.gz
DPKG_ADMINDIR_PATH = /sonic/dpkg
CONFIGURED_PLATFORM := $(shell [ -f .platform ] && cat .platform || echo generic) CONFIGURED_PLATFORM := $(shell [ -f .platform ] && cat .platform || echo generic)
PLATFORM_PATH = platform/$(CONFIGURED_PLATFORM) PLATFORM_PATH = platform/$(CONFIGURED_PLATFORM)
@ -83,6 +84,7 @@ configure :
@mkdir -p $(BUSTER_FILES_PATH) @mkdir -p $(BUSTER_FILES_PATH)
@mkdir -p $(PYTHON_DEBS_PATH) @mkdir -p $(PYTHON_DEBS_PATH)
@mkdir -p $(PYTHON_WHEELS_PATH) @mkdir -p $(PYTHON_WHEELS_PATH)
@mkdir -p $(DPKG_ADMINDIR_PATH)
@echo $(PLATFORM) > .platform @echo $(PLATFORM) > .platform
@echo $(PLATFORM_ARCH) > .arch @echo $(PLATFORM_ARCH) > .arch
@ -419,6 +421,7 @@ $(addprefix $(DEBS_PATH)/, $(SONIC_MAKE_DEBS)) : $(DEBS_PATH)/% : .platform $$(a
# Apply series of patches if exist # Apply series of patches if exist
if [ -f $($*_SRC_PATH).patch/series ]; then pushd $($*_SRC_PATH) && QUILT_PATCHES=../$(notdir $($*_SRC_PATH)).patch quilt push -a; popd; fi if [ -f $($*_SRC_PATH).patch/series ]; then pushd $($*_SRC_PATH) && QUILT_PATCHES=../$(notdir $($*_SRC_PATH)).patch quilt push -a; popd; fi
# Build project and take package # Build project and take package
$(SETUP_OVERLAYFS_FOR_DPKG_ADMINDIR)
DEB_BUILD_OPTIONS="${DEB_BUILD_OPTIONS_GENERIC}" make DEST=$(shell pwd)/$(DEBS_PATH) -C $($*_SRC_PATH) $(shell pwd)/$(DEBS_PATH)/$* $(LOG) DEB_BUILD_OPTIONS="${DEB_BUILD_OPTIONS_GENERIC}" make DEST=$(shell pwd)/$(DEBS_PATH) -C $($*_SRC_PATH) $(shell pwd)/$(DEBS_PATH)/$* $(LOG)
# Clean up # Clean up
if [ -f $($*_SRC_PATH).patch/series ]; then pushd $($*_SRC_PATH) && quilt pop -a -f; [ -d .pc ] && rm -rf .pc; popd; fi if [ -f $($*_SRC_PATH).patch/series ]; then pushd $($*_SRC_PATH) && quilt pop -a -f; [ -d .pc ] && rm -rf .pc; popd; fi
@ -459,9 +462,10 @@ $(addprefix $(DEBS_PATH)/, $(SONIC_DPKG_DEBS)) : $(DEBS_PATH)/% : .platform $$(a
# Build project # Build project
pushd $($*_SRC_PATH) $(LOG_SIMPLE) pushd $($*_SRC_PATH) $(LOG_SIMPLE)
if [ -f ./autogen.sh ]; then ./autogen.sh $(LOG); fi if [ -f ./autogen.sh ]; then ./autogen.sh $(LOG); fi
$(SETUP_OVERLAYFS_FOR_DPKG_ADMINDIR)
$(if $($*_DPKG_TARGET), $(if $($*_DPKG_TARGET),
DEB_BUILD_OPTIONS="${DEB_BUILD_OPTIONS_GENERIC} ${$*_DEB_BUILD_OPTIONS}" dpkg-buildpackage -rfakeroot -b -us -uc -j$(SONIC_CONFIG_MAKE_JOBS) --as-root -T$($*_DPKG_TARGET) $(LOG), DEB_BUILD_OPTIONS="${DEB_BUILD_OPTIONS_GENERIC} ${$*_DEB_BUILD_OPTIONS}" dpkg-buildpackage -rfakeroot -b -us -uc -j$(SONIC_CONFIG_MAKE_JOBS) --as-root -T$($*_DPKG_TARGET) --admindir $$mergedir $(LOG),
DEB_BUILD_OPTIONS="${DEB_BUILD_OPTIONS_GENERIC} ${$*_DEB_BUILD_OPTIONS}" dpkg-buildpackage -rfakeroot -b -us -uc -j$(SONIC_CONFIG_MAKE_JOBS) $(LOG) DEB_BUILD_OPTIONS="${DEB_BUILD_OPTIONS_GENERIC} ${$*_DEB_BUILD_OPTIONS}" dpkg-buildpackage -rfakeroot -b -us -uc -j$(SONIC_CONFIG_MAKE_JOBS) --admindir $$mergedir $(LOG)
) )
popd $(LOG_SIMPLE) popd $(LOG_SIMPLE)
# Clean up # Clean up

View File

@ -10,7 +10,7 @@ $(addprefix $(DEST)/, $(MAIN_TARGET)): $(DEST)/% :
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
pushd bash-$(BASH_VERSION_MAJOR) pushd bash-$(BASH_VERSION_MAJOR)
DEB_BUILD_OPTIONS=nocheck dpkg-buildpackage -us -uc -b -j$(SONIC_CONFIG_MAKE_JOBS) DEB_BUILD_OPTIONS=nocheck dpkg-buildpackage -us -uc -b -j$(SONIC_CONFIG_MAKE_JOBS) --admindir $(SONIC_DPKG_ADMINDIR)
popd popd
mv $* $(DEST)/ mv $* $(DEST)/

View File

@ -14,7 +14,7 @@ $(addprefix $(DEST)/, $(MAIN_TARGET)): $(DEST)/% :
dpkg-source -x hiredis_$(HIREDIS_VERSION_FULL).dsc dpkg-source -x hiredis_$(HIREDIS_VERSION_FULL).dsc
pushd hiredis-$(HIREDIS_VERSION) pushd hiredis-$(HIREDIS_VERSION)
fakeroot debian/rules -j$(SONIC_CONFIG_MAKE_JOBS) binary dpkg-buildpackage -rfakeroot -d -b -us -uc -j$(SONIC_CONFIG_MAKE_JOBS) --admindir $(SONIC_DPKG_ADMINDIR)
popd popd
mv $* $(DERIVED_TARGETS) $(DEST)/ mv $* $(DERIVED_TARGETS) $(DEST)/

View File

@ -14,7 +14,7 @@ $(addprefix $(DEST)/, $(MAIN_TARGET)): $(DEST)/% :
pushd ./ifupdown2-$(IFUPDOWN2_VERSION) pushd ./ifupdown2-$(IFUPDOWN2_VERSION)
# Build source and Debian packages # Build source and Debian packages
dpkg-buildpackage -rfakeroot -b -us -uc -j$(SONIC_CONFIG_MAKE_JOBS) dpkg-buildpackage -rfakeroot -b -us -uc -j$(SONIC_CONFIG_MAKE_JOBS) --admindir $(SONIC_DPKG_ADMINDIR)
popd popd
# Move the newly-built .deb packages to the destination directory # Move the newly-built .deb packages to the destination directory

View File

@ -19,7 +19,7 @@ $(addprefix $(DEST)/, $(MAIN_TARGET)): $(DEST)/% :
# Build the package # Build the package
rm -f debian/*.debhelper.log rm -f debian/*.debhelper.log
dpkg-buildpackage -rfakeroot -b -us -uc -j$(SONIC_CONFIG_MAKE_JOBS) dpkg-buildpackage -rfakeroot -b -us -uc -j$(SONIC_CONFIG_MAKE_JOBS) --admindir $(SONIC_DPKG_ADMINDIR)
popd popd
mv $(DERIVED_TARGETS) $* $(DEST)/ mv $(DERIVED_TARGETS) $* $(DEST)/

View File

@ -17,7 +17,7 @@ $(addprefix $(DEST)/, $(MAIN_TARGET)): $(DEST)/% :
dpkg-source -x iproute2_$(IPROUTE2_VERSION_FULL).dsc dpkg-source -x iproute2_$(IPROUTE2_VERSION_FULL).dsc
pushd iproute2-$(IPROUTE2_VERSION) pushd iproute2-$(IPROUTE2_VERSION)
dpkg-buildpackage -us -uc -b -j$(SONIC_CONFIG_MAKE_JOBS) dpkg-buildpackage -us -uc -b -j$(SONIC_CONFIG_MAKE_JOBS) --admindir $(SONIC_DPKG_ADMINDIR)
popd popd
mv $* $(DEST)/ mv $* $(DEST)/

View File

@ -38,7 +38,7 @@ $(addprefix $(DEST)/, $(MAIN_TARGET)): $(DEST)/% :
stg import -s ../patch/series stg import -s ../patch/series
# Build source and Debian packages # Build source and Debian packages
dpkg-buildpackage -rfakeroot -b -us -uc -j$(SONIC_CONFIG_MAKE_JOBS) dpkg-buildpackage -rfakeroot -b -us -uc -j$(SONIC_CONFIG_MAKE_JOBS) --admindir $(SONIC_DPKG_ADMINDIR)
popd popd
# Move the newly-built .deb packages to the destination directory # Move the newly-built .deb packages to the destination directory

View File

@ -23,7 +23,7 @@ $(addprefix $(DEST)/, $(MAIN_TARGET)): $(DEST)/% :
stg import -s ../patch/series stg import -s ../patch/series
# Build source and Debian packages # Build source and Debian packages
dpkg-buildpackage -rfakeroot -b -us -uc -j$(SONIC_CONFIG_MAKE_JOBS) dpkg-buildpackage -rfakeroot -b -us -uc -j$(SONIC_CONFIG_MAKE_JOBS) --admindir $(SONIC_DPKG_ADMINDIR)
popd popd
# Move the newly-built .deb packages to the destination directory # Move the newly-built .deb packages to the destination directory

View File

@ -25,7 +25,7 @@ $(addprefix $(DEST)/, $(MAIN_TARGET)): $(DEST)/% :
stg import -s ../patch/series stg import -s ../patch/series
# Build source and Debian packages # Build source and Debian packages
fakeroot debian/rules binary-indep dpkg-buildpackage -rfakeroot -b -us -uc -Tbinary-indep -j$(SONIC_CONFIG_MAKE_JOBS) --admindir $(SONIC_DPKG_ADMINDIR)
popd popd
# Move the newly-built .deb packages to the destination directory # Move the newly-built .deb packages to the destination directory

View File

@ -21,7 +21,7 @@ $(addprefix $(DEST)/, $(MAIN_TARGET)): $(DEST)/% :
git checkout tags/libnl$(subst .,_,$(LIBNL3_VERSION_BASE)) git checkout tags/libnl$(subst .,_,$(LIBNL3_VERSION_BASE))
ln -s ../debian debian ln -s ../debian debian
dpkg-buildpackage -rfakeroot -b -us -uc -j$(SONIC_CONFIG_MAKE_JOBS) dpkg-buildpackage -rfakeroot -b -us -uc -j$(SONIC_CONFIG_MAKE_JOBS) --admindir $(SONIC_DPKG_ADMINDIR)
popd popd
mv $(DERIVED_TARGETS) $* $(DEST)/ mv $(DERIVED_TARGETS) $* $(DEST)/

View File

@ -31,7 +31,7 @@ $(addprefix $(DEST)/, $(MAIN_TARGET)): $(DEST)/% :
mv tmp/debian libteam/ mv tmp/debian libteam/
rm -rf tmp rm -rf tmp
pushd ./libteam pushd ./libteam
dpkg-buildpackage -rfakeroot -b -us -uc -j$(SONIC_CONFIG_MAKE_JOBS) dpkg-buildpackage -rfakeroot -b -us -uc -j$(SONIC_CONFIG_MAKE_JOBS) --admindir $(SONIC_DPKG_ADMINDIR)
popd popd
mv $(DERIVED_TARGETS) $* $(DEST)/ mv $(DERIVED_TARGETS) $* $(DEST)/

View File

@ -31,7 +31,7 @@ $(addprefix $(DEST)/, $(MAIN_TARGET)): $(DEST)/% :
# Enable large file support for 32-bit arch # Enable large file support for 32-bit arch
echo 'add_definitions(-D_FILE_OFFSET_BITS=64)' >> CMakeLists.txt echo 'add_definitions(-D_FILE_OFFSET_BITS=64)' >> CMakeLists.txt
dpkg-buildpackage -rfakeroot -b -us -uc -j$(SONIC_CONFIG_MAKE_JOBS) dpkg-buildpackage -rfakeroot -b -us -uc -j$(SONIC_CONFIG_MAKE_JOBS) --admindir $(SONIC_DPKG_ADMINDIR)
popd popd
# Move the newly-built .deb packages to the destination directory # Move the newly-built .deb packages to the destination directory

View File

@ -35,7 +35,7 @@ $(addprefix $(DEST)/, $(MAIN_TARGET)): $(DEST)/% :
stg import -s ../patch/series stg import -s ../patch/series
# Build source and Debian packages # Build source and Debian packages
env "with_netlink_receive_bufsize=1024*1024" dpkg-buildpackage -rfakeroot -b -us -uc -j$(SONIC_CONFIG_MAKE_JOBS) env "with_netlink_receive_bufsize=1024*1024" dpkg-buildpackage -rfakeroot -b -us -uc -j$(SONIC_CONFIG_MAKE_JOBS) --admindir $(SONIC_DPKG_ADMINDIR)
popd popd
# Move the newly-built .deb packages to the destination directory # Move the newly-built .deb packages to the destination directory

View File

@ -25,7 +25,7 @@ $(addprefix $(DEST)/, $(MAIN_TARGET)): $(DEST)/% :
stg init stg init
stg import -s ../patch/series stg import -s ../patch/series
DEB_BUILD_OPTIONS=nocheck PROG_EXTRA=sensord dpkg-buildpackage -us -uc -b -j$(SONIC_CONFIG_MAKE_JOBS) DEB_BUILD_OPTIONS=nocheck PROG_EXTRA=sensord dpkg-buildpackage -us -uc -b -j$(SONIC_CONFIG_MAKE_JOBS) --admindir $(SONIC_DPKG_ADMINDIR)
popd popd
mv $(DERIVED_TARGETS) $* $(DEST)/ mv $(DERIVED_TARGETS) $* $(DEST)/

View File

@ -24,7 +24,7 @@ $(addprefix $(DEST)/, $(MAIN_TARGET)): $(DEST)/% :
stg import -s ../patch/series stg import -s ../patch/series
# Build source and Debian packages # Build source and Debian packages
dpkg-buildpackage -rfakeroot -b -us -uc -j$(SONIC_CONFIG_MAKE_JOBS) dpkg-buildpackage -rfakeroot -b -us -uc -j$(SONIC_CONFIG_MAKE_JOBS) --admindir $(SONIC_DPKG_ADMINDIR)
popd popd
# Move the newly-built .deb packages to the destination directory # Move the newly-built .deb packages to the destination directory

View File

@ -14,7 +14,7 @@ $(addprefix $(DEST)/, $(MAIN_TARGET)): $(DEST)/% :
dpkg-source -x mpdecimal_$(MPDECIMAL_VERSION_FULL).dsc dpkg-source -x mpdecimal_$(MPDECIMAL_VERSION_FULL).dsc
pushd mpdecimal-$(MPDECIMAL_VERSION) pushd mpdecimal-$(MPDECIMAL_VERSION)
dpkg-buildpackage -us -uc -b -j$(SONIC_CONFIG_MAKE_JOBS) dpkg-buildpackage -us -uc -b -j$(SONIC_CONFIG_MAKE_JOBS) --admindir $(SONIC_DPKG_ADMINDIR)
popd popd
mv $* $(DERIVED_TARGETS) $(DEST)/ mv $* $(DERIVED_TARGETS) $(DEST)/

View File

@ -39,7 +39,7 @@ $(addprefix $(DEST)/, $(MAIN_TARGET)): $(DEST)/% :
sed -i 's/\/usr\/sbin\/ntpd {/\/usr\/sbin\/ntpd flags=(attach_disconnected complain) {/' debian/apparmor-profile sed -i 's/\/usr\/sbin\/ntpd {/\/usr\/sbin\/ntpd flags=(attach_disconnected complain) {/' debian/apparmor-profile
# Build source and Debian packages with the symbols # Build source and Debian packages with the symbols
dpkg-buildpackage -rfakeroot -b -us -uc -j$(SONIC_CONFIG_MAKE_JOBS) dpkg-buildpackage -rfakeroot -b -us -uc -j$(SONIC_CONFIG_MAKE_JOBS) --admindir $(SONIC_DPKG_ADMINDIR)
popd popd

View File

@ -20,7 +20,7 @@ $(addprefix $(DEST)/, $(MAIN_TARGET)): $(DEST)/% :
# Build package # Build package
sudo http_proxy=$(http_proxy) apt-get -y build-dep openssh sudo http_proxy=$(http_proxy) apt-get -y build-dep openssh
dpkg-buildpackage -rfakeroot -b -us -uc -j$(SONIC_CONFIG_MAKE_JOBS) dpkg-buildpackage -rfakeroot -b -us -uc -j$(SONIC_CONFIG_MAKE_JOBS) --admindir $(SONIC_DPKG_ADMINDIR)
popd popd
mv $(DERIVED_TARGETS) $* $(DEST)/ mv $(DERIVED_TARGETS) $* $(DEST)/

View File

@ -35,7 +35,7 @@ $(addprefix $(DEST)/, $(MAIN_TARGET)): $(DEST)/% :
fi fi
done done
dpkg-buildpackage -rfakeroot -us -uc -b -j$(SONIC_CONFIG_MAKE_JOBS) dpkg-buildpackage -rfakeroot -us -uc -b -j$(SONIC_CONFIG_MAKE_JOBS) --admindir $(SONIC_DPKG_ADMINDIR)
popd popd
cp $(DERIVED_TARGETS) $* $(DEST)/ cp $(DERIVED_TARGETS) $* $(DEST)/

View File

@ -22,7 +22,7 @@ $(addprefix $(DEST)/, $(MAIN_TARGET)): $(DEST)/% :
pushd redis-$(REDIS_VERSION) pushd redis-$(REDIS_VERSION)
export ARCH="" export ARCH=""
DEB_BUILD_OPTIONS=nocheck dpkg-buildpackage -us -uc -b -j$(SONIC_CONFIG_MAKE_JOBS) DEB_BUILD_OPTIONS=nocheck dpkg-buildpackage -us -uc -b -j$(SONIC_CONFIG_MAKE_JOBS) --admindir $(SONIC_DPKG_ADMINDIR)
popd popd
mv $(DERIVED_TARGETS) $* $(DEST)/ mv $(DERIVED_TARGETS) $* $(DEST)/

View File

@ -21,7 +21,7 @@ $(addprefix $(DEST)/, $(MAIN_TARGET)): $(DEST)/% :
chmod u+x debian/rules chmod u+x debian/rules
sed -i -e s/_VERSION_/$(HSFLOWD_VERSION)-$(HSFLOWD_SUBVERSION)/g debian/changelog sed -i -e s/_VERSION_/$(HSFLOWD_VERSION)-$(HSFLOWD_SUBVERSION)/g debian/changelog
dpkg-buildpackage -rfakeroot -b -us -uc -j$(SONIC_CONFIG_MAKE_JOBS) --buildinfo-option=-u. --changes-option=-u. dpkg-buildpackage -rfakeroot -b -us -uc -j$(SONIC_CONFIG_MAKE_JOBS) --admindir $(SONIC_DPKG_ADMINDIR) --buildinfo-option=-u. --changes-option=-u.
mv $(DERIVED_TARGET) $* $(DEST)/ mv $(DERIVED_TARGET) $* $(DEST)/
popd popd

View File

@ -13,7 +13,7 @@ $(addprefix $(DEST)/, $(MAIN_TARGET)): $(DEST)/% :
pushd ./libpsample pushd ./libpsample
git checkout -b libpsample -f e48fad2 git checkout -b libpsample -f e48fad2
dpkg-buildpackage -rfakeroot -b -us -uc -j$(SONIC_CONFIG_MAKE_JOBS) dpkg-buildpackage -rfakeroot -b -us -uc -j$(SONIC_CONFIG_MAKE_JOBS) --admindir $(SONIC_DPKG_ADMINDIR)
popd popd
mv $* $(DEST)/ mv $* $(DEST)/

View File

@ -12,7 +12,7 @@ $(addprefix $(DEST)/, $(MAIN_TARGET)): $(DEST)/% :
pushd ./sflowtool pushd ./sflowtool
git checkout -b sflowtool -f 6c2963b git checkout -b sflowtool -f 6c2963b
dpkg-buildpackage -rfakeroot -b -us -uc -j$(SONIC_CONFIG_MAKE_JOBS) dpkg-buildpackage -rfakeroot -b -us -uc -j$(SONIC_CONFIG_MAKE_JOBS) --admindir $(SONIC_DPKG_ADMINDIR)
popd popd
mv $* $(DEST)/ mv $* $(DEST)/

View File

@ -13,7 +13,7 @@ $(addprefix $(DEST)/, $(MAIN_TARGET)): $(DEST)/% :
dpkg-source -x smartmontools_$(SMARTMONTOOLS_VERSION_FULL).dsc dpkg-source -x smartmontools_$(SMARTMONTOOLS_VERSION_FULL).dsc
pushd smartmontools-$(SMARTMONTOOLS_VERSION_MAJOR) pushd smartmontools-$(SMARTMONTOOLS_VERSION_MAJOR)
dpkg-buildpackage -us -uc -b -j$(SONIC_CONFIG_MAKE_JOBS) dpkg-buildpackage -us -uc -b -j$(SONIC_CONFIG_MAKE_JOBS) --admindir $(SONIC_DPKG_ADMINDIR)
popd popd
mv $* $(DEST)/ mv $* $(DEST)/

View File

@ -29,7 +29,7 @@ $(addprefix $(DEST)/, $(MAIN_TARGET)): $(DEST)/% :
stg init stg init
stg import -s ../patch-$(SNMPD_VERSION)/series stg import -s ../patch-$(SNMPD_VERSION)/series
fakeroot debian/rules -j$(SONIC_CONFIG_MAKE_JOBS) binary dpkg-buildpackage -rfakeroot -b -d -us -uc -j$(SONIC_CONFIG_MAKE_JOBS) --admindir $(SONIC_DPKG_ADMINDIR)
popd popd
mv $(DERIVED_TARGETS) $* $(DEST)/ mv $(DERIVED_TARGETS) $* $(DEST)/

View File

@ -18,7 +18,7 @@ $(addprefix $(DEST)/, $(MAIN_TARGET)): $(DEST)/% :
# Build source and Debian packages # Build source and Debian packages
pushd socat-1.7.3.1 pushd socat-1.7.3.1
patch -p0 < ../enable_readline.patch patch -p0 < ../enable_readline.patch
dpkg-buildpackage -rfakeroot -b -us -uc -j$(SONIC_CONFIG_MAKE_JOBS) dpkg-buildpackage -rfakeroot -b -us -uc -j$(SONIC_CONFIG_MAKE_JOBS) --admindir $(SONIC_DPKG_ADMINDIR)
popd popd
# Move the newly-built .deb packages to the destination directory # Move the newly-built .deb packages to the destination directory

View File

@ -25,7 +25,7 @@ $(addprefix $(DEST)/, $(MAIN_TARGET)): $(DEST)/% :
done; done;
# Build the package # Build the package
dpkg-buildpackage -rfakeroot -b -us -uc dpkg-buildpackage -rfakeroot -b -us -uc -j$(SONIC_CONFIG_MAKE_JOBS) --admindir $(SONIC_DPKG_ADMINDIR)
popd popd

View File

@ -14,7 +14,7 @@ $(addprefix $(DEST)/, $(MAIN_TARGET)): $(DEST)/% :
stg branch --create $(STG_BRANCH) $(FRR_TAG) stg branch --create $(STG_BRANCH) $(FRR_TAG)
stg import -s ../patch/series stg import -s ../patch/series
tools/tarsource.sh -V -e '-sonic' tools/tarsource.sh -V -e '-sonic'
dpkg-buildpackage -rfakeroot -b -us -uc -Ppkg.frr.nortrlib -j$(SONIC_CONFIG_MAKE_JOBS) dpkg-buildpackage -rfakeroot -b -us -uc -Ppkg.frr.nortrlib -j$(SONIC_CONFIG_MAKE_JOBS) --admindir $(SONIC_DPKG_ADMINDIR)
stg undo || true stg undo || true
git clean -xfdf git clean -xfdf
git checkout $(FRR_BRANCH) git checkout $(FRR_BRANCH)

View File

@ -21,7 +21,7 @@ MAIN_TARGET = sonic-host-service_1.0.0_all.deb
INSTALL := /usr/bin/install INSTALL := /usr/bin/install
$(addprefix $(DEST)/, $(MAIN_TARGET)): $(DEST)/% : $(addprefix $(DEST)/, $(MAIN_TARGET)): $(DEST)/% :
dpkg-buildpackage -us -uc -b dpkg-buildpackage -us -uc -b -j$(SONIC_CONFIG_MAKE_JOBS) --admindir $(SONIC_DPKG_ADMINDIR)
mv ../$(MAIN_TARGET) $(DEST)/ mv ../$(MAIN_TARGET) $(DEST)/
SOURCES := $(wildcard '*.*') $(wildcard 'host_modules/*.py') SOURCES := $(wildcard '*.*') $(wildcard 'host_modules/*.py')

View File

@ -13,7 +13,7 @@ $(addprefix $(DEST)/, $(MAIN_TARGET)): $(DEST)/% :
dpkg-source -x swig_$(SWIG_VERSION).dsc dpkg-source -x swig_$(SWIG_VERSION).dsc
pushd ./swig-$(SWIG_VERSION) pushd ./swig-$(SWIG_VERSION)
dpkg-buildpackage -rfakeroot -b -us -uc -j$(SONIC_CONFIG_MAKE_JOBS) dpkg-buildpackage -rfakeroot -b -us -uc -j$(SONIC_CONFIG_MAKE_JOBS) --admindir $(SONIC_DPKG_ADMINDIR)
popd popd
mv $(DERIVED_TARGETS) $* $(DEST)/ mv $(DERIVED_TARGETS) $* $(DEST)/

View File

@ -5,7 +5,7 @@ BINARY = systemd-sonic-generator
MAIN_TARGET = $(BINARY)_1.0.0_$(CONFIGURED_ARCH).deb MAIN_TARGET = $(BINARY)_1.0.0_$(CONFIGURED_ARCH).deb
$(addprefix $(DEST)/, $(MAIN_TARGET)): $(DEST)/% : $(addprefix $(DEST)/, $(MAIN_TARGET)): $(DEST)/% :
dpkg-buildpackage -us -uc -b dpkg-buildpackage -us -uc -b -j$(SONIC_CONFIG_MAKE_JOBS) --admindir $(SONIC_DPKG_ADMINDIR)
mv ../$(MAIN_TARGET) $(DEST)/ mv ../$(MAIN_TARGET) $(DEST)/
rm ../$(BINARY)-* ../$(BINARY)_* rm ../$(BINARY)-* ../$(BINARY)_*

View File

@ -6,7 +6,7 @@ MAIN_TARGET = libnss-tacplus_$(NSS_TACPLUS_VERSION)_$(CONFIGURED_ARCH).deb
GIT_APPLY = am GIT_APPLY = am
ifneq (,$(filter $(CONFIGURED_ARCH), armhf arm64)) ifneq (,$(filter $(CONFIGURED_ARCH), armhf arm64))
# Workaround git am issue "Out of memory getdelim failed" # Workaround git am issue "Out of memory getdelim failed"
GIT_APPLY = apply GIT_APPLY = apply
endif endif
@ -26,7 +26,7 @@ $(addprefix $(DEST)/, $(MAIN_TARGET)): $(DEST)/% :
git $(GIT_APPLY) ../0006-fix-compiling-warning-about-token-dereference.patch git $(GIT_APPLY) ../0006-fix-compiling-warning-about-token-dereference.patch
git $(GIT_APPLY) ../0007-Add-support-for-TACACS-source-address.patch git $(GIT_APPLY) ../0007-Add-support-for-TACACS-source-address.patch
dpkg-buildpackage -rfakeroot -b -us -uc dpkg-buildpackage -rfakeroot -b -us -uc -j$(SONIC_CONFIG_MAKE_JOBS) --admindir $(SONIC_DPKG_ADMINDIR)
popd popd
mv $(DERIVED_TARGETS) $* $(DEST)/ mv $(DERIVED_TARGETS) $* $(DEST)/

View File

@ -9,7 +9,7 @@ DERIVED_TARGETS = libtac2_$(PAM_TACPLUS_VERSION)_$(CONFIGURED_ARCH).deb \
$(addprefix $(DEST)/, $(MAIN_TARGET)): $(DEST)/% : $(addprefix $(DEST)/, $(MAIN_TARGET)): $(DEST)/% :
# Obtain pam_tacplus # Obtain pam_tacplus
rm -rf ./pam_tacplus rm -rf ./pam_tacplus
git clone https://github.com/jeroennijhof/pam_tacplus.git git clone https://github.com/jeroennijhof/pam_tacplus.git
pushd ./pam_tacplus pushd ./pam_tacplus
git checkout -f v1.4.1 git checkout -f v1.4.1
@ -21,7 +21,7 @@ $(addprefix $(DEST)/, $(MAIN_TARGET)): $(DEST)/% :
git apply ../0005-pam-Modify-parsing-of-IP-address-and-port-number-to-.patch git apply ../0005-pam-Modify-parsing-of-IP-address-and-port-number-to-.patch
git apply ../0006-Add-support-for-source-ip-address.patch git apply ../0006-Add-support-for-source-ip-address.patch
dpkg-buildpackage -rfakeroot -b -us -uc dpkg-buildpackage -rfakeroot -b -us -uc -j$(SONIC_CONFIG_MAKE_JOBS) --admindir $(SONIC_DPKG_ADMINDIR)
popd popd
mv $(DERIVED_TARGETS) $* $(DEST)/ mv $(DERIVED_TARGETS) $* $(DEST)/

View File

@ -26,7 +26,7 @@ $(addprefix $(DEST)/, $(MAIN_TARGET)): $(DEST)/% :
# saithrift implementation relies on the bug in union serialization # saithrift implementation relies on the bug in union serialization
# (https://jira.apache.org/jira/browse/THRIFT-3650) # (https://jira.apache.org/jira/browse/THRIFT-3650)
patch -p1 < ../patch/0001-Revert-THRIFT-3650-incorrect-union-serialization.patch patch -p1 < ../patch/0001-Revert-THRIFT-3650-incorrect-union-serialization.patch
CXXFLAGS="-DFORCE_BOOST_SMART_PTR" DEB_BUILD_OPTIONS=nocheck dpkg-buildpackage -d -rfakeroot -b -us -uc -j$(SONIC_CONFIG_MAKE_JOBS) CXXFLAGS="-DFORCE_BOOST_SMART_PTR" DEB_BUILD_OPTIONS=nocheck dpkg-buildpackage -d -rfakeroot -b -us -uc -j$(SONIC_CONFIG_MAKE_JOBS) --admindir $(SONIC_DPKG_ADMINDIR)
popd popd
mv $(DERIVED_TARGETS) $* $(DEST)/ mv $(DERIVED_TARGETS) $* $(DEST)/