blob: 960be87fc255af5f08b9c729f0d83b2057e8ee8e [file] [log] [blame]
rjw1f884582022-01-06 17:20:42 +08001== fbtool introduction ==
2 fbtool.py is a tool program running at host pc.
3 It will send preloader and lk to platform via usb in order to support fastboot command.
4
5
61 environment preparation
7 1.1 Need to install Python 2.7 or Python 3 (or higher version) firstly
8 1.2 Local pySerial library is preferred.
9 If there is no pySerial folder or fail to import local pySerial,
10 fbtool.py will find pySerial library in the host PC.
11 In this case, please ensure host PC has installed pySerial library (2.6 or higher version):
12 - Download pySerial from https://pypi.python.org/pypi/pyserial . e.g. pyserial-3.2.1.tar.gz
13 Exceptionally, please install *pySerial 3.0.1* (https://pypi.python.org/pypi/pyserial/3.0.1) on Windows XP.
14 - Unzip and execute 'python setup.py install' to install it
15
163 usage
17 fbtool.py [options]
18 Options:
19 -h, --help show this help message and exit
20 -f FILE, --file=FILE read config file, default config file: dl_addr.ini
21 -d, --debug enable debug log
22 -m, --meid get meid
23
24 auth_file: ${PROJECT}/fbtool-da/auth_sv5.auth
25 preloader: ${PROJECT}/fbtool-da/fbtool-da-pl.bin
26 lk: ${PROJECT}/fbtool-da/fbtool-da-lk.bin
27
283.1 usage with normal chip
29 command : command: python fbtool.py (or python fbtool.py -f config.ini)
30
31 Add preloader file path and preloader load address to dl_addr.ini or config.ini "da1_path" key and "da1_addr" key
32 Add preloader load address to dl_addr.ini or config.ini 'da1_addr' key
33 Add lk file path and lk load address to dl_addr.ini or config.ini "da2_path" key and "da2_addr" key
34
35 preloader support the following files:
36 ${PROJECT}/fbtool-da/fbtool-da-pl.bin
37 ${OUT}/.../bin/preloader_${PROJECT}_NO_GFH.bin
38 ${OUT}/.../preloader_${PROJECT}.bin
39 ${OUT}/.../preloader.img
40 We recommend to use pre-built binary fbtool-da-pl.bin in case customer disable the download support of preloader.
41
42 lk support only ${PROJECT}/fbtool-da/fbtool-da-lk.bin
43 fbtool-da-lk.bin is generated by ./tool/gen-dalk-from-lk.py
44 usage: python ./tool/gen-dalk-from-lk.py ${CHIP_ID} ${OUT}/.../lk-no-mtk-header.bin fbtool-da-lk.bin
45
463.2 usage with secure chip (enable DAA)
47 command: python fbtool.py (or python fbtool.py -f config.ini)
48 Add authorization file path to dl_addr.ini or config.ini "auth_path" key
49
50 Generate an auth_file which contains the corresponding public key of private-key.pem (private-key.pem is used to sign preloader)
51 (just like SP Flash tool).
52
53 Sign preloader with ./tool/signfile-for-brom.sh
54 usage: signfile-for-brom.sh private-key.pem fbtool-da-pl.bin
55 private-key.pem is generated from openssl command.
56 run the script and it will output a file : fbtool-da-pl.bin.sign.
57 (fbtool-da-pl.bin is a pre-built preloader_${PROJECT}_NO_GFH.bin.
58 DO NOT use preloader.bin or preloader.img to generate the sign file.)
59
60 With DAA enabled, the fbtool will automatically use *.sign as the signature of pl & lk.
61 Thus, we have to
62 put fbtool-da-pl.bin and fbtool-da-pl.bin.sign in the same folder.
63 put fbtool-da-lk.bin and fbtool-da-lk.bin.sign in the same folder.
64
653.3 usage with secure preloader (enable preloader secure DA verify)
66 Sign lk with ./tool/signfile-for-pl.sh
67
68 usage: signfile-for-pl.sh private-key.pem fbtool-da-lk.bin
69 the private-key.pem is generated from openssl rsa-1024.
70 and the fbtool-da-lk.bin.sign is generated.
71
723.4 usage with single lk
73 command: python fbtool.py (or python fbtool.py -f config.ini)
74 Just add single lk path and load address to dl_addr.ini or config.ini "da1_path" key and "da1_addr" key
75
763.5 send certificate file
77 command: python fbtool.py (or python fbtool.py -f config.ini)
78 Just add certificate file path to dl_addr.ini or config.ini "cert_path" key