[build]: umount target directory properly

Signed-off-by: Guohan Lu <lguohan@gmail.com>
This commit is contained in:
Guohan Lu 2020-03-23 07:13:29 +00:00
parent aec51c8aaf
commit 65dfe75903

View File

@ -403,6 +403,11 @@ if [[ $CONFIGURED_ARCH == armhf || $CONFIGURED_ARCH == arm64 ]]; then
fi
{% if installer_images.strip() -%}
clean_proc() {
sudo umount /proc || true
}
trap_push clean_proc
sudo mount proc /proc -t proc
sudo mkdir $FILESYSTEM_ROOT/target
sudo mount --bind target $FILESYSTEM_ROOT/target
sudo chroot $FILESYSTEM_ROOT docker $SONIC_NATIVE_DOCKERD_FOR_DOCKERFS info
@ -431,6 +436,7 @@ echo "docker images pull complete"
sudo umount $FILESYSTEM_ROOT/target
sudo rm -r $FILESYSTEM_ROOT/target
sudo umount /proc || true
if [[ $CONFIGURED_ARCH == armhf || $CONFIGURED_ARCH == arm64 ]]; then
sudo umount $FILESYSTEM_ROOT/dockerfs
sudo rm -fr $FILESYSTEM_ROOT/dockerfs