annotate sh/c139-gen-fc-ffs-tree @ 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
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
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 [ $# != 3 ]
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 rfbin-dir imei-file output-dir" 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 set -e
c8ad6188b9ed add c139-gen-fc-* shell script hierarchy
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
10
c8ad6188b9ed add c139-gen-fc-* shell script hierarchy
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
11 # Figure out RF bands
c8ad6188b9ed add c139-gen-fc-* shell script hierarchy
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
12
c8ad6188b9ed add c139-gen-fc-* shell script hierarchy
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
13 rfbin="$1"
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/rx" -o ! -d "$rfbin/tx" ]
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: no RF calibration records in $1" 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 "$rfbin/tx/levels.850" ]
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 have850=y
c8ad6188b9ed add c139-gen-fc-* shell script hierarchy
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
24 else
c8ad6188b9ed add c139-gen-fc-* shell script hierarchy
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
25 have850=n
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 "$rfbin/tx/levels.900" ]
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 have900=y
c8ad6188b9ed add c139-gen-fc-* shell script hierarchy
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
31 else
c8ad6188b9ed add c139-gen-fc-* shell script hierarchy
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
32 have900=n
c8ad6188b9ed add c139-gen-fc-* shell script hierarchy
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
33 fi
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 if [ -f "$rfbin/tx/levels.1800" ]
c8ad6188b9ed add c139-gen-fc-* shell script hierarchy
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
36 then
c8ad6188b9ed add c139-gen-fc-* shell script hierarchy
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
37 have1800=y
c8ad6188b9ed add c139-gen-fc-* shell script hierarchy
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
38 else
c8ad6188b9ed add c139-gen-fc-* shell script hierarchy
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
39 have1800=n
c8ad6188b9ed add c139-gen-fc-* shell script hierarchy
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
40 fi
c8ad6188b9ed add c139-gen-fc-* shell script hierarchy
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
41
c8ad6188b9ed add c139-gen-fc-* shell script hierarchy
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
42 if [ -f "$rfbin/tx/levels.1900" ]
c8ad6188b9ed add c139-gen-fc-* shell script hierarchy
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
43 then
c8ad6188b9ed add c139-gen-fc-* shell script hierarchy
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
44 have1900=y
c8ad6188b9ed add c139-gen-fc-* shell script hierarchy
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
45 else
c8ad6188b9ed add c139-gen-fc-* shell script hierarchy
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
46 have1900=n
c8ad6188b9ed add c139-gen-fc-* shell script hierarchy
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
47 fi
c8ad6188b9ed add c139-gen-fc-* shell script hierarchy
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
48
c8ad6188b9ed add c139-gen-fc-* shell script hierarchy
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
49 case $have850$have900$have1800$have1900 in
c8ad6188b9ed add c139-gen-fc-* shell script hierarchy
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
50 nyyn)
c8ad6188b9ed add c139-gen-fc-* shell script hierarchy
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
51 rfcap=dual-eu
c8ad6188b9ed add c139-gen-fc-* shell script hierarchy
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
52 ;;
c8ad6188b9ed add c139-gen-fc-* shell script hierarchy
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
53 ynny)
c8ad6188b9ed add c139-gen-fc-* shell script hierarchy
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
54 rfcap=dual-us
c8ad6188b9ed add c139-gen-fc-* shell script hierarchy
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
55 ;;
c8ad6188b9ed add c139-gen-fc-* shell script hierarchy
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
56 *)
c8ad6188b9ed add c139-gen-fc-* shell script hierarchy
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
57 echo "Error: RF files in $1 match neither dual-eu nor dual-us" 1>&2
c8ad6188b9ed add c139-gen-fc-* shell script hierarchy
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
58 exit 1
c8ad6188b9ed add c139-gen-fc-* shell script hierarchy
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
59 esac
c8ad6188b9ed add c139-gen-fc-* shell script hierarchy
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
60
c8ad6188b9ed add c139-gen-fc-* shell script hierarchy
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
61 # Figure out IMEI and IMEISV
c8ad6188b9ed add c139-gen-fc-* shell script hierarchy
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
62 # SV digits are set per FreeCalypso convention
c8ad6188b9ed add c139-gen-fc-* shell script hierarchy
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
63
c8ad6188b9ed add c139-gen-fc-* shell script hierarchy
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
64 IMEI=`cat "$2"`
c8ad6188b9ed add c139-gen-fc-* shell script hierarchy
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
65 SV=98
c8ad6188b9ed add c139-gen-fc-* shell script hierarchy
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
66 IMEISV=`make-imeisv $IMEI $SV`
c8ad6188b9ed add c139-gen-fc-* shell script hierarchy
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
67
c8ad6188b9ed add c139-gen-fc-* shell script hierarchy
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
68 # Now create and populate our file system output
c8ad6188b9ed add c139-gen-fc-* shell script hierarchy
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
69
c8ad6188b9ed add c139-gen-fc-* shell script hierarchy
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
70 destdir="$3"
c8ad6188b9ed add c139-gen-fc-* shell script hierarchy
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
71
c8ad6188b9ed add c139-gen-fc-* shell script hierarchy
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
72 rm -rf "$destdir"
c8ad6188b9ed add c139-gen-fc-* shell script hierarchy
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
73 mkdir "$destdir"
c8ad6188b9ed add c139-gen-fc-* shell script hierarchy
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
74
c8ad6188b9ed add c139-gen-fc-* shell script hierarchy
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
75 # create the same directories as fc-fsio mk-std-dirs
c8ad6188b9ed add c139-gen-fc-* shell script hierarchy
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
76
c8ad6188b9ed add c139-gen-fc-* shell script hierarchy
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
77 mkdir "$destdir/gsm"
c8ad6188b9ed add c139-gen-fc-* shell script hierarchy
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
78 mkdir "$destdir/gsm/com"
c8ad6188b9ed add c139-gen-fc-* shell script hierarchy
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
79 mkdir "$destdir/pcm"
c8ad6188b9ed add c139-gen-fc-* shell script hierarchy
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
80 mkdir "$destdir/sys"
c8ad6188b9ed add c139-gen-fc-* shell script hierarchy
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
81 mkdir "$destdir/mmi"
c8ad6188b9ed add c139-gen-fc-* shell script hierarchy
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
82 mkdir "$destdir/var"
c8ad6188b9ed add c139-gen-fc-* shell script hierarchy
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
83 mkdir "$destdir/var/dbg"
c8ad6188b9ed add c139-gen-fc-* shell script hierarchy
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
84 mkdir "$destdir/etc"
c8ad6188b9ed add c139-gen-fc-* shell script hierarchy
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
85
c8ad6188b9ed add c139-gen-fc-* shell script hierarchy
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
86 # populate subtrees
c8ad6188b9ed add c139-gen-fc-* shell script hierarchy
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
87
c8ad6188b9ed add c139-gen-fc-* shell script hierarchy
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
88 cp -r "$rfbin" "$destdir/gsm/rf"
c8ad6188b9ed add c139-gen-fc-* shell script hierarchy
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
89 cp -r /opt/freecalypso/aud-c139 "$destdir/aud"
c8ad6188b9ed add c139-gen-fc-* shell script hierarchy
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
90
c8ad6188b9ed add c139-gen-fc-* shell script hierarchy
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
91 # populate individual files
c8ad6188b9ed add c139-gen-fc-* shell script hierarchy
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
92
c8ad6188b9ed add c139-gen-fc-* shell script hierarchy
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
93 tiffs-mkfile "$destdir/gsm/com/rfcap" rfcap $rfcap
c8ad6188b9ed add c139-gen-fc-* shell script hierarchy
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
94 tiffs-mkfile "$destdir/etc/IMEISV" imeisv $IMEISV
c8ad6188b9ed add c139-gen-fc-* shell script hierarchy
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
95 compile-fc-chg /opt/freecalypso/charging/c1xx/standard "$destdir/etc/charging"