blob: 341c3d8f45980d71767986fcb5fc033a0d5fd3ec [file] [log] [blame]
#!/bin/bash
OUTDIR=`pwd`
TARDIR=$OUTDIR
if [ -d "$TARDIR" ]; then
#Create directories and move images into them.
mkdir -p $OUTDIR/modem1_image && cp -af $1 $OUTDIR/modem1_image
if echo "$2" | grep -q "modemc2k"; then
mkdir -p $OUTDIR/modem3_image && cp -af $2 $OUTDIR/modem3_image/
mkdir -p $OUTDIR/dsp_bin && cp -af $3 $OUTDIR/dsp_bin/
else
mkdir -p $OUTDIR/dsp_bin && cp -af $2 $OUTDIR/dsp_bin/
fi
fi
set -e
$OUTDIR/tools/make_ext4fs -s -j 1 -l 14M $OUTDIR/modem_sparse.img $OUTDIR/modem1_image 1> /dev/null
$OUTDIR/tools/simg2img $OUTDIR/modem_sparse.img $TARDIR/modem.img
mv $TARDIR/modem.img $1
if echo "$2" | grep -q "modemc2k"; then
$OUTDIR/tools/make_ext4fs -s -j 1 -l 8M $OUTDIR/modemc2k_sparse.img $OUTDIR/modem3_image 1> /dev/null
$OUTDIR/tools/simg2img $OUTDIR/modemc2k_sparse.img $TARDIR/modemc2k.img
mv $TARDIR/modemc2k.img $2
$OUTDIR/tools/make_ext4fs -s -j 1 -l 2M $OUTDIR/dsp_sparse.bin $OUTDIR/dsp_bin 1> /dev/null
$OUTDIR/tools/simg2img $OUTDIR/dsp_sparse.bin $TARDIR/dsp.bin
mv $TARDIR/dsp.bin $3
else
$OUTDIR/tools/make_ext4fs -s -j 1 -l 2M $OUTDIR/dsp_sparse.bin $OUTDIR/dsp_bin 1> /dev/null
$OUTDIR/tools/simg2img $OUTDIR/dsp_sparse.bin $TARDIR/dsp.bin
mv $TARDIR/dsp.bin $2
fi
set +e
rm -rf $OUTDIR/modem1_image $OUTDIR/modem3_image $OUTDIR/dsp_bin
rm -f $OUTDIR/modem_sparse.img $OUTDIR/modemc2k_sparse.img $OUTDIR/dsp_sparse.bin