blob: 960be87fc255af5f08b9c729f0d83b2057e8ee8e [file] [log] [blame]
== fbtool introduction ==
fbtool.py is a tool program running at host pc.
It will send preloader and lk to platform via usb in order to support fastboot command.
1 environment preparation
1.1 Need to install Python 2.7 or Python 3 (or higher version) firstly
1.2 Local pySerial library is preferred.
If there is no pySerial folder or fail to import local pySerial,
fbtool.py will find pySerial library in the host PC.
In this case, please ensure host PC has installed pySerial library (2.6 or higher version):
- Download pySerial from https://pypi.python.org/pypi/pyserial . e.g. pyserial-3.2.1.tar.gz
Exceptionally, please install *pySerial 3.0.1* (https://pypi.python.org/pypi/pyserial/3.0.1) on Windows XP.
- Unzip and execute 'python setup.py install' to install it
3 usage
fbtool.py [options]
Options:
-h, --help show this help message and exit
-f FILE, --file=FILE read config file, default config file: dl_addr.ini
-d, --debug enable debug log
-m, --meid get meid
auth_file: ${PROJECT}/fbtool-da/auth_sv5.auth
preloader: ${PROJECT}/fbtool-da/fbtool-da-pl.bin
lk: ${PROJECT}/fbtool-da/fbtool-da-lk.bin
3.1 usage with normal chip
command : command: python fbtool.py (or python fbtool.py -f config.ini)
Add preloader file path and preloader load address to dl_addr.ini or config.ini "da1_path" key and "da1_addr" key
Add preloader load address to dl_addr.ini or config.ini 'da1_addr' key
Add lk file path and lk load address to dl_addr.ini or config.ini "da2_path" key and "da2_addr" key
preloader support the following files:
${PROJECT}/fbtool-da/fbtool-da-pl.bin
${OUT}/.../bin/preloader_${PROJECT}_NO_GFH.bin
${OUT}/.../preloader_${PROJECT}.bin
${OUT}/.../preloader.img
We recommend to use pre-built binary fbtool-da-pl.bin in case customer disable the download support of preloader.
lk support only ${PROJECT}/fbtool-da/fbtool-da-lk.bin
fbtool-da-lk.bin is generated by ./tool/gen-dalk-from-lk.py
usage: python ./tool/gen-dalk-from-lk.py ${CHIP_ID} ${OUT}/.../lk-no-mtk-header.bin fbtool-da-lk.bin
3.2 usage with secure chip (enable DAA)
command: python fbtool.py (or python fbtool.py -f config.ini)
Add authorization file path to dl_addr.ini or config.ini "auth_path" key
Generate an auth_file which contains the corresponding public key of private-key.pem (private-key.pem is used to sign preloader)
(just like SP Flash tool).
Sign preloader with ./tool/signfile-for-brom.sh
usage: signfile-for-brom.sh private-key.pem fbtool-da-pl.bin
private-key.pem is generated from openssl command.
run the script and it will output a file : fbtool-da-pl.bin.sign.
(fbtool-da-pl.bin is a pre-built preloader_${PROJECT}_NO_GFH.bin.
DO NOT use preloader.bin or preloader.img to generate the sign file.)
With DAA enabled, the fbtool will automatically use *.sign as the signature of pl & lk.
Thus, we have to
put fbtool-da-pl.bin and fbtool-da-pl.bin.sign in the same folder.
put fbtool-da-lk.bin and fbtool-da-lk.bin.sign in the same folder.
3.3 usage with secure preloader (enable preloader secure DA verify)
Sign lk with ./tool/signfile-for-pl.sh
usage: signfile-for-pl.sh private-key.pem fbtool-da-lk.bin
the private-key.pem is generated from openssl rsa-1024.
and the fbtool-da-lk.bin.sign is generated.
3.4 usage with single lk
command: python fbtool.py (or python fbtool.py -f config.ini)
Just add single lk path and load address to dl_addr.ini or config.ini "da1_path" key and "da1_addr" key
3.5 send certificate file
command: python fbtool.py (or python fbtool.py -f config.ini)
Just add certificate file path to dl_addr.ini or config.ini "cert_path" key