Skip to content

Commit

Permalink
[Build]: Fix /proc not mounted issue (#10164)
Browse files Browse the repository at this point in the history
[Build]: Fix /proc not mounted issue
  • Loading branch information
xumia committed Mar 11, 2022
1 parent f34b5e6 commit 9cdf812
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
3 changes: 3 additions & 0 deletions build_debian.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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 . .
Expand Down
6 changes: 1 addition & 5 deletions files/build_templates/sonic_debian_extension.j2
Original file line number Diff line number Diff line change
Expand Up @@ -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
sudo mkdir $FILESYSTEM_ROOT/target
sudo mount --bind target $FILESYSTEM_ROOT/target
Expand Down Expand Up @@ -732,7 +729,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(' ') -%}
Expand Down

0 comments on commit 9cdf812

Please sign in to comment.