[image]: expand dockerfs.tar.gz directly on to disk without intermediate file (#715)

This commit is contained in:
lguohan 2017-06-18 15:52:49 -07:00 committed by GitHub
parent 897cc2bbb5
commit 2f231f3653

View File

@ -422,12 +422,11 @@ else
fi
# Decompress the file for the file system directly to the partition
unzip $ONIE_INSTALLER_PAYLOAD -d $demo_mnt/$image_dir
unzip -o $ONIE_INSTALLER_PAYLOAD -x "$FILESYSTEM_DOCKERFS" -d $demo_mnt/$image_dir
if [ -f $demo_mnt/$image_dir/$FILESYSTEM_DOCKERFS ]; then
TAR_EXTRA_OPTION="--numeric-owner"
cd $demo_mnt/$image_dir && mkdir -p $DOCKERFS_DIR && tar x $TAR_EXTRA_OPTION -f $FILESYSTEM_DOCKERFS -C $DOCKERFS_DIR && rm -f $FILESYSTEM_DOCKERFS; cd $OLDPWD
fi
TAR_EXTRA_OPTION="--numeric-owner"
mkdir -p $demo_mnt/$image_dir/$DOCKERFS_DIR
unzip -op $ONIE_INSTALLER_PAYLOAD "$FILESYSTEM_DOCKERFS" | tar xz $TAR_EXTRA_OPTION -f - -C $demo_mnt/$image_dir/$DOCKERFS_DIR
# Create loop device for /var/log to limit its size to $VAR_LOG_SIZE MB
if [ -f $demo_mnt/disk-img/var-log.ext4 ]; then