本文共 4480 字,大约阅读时间需要 14 分钟。
#!/bin/sh
function result(){ if [ $1 -eq 0 ]thenecho " $2..............................................sucess"elseecho " $2..............................................fail,please check carefully!"exitfi}rm -rf .imgrootfs_dir=../../../../system/linux_filesystem/trunk/rootfsapp_dst_dir=$rootfs_dir/bnt6000/bin/if [ -d $rootfs_dir ] && [ -d $app_dst_dir ]thenecho "roofs dir is:$rootfs_dir"echo "app_dest_dir is:$app_dst_dir"elseecho "app_dest_dir or rootfs_dir is not exist,so tar rootfs_dir now!."cd ../../../../system/linux_filesystem/trunk/tar xvf rootfs.gzresult $? tarcd -fiif [ -c $rootfs_dir/dev/console ] && [ -c $rootfs_dir/dev/null ]
thenecho "/dev/console and /dev/null already exsit"elseecho $rootfs_dir/dev/console echo $rootfs_dir/dev/null cd $rootfsdir/devmknod -m 660 console c 5 1result $? mknod/dev/consolemknod -m 660 null c 1 3result $? mknod_/dev/nullcd -fi#pack dir cfg#pack_dir=./test#pack_dir=/share/pack_image/bnt4000hd/release/trunk/pack_dir=.if [ -d $pack_dir ]; then
echo "pack dir is:$pack_dir"elseecho 'pack dir is not exist, so exit.'exitfi#src dir cfg
src_dir=..bnt6000File=$src_dir/main/bnt6000avFile=$src_dir/av/venc/avmaintainFile=$src_dir/av/core/appif [ -f $bnt6000File ] && [ -f $avFile ] && [ -f $maintainFile ]thenecho "bnt6000 av app file ,success"else echo "bnt6000 av app file may be not exist "exitfi #packFile=$src_dir/av/upgrade/pack_appos_dir=../../../../system/linux_filesystem/trunk
#ramdisk=$os_dir/hifs-ramdisk.gz#target_name=$app_src_dir/release/bnt4000hd.ramfs;#source_name=$os_dir/hifs-ramdisk#target_app=$app_dir/$maintainFile $app_dir/$bnt6000File $app_dir/$avFile#ramdisk=$os_dir/hifs-ramdisk.gz
target_name=bnt4000hd.ramfssource_name=hifs-ramdisk#cp file###########new 20120605cp -av $maintainFile $app_dstdirresult $? cp$maintainFilecp -av $avFile $app_dstdirresult $? cp$avFilecp -av $bnt6000File $app_dstdirresult $? cp$bnt6000File cp -av $src_dir/update/check_update $app_dst_dirresult $? cp_check_update#cp -av $src_dir/av/bntcomm/libbnt_comm.so $rootfs_dir/lib/
#cp -av $src_dir/av/database/libav_database.so $rootfs_dir/lib/cp -av $src_dir/etc/bnt6000.conf $rootfs_dir/bnt6000/init/
result $? cp_bnt6000.confcp -av $src_dir/etc/registinfo.conf $rootfs_dir/bnt6000/init/result $? cp_registinfo.confcp -av $src_dir/etc/terid.conf $rootfs_dir/bnt6000/init/result $? cp_terid.confcp -av $src_dir/etc/start.sh $rootfs_dir/bnt6000/init/result $? cp_start.shcp -av $src_dir/format/fmtsd $rootfs_dir/usr/sbin/result $? cp_fmtsdchmod +x $rootfs_dir/bnt6000/init/start.sh#cp -av $KERNEL_DIR/arch/arm/boot/uImage $app_src_dir/release/bnt4000hd.uImg
#cp -av $UBOOT_DIR/u-boot.bin $app_src_dir/release/cp -av $maintainFile $packdirresult $? cp$maintainFilecp -av $avFile $packdirresult $? cp$avFilecp -av $bnt6000File $packdirresult $? cp$bnt6000File#cp -av $packFile $pack_dir
genext2fs -b 20480 -d $os_dir/rootfs -i 10240 $source_name
result $? genext2fsgzip -vf9 $source_nameresult $? gzipmkimage -A arm -O linux -T ramdisk -C gzip -a 0xc11fffc0 -e 0xc1200000 -n "RAMDISK" -d $source_name.gz $target_name#cp -av $target_name ~/share -rfresult $? mkimagecp -av $target_name ../system_imgs -rfresult 0 making_filesystem#pack............
#1. export--------------------------------------
#(1) stm32 verexport stm32Version=STM32_V3.2.1.149#export stm32Version=STM32_V5.0.2.SZver_num=svn info https://10.86.2.6:10443/svn/Embedded/project/linux/bnt4000hd//src/trunk/base | grep "Last Changed Rev: " | sed -e "s/Last Changed Rev: //g"
#(2) app ver, run pack_app view
#export linuxVersion=v3.3.3.4750export linuxVersion=v4.3.18.$ver_numexport ubootBin=u-boot.bin_20141226 if [ $# -eq 2 ];then linuxVersion=$1.$ver_numstm32Version=$2fi#2.build-----------------------------------------
#(1)(uboot + kernel + rootfs + stm32 + app)#uboot: -u#kernel: -k#rootfs: rootfs #output: -o ./pack_app -f ../system_imgs/bnt4000hd.ramfs -k ../system_imgs/bnt4000hd.uImg -u ../system_imgs/"$ubootBin" -a ./stm324000hd/"$stm32Version".bin -r app -b bnt6000 -v av -o bnt4000hd"$linuxVersion"_"$stm32Version"_full.img#(2)app+stm32
./pack_app -a ./stm324000hd/"$stm32Version".bin -r app -b bnt6000 -v av -o bnt4000hd"$linuxVersion"_"$stm32Version"_app.img#(3)app
./packapp -r app -b bnt6000 -v av -o bnt4000hd"$linuxVersion"_linux_app.img#(4)web
#./pack_app -r webservice.tar.gz -o ym8000_webservice.img转载于:https://blog.51cto.com/13375232/2056134