comparison 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
comparison
equal deleted inserted replaced
17:632d62e5efb4 18:c8ad6188b9ed
1 #!/bin/sh
2
3 if [ $# != 3 ]
4 then
5 echo "usage: $0 rfbin-dir imei-file output-dir" 1>&2
6 exit 1
7 fi
8
9 set -e
10
11 # Figure out RF bands
12
13 rfbin="$1"
14
15 if [ ! -d "$rfbin/rx" -o ! -d "$rfbin/tx" ]
16 then
17 echo "Error: no RF calibration records in $1" 1>&2
18 exit 1
19 fi
20
21 if [ -f "$rfbin/tx/levels.850" ]
22 then
23 have850=y
24 else
25 have850=n
26 fi
27
28 if [ -f "$rfbin/tx/levels.900" ]
29 then
30 have900=y
31 else
32 have900=n
33 fi
34
35 if [ -f "$rfbin/tx/levels.1800" ]
36 then
37 have1800=y
38 else
39 have1800=n
40 fi
41
42 if [ -f "$rfbin/tx/levels.1900" ]
43 then
44 have1900=y
45 else
46 have1900=n
47 fi
48
49 case $have850$have900$have1800$have1900 in
50 nyyn)
51 rfcap=dual-eu
52 ;;
53 ynny)
54 rfcap=dual-us
55 ;;
56 *)
57 echo "Error: RF files in $1 match neither dual-eu nor dual-us" 1>&2
58 exit 1
59 esac
60
61 # Figure out IMEI and IMEISV
62 # SV digits are set per FreeCalypso convention
63
64 IMEI=`cat "$2"`
65 SV=98
66 IMEISV=`make-imeisv $IMEI $SV`
67
68 # Now create and populate our file system output
69
70 destdir="$3"
71
72 rm -rf "$destdir"
73 mkdir "$destdir"
74
75 # create the same directories as fc-fsio mk-std-dirs
76
77 mkdir "$destdir/gsm"
78 mkdir "$destdir/gsm/com"
79 mkdir "$destdir/pcm"
80 mkdir "$destdir/sys"
81 mkdir "$destdir/mmi"
82 mkdir "$destdir/var"
83 mkdir "$destdir/var/dbg"
84 mkdir "$destdir/etc"
85
86 # populate subtrees
87
88 cp -r "$rfbin" "$destdir/gsm/rf"
89 cp -r /opt/freecalypso/aud-c139 "$destdir/aud"
90
91 # populate individual files
92
93 tiffs-mkfile "$destdir/gsm/com/rfcap" rfcap $rfcap
94 tiffs-mkfile "$destdir/etc/IMEISV" imeisv $IMEISV
95 compile-fc-chg /opt/freecalypso/charging/c1xx/standard "$destdir/etc/charging"