FreeCalypso > hg > fc-am-toolkit
annotate sh/c155-gen-fc-script @ 25:afd760eb1f8d
doc/C1xx-updates: new article
author | Mychaela Falconia <falcon@freecalypso.org> |
---|---|
date | Sun, 11 Jun 2023 20:57:23 +0000 |
parents | 9d7d2fdc733b |
children |
rev | line source |
---|---|
18
c8ad6188b9ed
add c139-gen-fc-* shell script hierarchy
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1 #!/bin/sh |
c8ad6188b9ed
add c139-gen-fc-* shell script hierarchy
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2 |
19
2299f1ebbfd2
c139-gen-fc-* shell scripts: add explanatory comments
Mychaela Falconia <falcon@freecalypso.org>
parents:
18
diff
changeset
|
3 # This shell script generates the set of files needed for reflashing a Motorola |
21
9d7d2fdc733b
new shell scripts c155-gen-fc-{ffs-img,script}
Mychaela Falconia <falcon@freecalypso.org>
parents:
19
diff
changeset
|
4 # C155/156 phone to FreeCalypso: it invokes c155-gen-fc-ffs-img to generate |
19
2299f1ebbfd2
c139-gen-fc-* shell scripts: add explanatory comments
Mychaela Falconia <falcon@freecalypso.org>
parents:
18
diff
changeset
|
5 # fc-ffs.bin (customized FFS image containing IMEI and extracted factory RF |
2299f1ebbfd2
c139-gen-fc-* shell scripts: add explanatory comments
Mychaela Falconia <falcon@freecalypso.org>
parents:
18
diff
changeset
|
6 # calibration values specific to your particular phone), and the present script |
2299f1ebbfd2
c139-gen-fc-* shell scripts: add explanatory comments
Mychaela Falconia <falcon@freecalypso.org>
parents:
18
diff
changeset
|
7 # then generates a command script for fc-loadtool that flashes everything |
2299f1ebbfd2
c139-gen-fc-* shell scripts: add explanatory comments
Mychaela Falconia <falcon@freecalypso.org>
parents:
18
diff
changeset
|
8 # in one go. |
2299f1ebbfd2
c139-gen-fc-* shell scripts: add explanatory comments
Mychaela Falconia <falcon@freecalypso.org>
parents:
18
diff
changeset
|
9 |
18
c8ad6188b9ed
add c139-gen-fc-* shell script hierarchy
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
10 if [ $# != 1 ] |
c8ad6188b9ed
add c139-gen-fc-* shell script hierarchy
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
11 then |
c8ad6188b9ed
add c139-gen-fc-* shell script hierarchy
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
12 echo "usage: $0 fwimage.bin" 1>&2 |
c8ad6188b9ed
add c139-gen-fc-* shell script hierarchy
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
13 exit 1 |
c8ad6188b9ed
add c139-gen-fc-* shell script hierarchy
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
14 fi |
c8ad6188b9ed
add c139-gen-fc-* shell script hierarchy
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
15 |
c8ad6188b9ed
add c139-gen-fc-* shell script hierarchy
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
16 if [ ! -f "$1" ] |
c8ad6188b9ed
add c139-gen-fc-* shell script hierarchy
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
17 then |
c8ad6188b9ed
add c139-gen-fc-* shell script hierarchy
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
18 echo "Error: $1 does not exist or is not a regular file" 1>&2 |
c8ad6188b9ed
add c139-gen-fc-* shell script hierarchy
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
19 exit 1 |
c8ad6188b9ed
add c139-gen-fc-* shell script hierarchy
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
20 fi |
c8ad6188b9ed
add c139-gen-fc-* shell script hierarchy
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
21 |
c8ad6188b9ed
add c139-gen-fc-* shell script hierarchy
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
22 if [ ! -d rfbin ] |
c8ad6188b9ed
add c139-gen-fc-* shell script hierarchy
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
23 then |
c8ad6188b9ed
add c139-gen-fc-* shell script hierarchy
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
24 echo "Error: rfbin directory is missing" 1>&2 |
c8ad6188b9ed
add c139-gen-fc-* shell script hierarchy
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
25 exit 1 |
c8ad6188b9ed
add c139-gen-fc-* shell script hierarchy
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
26 fi |
c8ad6188b9ed
add c139-gen-fc-* shell script hierarchy
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
27 |
c8ad6188b9ed
add c139-gen-fc-* shell script hierarchy
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
28 if [ ! -f IMEI ] |
c8ad6188b9ed
add c139-gen-fc-* shell script hierarchy
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
29 then |
c8ad6188b9ed
add c139-gen-fc-* shell script hierarchy
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
30 echo "Error: IMEI file is missing" 1>&2 |
c8ad6188b9ed
add c139-gen-fc-* shell script hierarchy
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
31 exit 1 |
c8ad6188b9ed
add c139-gen-fc-* shell script hierarchy
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
32 fi |
c8ad6188b9ed
add c139-gen-fc-* shell script hierarchy
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
33 |
c8ad6188b9ed
add c139-gen-fc-* shell script hierarchy
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
34 set -e |
c8ad6188b9ed
add c139-gen-fc-* shell script hierarchy
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
35 |
21
9d7d2fdc733b
new shell scripts c155-gen-fc-{ffs-img,script}
Mychaela Falconia <falcon@freecalypso.org>
parents:
19
diff
changeset
|
36 c155-gen-fc-ffs-img rfbin IMEI |
18
c8ad6188b9ed
add c139-gen-fc-* shell script hierarchy
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
37 |
21
9d7d2fdc733b
new shell scripts c155-gen-fc-{ffs-img,script}
Mychaela Falconia <falcon@freecalypso.org>
parents:
19
diff
changeset
|
38 echo "flash e-program-bin 0x20000 $1" > fc-flash-script |
9d7d2fdc733b
new shell scripts c155-gen-fc-{ffs-img,script}
Mychaela Falconia <falcon@freecalypso.org>
parents:
19
diff
changeset
|
39 echo "flash e-program-bin 0x700000 fc-ffs.bin" >> fc-flash-script |
18
c8ad6188b9ed
add c139-gen-fc-* shell script hierarchy
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
40 |
c8ad6188b9ed
add c139-gen-fc-* shell script hierarchy
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
41 echo 'Generated fc-loadtool command script in fc-flash-script' |