FreeCalypso > hg > fc-am-toolkit
annotate sh/c139-gen-fc-script @ 18:c8ad6188b9ed
add c139-gen-fc-* shell script hierarchy
author | Mychaela Falconia <falcon@freecalypso.org> |
---|---|
date | Sat, 10 Jun 2023 08:16:10 +0000 |
parents | |
children | 2299f1ebbfd2 |
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 |
c8ad6188b9ed
add c139-gen-fc-* shell script hierarchy
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3 if [ $# != 1 ] |
c8ad6188b9ed
add c139-gen-fc-* shell script hierarchy
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
4 then |
c8ad6188b9ed
add c139-gen-fc-* shell script hierarchy
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
5 echo "usage: $0 fwimage.bin" 1>&2 |
c8ad6188b9ed
add c139-gen-fc-* shell script hierarchy
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
6 exit 1 |
c8ad6188b9ed
add c139-gen-fc-* shell script hierarchy
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
7 fi |
c8ad6188b9ed
add c139-gen-fc-* shell script hierarchy
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
8 |
c8ad6188b9ed
add c139-gen-fc-* shell script hierarchy
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
9 if [ ! -f "$1" ] |
c8ad6188b9ed
add c139-gen-fc-* shell script hierarchy
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
10 then |
c8ad6188b9ed
add c139-gen-fc-* shell script hierarchy
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
11 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
|
12 exit 1 |
c8ad6188b9ed
add c139-gen-fc-* shell script hierarchy
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
13 fi |
c8ad6188b9ed
add c139-gen-fc-* shell script hierarchy
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
14 |
c8ad6188b9ed
add c139-gen-fc-* shell script hierarchy
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
15 if [ ! -d rfbin ] |
c8ad6188b9ed
add c139-gen-fc-* shell script hierarchy
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
16 then |
c8ad6188b9ed
add c139-gen-fc-* shell script hierarchy
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
17 echo "Error: rfbin directory is missing" 1>&2 |
c8ad6188b9ed
add c139-gen-fc-* shell script hierarchy
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
18 exit 1 |
c8ad6188b9ed
add c139-gen-fc-* shell script hierarchy
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
19 fi |
c8ad6188b9ed
add c139-gen-fc-* shell script hierarchy
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
20 |
c8ad6188b9ed
add c139-gen-fc-* shell script hierarchy
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
21 if [ ! -f IMEI ] |
c8ad6188b9ed
add c139-gen-fc-* shell script hierarchy
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
22 then |
c8ad6188b9ed
add c139-gen-fc-* shell script hierarchy
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
23 echo "Error: IMEI file is missing" 1>&2 |
c8ad6188b9ed
add c139-gen-fc-* shell script hierarchy
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
24 exit 1 |
c8ad6188b9ed
add c139-gen-fc-* shell script hierarchy
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
25 fi |
c8ad6188b9ed
add c139-gen-fc-* shell script hierarchy
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
26 |
c8ad6188b9ed
add c139-gen-fc-* shell script hierarchy
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
27 set -e |
c8ad6188b9ed
add c139-gen-fc-* shell script hierarchy
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
28 |
c8ad6188b9ed
add c139-gen-fc-* shell script hierarchy
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
29 c139-gen-fc-ffs-img rfbin IMEI |
c8ad6188b9ed
add c139-gen-fc-* shell script hierarchy
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
30 |
c8ad6188b9ed
add c139-gen-fc-* shell script hierarchy
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
31 echo 'flash erase-program-boot /opt/freecalypso/target-bin/compal-flash-boot-for-fc.bin' > fc-flash-script |
c8ad6188b9ed
add c139-gen-fc-* shell script hierarchy
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
32 echo "flash e-program-bin 0x10000 $1" >> fc-flash-script |
c8ad6188b9ed
add c139-gen-fc-* shell script hierarchy
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
33 echo "flash e-program-bin 0x300000 fc-ffs.bin" >> fc-flash-script |
c8ad6188b9ed
add c139-gen-fc-* shell script hierarchy
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
34 |
c8ad6188b9ed
add c139-gen-fc-* shell script hierarchy
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
35 echo 'Generated fc-loadtool command script in fc-flash-script' |