目前的代碼只是包含了製作檔案鏡像,組建檔案系統的部分
#!/bin/sh#LOG="./version_make.log"ROOT_PATH="./update_file/network_update"LOG="./update_file/version_make.log"VER_F="./rootfs_V1123/home/version"#**************************************************************************VENDOR_LIST="base test"valid=0VENDOR=$1VER=$2DATE=$3mkramdisk(){echo "make filesystem"rm $VER_Fdate >> $VER_Fecho $VER >> $VER_Fecho $DATE >> $VER_F #date use to display the vermake allcp -f rootfs_ext2.gz mkupdata_file/rootfs.jffs2return 0}mkjffs2(){echo "make filesystem"#for 128KB block#mkfs.jffs2 -d rootfs_V1123 -o rootfs.jffs2 -e 0x20000#for 64KB block#mkfs.jffs2 -d rootfs_V1123 -o rootfs.jffs2#use read-only systemmkfs.cramfs rootfs_V1123 rootfs.jffs2cp -f rootfs.jffs2 mkupdata_file/#cp -f rootfs.jffs2 /tftpboot/return 0}#**************************************************************************if [ -z $VENDOR ]; thenecho "Usage: go.sh vendor ver"echo " vendor list: $VENDOR_LIST"exitfiif [ -z $VER ]; thenecho "Usage: go.sh vendor ver"exitfifor n in $VENDOR_LIST; doif [ $VENDOR = $n ]; thenvalid=1break;fidoneif [ $valid = 0 ]; thenecho "Invalid vendor: $VENDOR"echo " option list: $VENDOR_LIST"exitfi#**************make log******************************date >> $LOGecho "make MDVRB_v$VER _$VENDOR.bin" >> $LOG#cp "version_make.log" $LOG1#****************************************************echo "copy special file for $VENDOR"#copy common filerm -rf rootfs_V1123/root/tl_app/data/picstar xfz vendor/common/pics.tgz -C rootfs_V1123/root/tl_app/data/cp -f vendor/common/logo_576.png rootfs_V1123/root/tl_app/data/pics/cp -fr vendor/common/my_icon rootfs_V1123/root/tl_app/data/pics/cp -f vendor/common/uImage_mr9104 mkupdata_file/uImage_hs3512cp -f vendor/common/hwtest rootfs_V1123/sbin#cp -f vendor/common/u-boot_combo2.bin mkupdata_file/u-boot_combo2.bin#cp -f vendor/common/tw_2864.ko rootfs_V1123/root/tl_modules/our_modules/if [ $VENDOR = "canrun" ]; thenecho "copy 32x32 font"cp -f vendor/$VENDOR/heigb2312.DZK rootfs_V1123/root/tl_app/data/fonts/cp -f vendor/$VENDOR/logo_576.png rootfs_V1123/root/tl_app/data/pics/cp -f vendor/$VENDOR/u-boot_combo2_carrun.bin mkupdata_file/u-boot_combo2.binfiif [ $VENDOR = "honghui" ]; thenecho "copy honghui logo"cp -f vendor/$VENDOR/logo_576.png rootfs_V1123/root/tl_app/data/pics/fiif [ $VENDOR = "bizi" ]; thenecho "### using 16K audio ###"cp -f vendor/bizi/tw_2864_54M_16K.ko rootfs_V1123/root/tl_modules/our_modules/tw_2864.kofiif [ $? -ne 0 ]; thenecho "###### copy file error ######"exit -1fimkramdiskecho "vendor: $VENDOR, version:$VER"echo "make update file"cd mkupdata_file./gen.sh $VENDOR $VER #升級鏡像 if [ $VER -lt 100 ]; thencp -f DVR.bin ../MDVRB_v0$VER\_$VENDOR.binelsecp -f DVR.bin ../MDVRB_v$VER\_$VENDOR.binficd -mv MDVRB_v$VER\_$VENDOR.bin $ROOT_PATH/./crc_add.sh $VER #添加crc校正位if [ $VENDOR = "canrun" ]; thenecho "delete font"rm -f rootfs_V1123/root/tl_app/data/fonts/heigb2312.DZKfi