view sh/c155-gen-fc-script @ 30:2d60f9a3032b default tip

LICENSE: public domain, copied from freecalypso-tools
author Mychaela Falconia <falcon@freecalypso.org>
date Sat, 24 Jun 2023 04:24:38 +0000
parents 9d7d2fdc733b
children
line wrap: on
line source

#!/bin/sh

# This shell script generates the set of files needed for reflashing a Motorola
# C155/156 phone to FreeCalypso: it invokes c155-gen-fc-ffs-img to generate
# fc-ffs.bin (customized FFS image containing IMEI and extracted factory RF
# calibration values specific to your particular phone), and the present script
# then generates a command script for fc-loadtool that flashes everything
# in one go.

if [ $# != 1 ]
then
	echo "usage: $0 fwimage.bin" 1>&2
	exit 1
fi

if [ ! -f "$1" ]
then
	echo "Error: $1 does not exist or is not a regular file" 1>&2
	exit 1
fi

if [ ! -d rfbin ]
then
	echo "Error: rfbin directory is missing" 1>&2
	exit 1
fi

if [ ! -f IMEI ]
then
	echo "Error: IMEI file is missing" 1>&2
	exit 1
fi

set -e

c155-gen-fc-ffs-img rfbin IMEI

echo "flash e-program-bin 0x20000 $1" > fc-flash-script
echo "flash e-program-bin 0x700000 fc-ffs.bin" >> fc-flash-script

echo 'Generated fc-loadtool command script in fc-flash-script'