From cab6ac6e19dfed63d9117167d3ee19b011369398 Mon Sep 17 00:00:00 2001 From: xumia <59720581+xumia@users.noreply.github.com> Date: Fri, 11 Mar 2022 09:23:37 +0800 Subject: [PATCH] [Build]: Fix /proc not mounted issue (#10164) [Build]: Fix /proc not mounted issue --- build_debian.sh | 3 +++ files/build_templates/sonic_debian_extension.j2 | 6 +----- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/build_debian.sh b/build_debian.sh index 8831caa1dd..b3b934c274 100755 --- a/build_debian.sh +++ b/build_debian.sh @@ -67,6 +67,9 @@ mkdir -p $FILESYSTEM_ROOT/$PLATFORM_DIR mkdir -p $FILESYSTEM_ROOT/$PLATFORM_DIR/x86_64-grub touch $FILESYSTEM_ROOT/$PLATFORM_DIR/firsttime +## ensure proc is mounted +sudo mount proc /proc -t proc || true + ## make / as a mountpoint in chroot env, needed by dockerd pushd $FILESYSTEM_ROOT sudo mount --bind . . diff --git a/files/build_templates/sonic_debian_extension.j2 b/files/build_templates/sonic_debian_extension.j2 index 3e480d6acc..4d3ec87660 100644 --- a/files/build_templates/sonic_debian_extension.j2 +++ b/files/build_templates/sonic_debian_extension.j2 @@ -648,10 +648,7 @@ if [ $MULTIARCH_QEMU_ENVIRON == y ]; then fi {% if installer_images.strip() -%} -clean_proc() { - sudo umount /proc || true -} -trap_push clean_proc +## ensure proc is mounted sudo mount proc /proc -t proc || true if [[ $CONFIGURED_ARCH == armhf ]]; then # A workaround to fix the armhf build hung issue, caused by sonic-platform-nokia-7215_1.0_armhf.deb post installation script @@ -737,7 +734,6 @@ if [ $MULTIARCH_QEMU_ENVIRON == y ]; then else sudo chroot $FILESYSTEM_ROOT $DOCKER_CTL_SCRIPT stop fi -sudo umount /proc || true sudo bash -c "echo { > $FILESYSTEM_ROOT_USR_SHARE_SONIC_TEMPLATES/ctr_image_names.json" {% for entry in feature_vs_image_names.split(' ') -%}