[Build]: Fix /proc not mounted issue (#10164) (#10256)

[Build]: Fix /proc not mounted issue
This commit is contained in:
xumia 2022-03-19 22:19:06 +08:00 committed by GitHub
parent 03d058efe4
commit 413ee3e219
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 6 deletions

View File

@ -67,6 +67,9 @@ mkdir -p $FILESYSTEM_ROOT/$PLATFORM_DIR
mkdir -p $FILESYSTEM_ROOT/$PLATFORM_DIR/x86_64-grub mkdir -p $FILESYSTEM_ROOT/$PLATFORM_DIR/x86_64-grub
touch $FILESYSTEM_ROOT/$PLATFORM_DIR/firsttime 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 ## make / as a mountpoint in chroot env, needed by dockerd
pushd $FILESYSTEM_ROOT pushd $FILESYSTEM_ROOT
sudo mount --bind . . sudo mount --bind . .

View File

@ -632,11 +632,8 @@ if [ $MULTIARCH_QEMU_ENVIRON == y ]; then
fi fi
{% if installer_images.strip() -%} {% if installer_images.strip() -%}
clean_proc() { ## ensure proc is mounted
sudo umount /proc || true sudo mount proc /proc -t proc || true
}
trap_push clean_proc
sudo mount proc /proc -t proc
if [[ $CONFIGURED_ARCH == armhf ]]; then 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 # A workaround to fix the armhf build hung issue, caused by sonic-platform-nokia-7215_1.0_armhf.deb post installation script
ps -eo pid,cmd | grep python | grep "/etc/entropy.py" | awk '{print $1}' | xargs sudo kill -9 2>/dev/null || true ps -eo pid,cmd | grep python | grep "/etc/entropy.py" | awk '{print $1}' | xargs sudo kill -9 2>/dev/null || true
@ -673,7 +670,6 @@ if [ $MULTIARCH_QEMU_ENVIRON == y ]; then
else else
sudo chroot $FILESYSTEM_ROOT service docker stop sudo chroot $FILESYSTEM_ROOT service docker stop
fi fi
sudo umount /proc || true
sudo rm $FILESYSTEM_ROOT/etc/init.d/docker sudo rm $FILESYSTEM_ROOT/etc/init.d/docker
sudo bash -c "echo { > $FILESYSTEM_ROOT_USR_SHARE_SONIC_TEMPLATES/ctr_image_names.json" sudo bash -c "echo { > $FILESYSTEM_ROOT_USR_SHARE_SONIC_TEMPLATES/ctr_image_names.json"