From 5f4132ad95748783712cd702ca036a1b9d8dfdf8 Mon Sep 17 00:00:00 2001 From: Konstantin Vasin <126960927+k-v1@users.noreply.github.com> Date: Sun, 19 Nov 2023 14:31:48 +0300 Subject: [PATCH] don't build debootstrap from source --- rules/debootstrap.dep | 10 --------- rules/debootstrap.mk | 9 -------- slave.mk | 2 -- sonic-slave-bookworm/Dockerfile.j2 | 1 + src/debootstrap/.gitignore | 3 --- src/debootstrap/Makefile | 24 --------------------- src/debootstrap/proc-mount.patch | 34 ------------------------------ 7 files changed, 1 insertion(+), 82 deletions(-) delete mode 100644 rules/debootstrap.dep delete mode 100644 rules/debootstrap.mk delete mode 100644 src/debootstrap/.gitignore delete mode 100644 src/debootstrap/Makefile delete mode 100644 src/debootstrap/proc-mount.patch diff --git a/rules/debootstrap.dep b/rules/debootstrap.dep deleted file mode 100644 index 82ca11d7e4df..000000000000 --- a/rules/debootstrap.dep +++ /dev/null @@ -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) - diff --git a/rules/debootstrap.mk b/rules/debootstrap.mk deleted file mode 100644 index a74fa22e9faa..000000000000 --- a/rules/debootstrap.mk +++ /dev/null @@ -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) diff --git a/slave.mk b/slave.mk index ae2beaf0837f..92103b5e2777 100644 --- a/slave.mk +++ b/slave.mk @@ -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)) \ diff --git a/sonic-slave-bookworm/Dockerfile.j2 b/sonic-slave-bookworm/Dockerfile.j2 index 7becd870fe6c..95af2bd82e94 100644 --- a/sonic-slave-bookworm/Dockerfile.j2 +++ b/sonic-slave-bookworm/Dockerfile.j2 @@ -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 \ diff --git a/src/debootstrap/.gitignore b/src/debootstrap/.gitignore deleted file mode 100644 index 2aa8324ad667..000000000000 --- a/src/debootstrap/.gitignore +++ /dev/null @@ -1,3 +0,0 @@ -debootstrap*.udeb -debootstrap*.dsc -debootstrap-*/ diff --git a/src/debootstrap/Makefile b/src/debootstrap/Makefile deleted file mode 100644 index 04e8646a1b2e..000000000000 --- a/src/debootstrap/Makefile +++ /dev/null @@ -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) - diff --git a/src/debootstrap/proc-mount.patch b/src/debootstrap/proc-mount.patch deleted file mode 100644 index 93084576490a..000000000000 --- a/src/debootstrap/proc-mount.patch +++ /dev/null @@ -1,34 +0,0 @@ -From 87cdebbcad6f4e16ba711227cbbbd70039f88752 Mon Sep 17 00:00:00 2001 -From: YunQiang Su -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 -