# HG changeset patch # User Mychaela Falconia # Date 1686443290 0 # Node ID 9d7d2fdc733b7e1f55cbcb991b1a67b0801c318c # Parent aa2fd60a44fb47a6fa4c36819d17bbf210d9ecc6 new shell scripts c155-gen-fc-{ffs-img,script} diff -r aa2fd60a44fb -r 9d7d2fdc733b sh/c155-gen-fc-ffs-img --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/sh/c155-gen-fc-ffs-img Sun Jun 11 00:28:10 2023 +0000 @@ -0,0 +1,24 @@ +#!/bin/sh + +# This shell script generates an fc-ffs.bin image specifically for FreeCalypso +# on C155. The difference from C139 version is the bigger FFS geometry on this +# phone model with 8 MiB flash. + +if [ $# != 2 ] +then + echo "usage: $0 rfbin-dir imei-file" 1>&2 + exit 1 +fi + +set -e + +# FIXME: using c139-gen-fc-ffs-tree script to populate the FFS content for +# FC on C155 is OK for now, but we may need a different script in the future. + +c139-gen-fc-ffs-tree "$1" "$2" fc-ffs + +echo 'Generated file system tree in fc-ffs' + +tiffs-mkfs -f /fc-ffs 64x13 fc-ffs fc-ffs.bin + +echo 'Generated FFS image for FC firmware in fc-ffs.bin' diff -r aa2fd60a44fb -r 9d7d2fdc733b sh/c155-gen-fc-script --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/sh/c155-gen-fc-script Sun Jun 11 00:28:10 2023 +0000 @@ -0,0 +1,41 @@ +#!/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'