shell指令碼下製作檔案升級系統

來源:互聯網
上載者:User

目前的代碼只是包含了製作檔案鏡像,組建檔案系統的部分

#!/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

 

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.