don't build debootstrap from source

This commit is contained in:
Konstantin Vasin 2023-11-19 14:31:48 +03:00 committed by Ying Xie
parent c8fe65873f
commit 5f4132ad95
7 changed files with 1 additions and 82 deletions

View File

@ -1,10 +0,0 @@
SPATH := $($(DEBOOTSTRAP)_SRC_PATH)
DEP_FILES := $(SONIC_COMMON_FILES_LIST) rules/debootstrap.mk rules/debootstrap.dep
DEP_FILES += $(SONIC_COMMON_BASE_FILES_LIST)
DEP_FILES += $(shell git ls-files $(SPATH))
$(DEBOOTSTRAP)_CACHE_MODE := GIT_CONTENT_SHA
$(DEBOOTSTRAP)_DEP_FLAGS := $(SONIC_COMMON_FLAGS_LIST)
$(DEBOOTSTRAP)_DEP_FILES := $(DEP_FILES)

View File

@ -1,9 +0,0 @@
# debootstrap package
DEBOOTSTRAP_VERSION = 1.0.123+deb11u1
export DEBOOTSTRAP_VERSION
DEBOOTSTRAP = debootstrap_$(DEBOOTSTRAP_VERSION)_all.deb
$(DEBOOTSTRAP)_SRC_PATH = $(SRC_PATH)/debootstrap
SONIC_MAKE_DEBS += $(DEBOOTSTRAP)

View File

@ -1270,7 +1270,6 @@ $(addprefix $(TARGET_PATH)/, $(SONIC_RFS_TARGETS)) : $(TARGET_PATH)/% : \
.platform \
build_debian.sh \
$(addprefix $(IMAGE_DISTRO_DEBS_PATH)/,$(INITRAMFS_TOOLS) $(LINUX_KERNEL)) \
$(addsuffix -install,$(addprefix $(IMAGE_DISTRO_DEBS_PATH)/,$(DEBOOTSTRAP))) \
$$(addprefix $(TARGET_PATH)/,$$($$*_DEPENDENT_RFS)) \
$(call dpkg_depend,$(TARGET_PATH)/%.dep)
$(HEADER)
@ -1356,7 +1355,6 @@ $(addprefix $(TARGET_PATH)/, $(SONIC_INSTALLERS)) : $(TARGET_PATH)/% : \
$$(addprefix $(TARGET_PATH)/,$$($$*_DOCKERS)) \
$$(addprefix $(TARGET_PATH)/,$$(SONIC_PACKAGES_LOCAL)) \
$$(addprefix $(FILES_PATH)/,$$($$*_FILES)) \
$(addsuffix -install,$(addprefix $(IMAGE_DISTRO_DEBS_PATH)/,$(DEBOOTSTRAP))) \
$(if $(findstring y,$(ENABLE_ZTP)),$(addprefix $(IMAGE_DISTRO_DEBS_PATH)/,$(SONIC_ZTP))) \
$(if $(findstring y,$(INCLUDE_FIPS)),$(addprefix $(IMAGE_DISTRO_DEBS_PATH)/,$(SYMCRYPT_OPENSSL))) \
$(addprefix $(PYTHON_WHEELS_PATH)/,$(SONIC_UTILITIES_PY3)) \

View File

@ -117,6 +117,7 @@ RUN apt-get update && apt-get install -y \
uuid-dev \
jq \
cron \
debootstrap \
# For sonic-swss-common
nlohmann-json3-dev \
libhiredis-dev \

View File

@ -1,3 +0,0 @@
debootstrap*.udeb
debootstrap*.dsc
debootstrap-*/

View File

@ -1,24 +0,0 @@
.ONESHELL:
SHELL = /bin/bash
.SHELLFLAGS += -e
MAIN_TARGET = debootstrap_$(DEBOOTSTRAP_VERSION)_all.deb
$(addprefix $(DEST)/, $(MAIN_TARGET)): $(DEST)/% :
# Remove any stale files
rm -rf ./debootstrap-$(DEBOOTSTRAP_VERSION) ./debootstrap*.{deb,udeb,dsc}
# Get source package
dget https://deb.debian.org/debian/pool/main/d/debootstrap/debootstrap_$(DEBOOTSTRAP_VERSION).dsc
# Build source and Debian packages
pushd debootstrap-$(DEBOOTSTRAP_VERSION)
patch -p1 -i ../proc-mount.patch
dpkg-buildpackage -rfakeroot -b -us -uc -j$(SONIC_CONFIG_MAKE_JOBS) --admindir $(SONIC_DPKG_ADMINDIR)
popd
# Move the newly-built .deb packages to the destination directory
mv $(DERIVED_TARGETS) $* $(DEST)/
$(addprefix $(DEST)/, $(DERIVED_TARGETS)): $(DEST)/% : $(DEST)/$(MAIN_TARGET)

View File

@ -1,34 +0,0 @@
From 87cdebbcad6f4e16ba711227cbbbd70039f88752 Mon Sep 17 00:00:00 2001
From: YunQiang Su <syq@debian.org>
Date: Mon, 7 Sep 2020 09:29:37 +0800
Subject: [PATCH] stage1: re-mkdir /proc instead of umount if it is a symlink
In docker, the TARGET/proc will be a symlink to /proc.
And if the docker instance is called with --privileged, it will umount
the /proc of the whole instance in setup_proc.
---
debian/changelog | 3 +++
functions | 7 ++++++-
2 files changed, 9 insertions(+), 1 deletion(-)
diff --git a/functions b/functions
index 1ac63f7..065320d 100644
--- a/functions
+++ b/functions
@@ -1183,7 +1183,12 @@ setup_proc () {
umount_on_exit /dev/shm
umount_on_exit /proc
umount_on_exit /proc/bus/usb
- umount "$TARGET/proc" 2>/dev/null || true
+ if [ -L "$TARGET/proc" ];then
+ rm -f $TARGET/proc
+ mkdir $TARGET/proc
+ else
+ umount "$TARGET/proc" 2>/dev/null || true
+ fi
# some container environment are used at second-stage, it already treats /proc and so on
if [ -z "$(ls -A "$TARGET/proc")" ]; then
--
GitLab