rjw | 1f88458 | 2022-01-06 17:20:42 +0800 | [diff] [blame^] | 1 | #!/bin/bash |
| 2 | |
| 3 | OUTDIR=`pwd` |
| 4 | TARDIR=$OUTDIR |
| 5 | |
| 6 | |
| 7 | if [ -d "$TARDIR" ]; then |
| 8 | |
| 9 | #Create directories and move images into them. |
| 10 | mkdir -p $OUTDIR/modem1_image && cp -af $1 $OUTDIR/modem1_image |
| 11 | if echo "$2" | grep -q "modemc2k"; then |
| 12 | mkdir -p $OUTDIR/modem3_image && cp -af $2 $OUTDIR/modem3_image/ |
| 13 | mkdir -p $OUTDIR/dsp_bin && cp -af $3 $OUTDIR/dsp_bin/ |
| 14 | else |
| 15 | mkdir -p $OUTDIR/dsp_bin && cp -af $2 $OUTDIR/dsp_bin/ |
| 16 | fi |
| 17 | fi |
| 18 | |
| 19 | |
| 20 | set -e |
| 21 | $OUTDIR/tools/make_ext4fs -s -j 1 -l 14M $OUTDIR/modem_sparse.img $OUTDIR/modem1_image 1> /dev/null |
| 22 | $OUTDIR/tools/simg2img $OUTDIR/modem_sparse.img $TARDIR/modem.img |
| 23 | mv $TARDIR/modem.img $1 |
| 24 | |
| 25 | if echo "$2" | grep -q "modemc2k"; then |
| 26 | $OUTDIR/tools/make_ext4fs -s -j 1 -l 8M $OUTDIR/modemc2k_sparse.img $OUTDIR/modem3_image 1> /dev/null |
| 27 | $OUTDIR/tools/simg2img $OUTDIR/modemc2k_sparse.img $TARDIR/modemc2k.img |
| 28 | mv $TARDIR/modemc2k.img $2 |
| 29 | |
| 30 | $OUTDIR/tools/make_ext4fs -s -j 1 -l 2M $OUTDIR/dsp_sparse.bin $OUTDIR/dsp_bin 1> /dev/null |
| 31 | $OUTDIR/tools/simg2img $OUTDIR/dsp_sparse.bin $TARDIR/dsp.bin |
| 32 | mv $TARDIR/dsp.bin $3 |
| 33 | else |
| 34 | $OUTDIR/tools/make_ext4fs -s -j 1 -l 2M $OUTDIR/dsp_sparse.bin $OUTDIR/dsp_bin 1> /dev/null |
| 35 | $OUTDIR/tools/simg2img $OUTDIR/dsp_sparse.bin $TARDIR/dsp.bin |
| 36 | mv $TARDIR/dsp.bin $2 |
| 37 | fi |
| 38 | set +e |
| 39 | |
| 40 | |
| 41 | rm -rf $OUTDIR/modem1_image $OUTDIR/modem3_image $OUTDIR/dsp_bin |
| 42 | rm -f $OUTDIR/modem_sparse.img $OUTDIR/modemc2k_sparse.img $OUTDIR/dsp_sparse.bin |
| 43 | |
| 44 | |