/* format 各个partiton ,扩展分区3包括part5/6*/
echo sudo mkfs.vfat $part1 sudo mkfs.vfat $part1
echo sudo mkfs.ext4 $part2 -O ^extent -L system
sudo mkfs.ext4 $part2 -O ^extent -L system
echo sudo mkfs.ext4 $part4 -O ^extent -L recovery
sudo mkfs.ext4 $part4 -O ^extent -L recovery
echo sudo mkfs.ext4 $part5 -O ^extent -L data
sudo mkfs.ext4 $part5 -O ^extent -L data
echo sudo mkfs.ext4 $part6 -O ^extent -L cache
sudo mkfs.ext4 $part6 -O ^extent -L cache
/* 将uboot/kernel/ramdisk 烧写到卡前部裸扇区(在分区之外)*/
sudo dd if=u-boot-tv.bin of=$dev bs=1k seek=1 skip=1;sync;
sudo dd if=uImage of=$dev bs=1M seek=1;sync;
sudo dd if=uramdisk.img of=$dev bs=1M seek=6;sync;
sudo ./gencrc_tv
sudo dd if=uboot_env_tv.bin of=$dev bs=1k seek=768 ;sync;
/* mount 各个partiton */
sudo mount $part1 /mnt/$val/vfat
sudo mount $part2 /mnt/$val/system
sudo mount $part4 /mnt/$val/recovery
sudo mount $part5 /mnt/$val/data
/* 将文件copy 到各个partition */
cd /mnt/$val
sudo tar xjvf $path/vfat_a.bz2;sync;
sudo tar xjvf $path/data_a.bz2;sync;
sudo tar xjvf $path/recovery.bz2;sync;
sudo tar xjvf $path/system.bz2;sync;
/* copy 完成后,umount*/
cd $path
sudo umount $all_part