X-Git-Url: http://git.osdn.net/view?p=android-x86%2Fbootable-newinstaller.git;a=blobdiff_plain;f=install%2Fscripts%2F1-install;h=f5d5c62430d5dc756626887bc427ac847db238a4;hp=0c623682c0087445638a9f6bf627dee9756847a5;hb=7fe5e79c933d03faa5a2bdece15016a483f55885;hpb=72626c5076f132b037bb78289c42e02d9745b972 diff --git a/install/scripts/1-install b/install/scripts/1-install index 0c62368..f5d5c62 100644 --- a/install/scripts/1-install +++ b/install/scripts/1-install @@ -285,6 +285,16 @@ check_data_img() losetup -d /dev/loop7 } +gen_img() +{ + if [ "$fs" = "vfat" ]; then + ( dd bs=1M count=$1 if=/dev/zero | pv -ns $1m | dd of=$2 ) 2>&1 \ + | progress_bar "Creating `basename $2`" "Expect to write $1 MB..." + else + dd if=/dev/zero bs=1 count=0 seek=$1M of=$2 + fi +} + create_img() { bname=`basename $2` @@ -298,8 +308,7 @@ create_img() "\nPlease input the size of the $bname in MB:" 8 63 $1 2> $tempfile size=`cat $tempfile` [ 0$size -le 0 ] && size=2048 - ( dd bs=1M count=$size if=/dev/zero | pv -ns ${size}m | dd of=$2 ) 2>&1 \ - | progress_bar "Creating $bname" "Expect to write $size MB..." + gen_img $size $2 } create_data_img()