Skip to content

Commit

Permalink
Ignore return value of umount (#801)
Browse files Browse the repository at this point in the history
* Ignore return value of umount

* Refine the umount process, more diagnostic info output
  • Loading branch information
qiluo-msft authored and lguohan committed Jul 12, 2017
1 parent 1b5255d commit 9925aab
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions build_debian.sh
Original file line number Diff line number Diff line change
Expand Up @@ -316,16 +316,22 @@ sudo LANG=C chroot $FILESYSTEM_ROOT bash -c 'rm -rf /usr/share/doc/* /usr/share/

## Umount all
echo '[INFO] Umount all'
## Display all process details access /proc
sudo LANG=C chroot $FILESYSTEM_ROOT fuser -vm /proc
## Kill the processes
sudo LANG=C chroot $FILESYSTEM_ROOT fuser -km /proc || true
sudo LANG=C chroot $FILESYSTEM_ROOT umount /proc
## Wait fuser fully kill the processes
sleep 15
sudo umount $FILESYSTEM_ROOT/proc || true

## Prepare empty directory to trigger mount move in initramfs-tools/mount_loop_root, implemented by patching
sudo mkdir $FILESYSTEM_ROOT/host

## Compress most file system into squashfs file
sudo rm -f $ONIE_INSTALLER_PAYLOAD $FILESYSTEM_SQUASHFS
## Output the file system total size for diag purpose
sudo du -hs $FILESYSTEM_ROOT
## Note: -x to skip directories on different file systems, such as /proc
sudo du -hsx $FILESYSTEM_ROOT
sudo mksquashfs $FILESYSTEM_ROOT $FILESYSTEM_SQUASHFS -e boot -e var/lib/docker -e $PLATFORM_DIR

## Compress docker files
Expand Down

0 comments on commit 9925aab

Please sign in to comment.