diff options
author | Michael Larson <slioch@slioch.vyatta.com> | 2010-06-21 11:09:51 -0700 |
---|---|---|
committer | Michael Larson <slioch@slioch.vyatta.com> | 2010-06-21 11:09:51 -0700 |
commit | d801c05f63b0b16f485b176db64e3147ad7d3086 (patch) | |
tree | 9829f0bf340a55986aa6d11f1b1d8d5334306abd /scripts/install-system | |
parent | 6d59b5077ef1834379a950437b01d15d687c7a53 (diff) | |
parent | 7369bf61abd3eed1fdd17a56908cf2c0ffc9843f (diff) | |
download | vyatta-cfg-quagga-d801c05f63b0b16f485b176db64e3147ad7d3086.tar.gz vyatta-cfg-quagga-d801c05f63b0b16f485b176db64e3147ad7d3086.zip |
Merge branch 'larkspur' of http://git.vyatta.com/vyatta-cfg-system into larkspur
Diffstat (limited to 'scripts/install-system')
-rwxr-xr-x | scripts/install-system | 27 |
1 files changed, 22 insertions, 5 deletions
diff --git a/scripts/install-system b/scripts/install-system index d17f0c2e..4f92ca37 100755 --- a/scripts/install-system +++ b/scripts/install-system @@ -890,6 +890,23 @@ create_partitions() { fi } +# Copy directory with pretty progress bar +copy_filesystem() { + cp -r -v --preserve=all "$@" | awk '{ + ++files + if ((files % 10) == 0) { + percent = files / total_files * 100 + printf "%3d%% [", percent + for (i=0;i<percent; i+=2) + printf "=" + printf ">" + for (;i<100;i+=2) + printf " " + printf "]\r" + } + }' total_files=$(find "$@" | wc -l) +} + # Install the root filesystem # $1 is the partition to install on install_root_filesystem () { @@ -914,8 +931,7 @@ install_root_filesystem () { fi if [ -z $UNION ]; then - echo -n "Copying system image files to /dev/$ROOT_PARTITION: " - progress_indicator start + echo "Copying system files to /dev/$ROOT_PARTITION: " # Mount the squashfs for copying output=$(mkdir -p /mnt/squashfs) if [ -f /live/image/live/filesystem.squashfs ]; then @@ -936,12 +952,13 @@ install_root_filesystem () { exit 1 fi - output=$(cp -pR /mnt/squashfs/* $rootfsdir/) + echo "Copying /mnt/squashfs/* to $rootfsddir" >>$INSTALL_LOG + copy_filesystem /mnt/squashfs/* $rootfsdir 2>>$INSTALL_LOG status=$? - + echo + if [ "$status" != 0 ]; then echo -e "Error trying to copy the rootfs.\nPlease see install log for more details.\nExiting..." - echo -e "Error trying to copy the rootfs.\ncp -pR /mnt/squashfs/* $rootfsdir/\n$output" >> $INSTALL_LOG exit 1 fi |