blob: 341c3d8f45980d71767986fcb5fc033a0d5fd3ec [file] [log] [blame]
rjw1f884582022-01-06 17:20:42 +08001#!/bin/bash
2
3OUTDIR=`pwd`
4TARDIR=$OUTDIR
5
6
7if [ -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
17fi
18
19
20set -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
23mv $TARDIR/modem.img $1
24
25if 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
33else
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
37fi
38set +e
39
40
41rm -rf $OUTDIR/modem1_image $OUTDIR/modem3_image $OUTDIR/dsp_bin
42rm -f $OUTDIR/modem_sparse.img $OUTDIR/modemc2k_sparse.img $OUTDIR/dsp_sparse.bin
43
44