@leaveye
2017-11-27T02:13:01.000000Z
字数 2278
阅读 973
w1302
enter work dir
cd ~/sd_files/20160331/
set argument for burn disk.
edit burn.config file to have these lines:
# device node root name, to be partitioneddevice=/dev/sdc# directory where system automounts the partitions intomountroot=/media# tarballs to be installedBOOT=repack-boot-20160331.tgzROOTFS=repack-rootfs-20160331.tgz
./burn-stage01-newcardonly./burn-stage02-rewritecard
./burn-stage02-rewritecard
This code is for demo only !
# device node root name, to be partitioneddevice=/dev/sdc# directory where system automounts the partitions intomountroot=/media# tarballs to be installedBOOT=repack-boot-20160331.tgzROOTFS=repack-rootfs-20160331.tgz#ROOTFS=repack-rootfs160-20160331.tgz
#!/bin/bash# reference command:# ./format_sd.sh --device /dev/sdc --sdk /home/dev/ti-ezsdk_dm816x-evm_5_05_02_00{ test -r burn.config && . ./burn.config; } ||{ echo 'you need file "burn.config"'; exit 1; }test -b "$device" ||{ echo 'illegal "burn.config": no device specified'; exit 1; }unmount() {for i in `ls -1 $device?`; doecho "unmounting '$i'"umount $i 2>/dev/nulldone}partition() {# get the partition information.total_size=`fdisk -l $device | grep Disk | awk '{print $5}'`total_cyln=`echo $total_size/255/63/512 | bc`# default number of cylinder for first paritionpc1=5# do partition{echo ,$pc1,0x0C,*echo ,,,-} |sfdisk -D -H 255 -S 63 -C $total_cyln $device}format() {mkfs.vfat -F 32 -n BOOT ${device}1mkfs.ext3 -j -L ROOTFS ${device}2}remount() {mkdir -p /media/BOOTmount ${device}1 /media/BOOTmkdir -p /media/ROOTFSmount ${device}2 /media/ROOTFS}unmounterase0partitionformatremount
#!/bin/bash{ test -r burn.config && . ./burn.config; } ||{ echo 'you need file "burn.config"'; exit 1; }test -b "$device" ||{ echo 'illegal "burn.config": no device specified'; exit 1; }burn() {SRC="$(eval "echo \"\$$1\"")"DST="$mountroot/$1"test -r "$SRC" || { echo "burn $1: no $SRC found"; return 1; }test -d "$DST" || { echo "burn $1: no $DST found"; return 1; }shiftcase "$SRC" in*.tar) opt=;;*.tar.gz|*.tgz) opt=-z;;*.tar.bz2) opt=-j;;*) ;;esacpv -N "burn '$DST'" "$SRC" | {( cd "$DST" && rm -rf * >/dev/null 2>&1; )sudo tar -C "$DST" --no-same-owner $opt $* -x}return $?}{echo '==== Round 1 ===='burn BOOT &&burn ROOTFS} &&{echo '==== Round 2 ===='burn BOOT &&burn ROOTFS} &&echo '==== all DONE ===='
