图文版本见论坛:http://bbs.alpha-star.org/d/32/2
3.2.1 必要条件
你需要准备以下6个组件(windows):
- exe(win) / xflash(linux)
- Normal load(Include image files and scatter file etc.)
- Special images and scatter file
- cfg.xml
- exe(win) / fastboot command(linux)
- fastboot command script file
3.2.2 Xflash工具获取路径
路径:\vendor\mediatek\proprietary\system\core\xflash
3.2.3 如何构建镜像
执行如下命令后,系统会自动创建FES文件夹并生成lk.bin,FES文件夹存储了在进入fastboot模式前xflash下载的必要条件。
$ source build/envsetup.sh
$ lunch full_amt6797_64_open-eng
$ make -j16 PLATFORM_FASTBOOT_EMPTY_STORAGE=yes -k 2>&1 | tee build.log
你可以在如下路径中找到FES文件夹。
路径: \out\target\product\amt6797_64_open\FES
3.2.4 烧写
3.2.4.1 准备(Windows)
- exe
\xflash\bin\win\xflash.exe
- Normal load(Include image files and scatter file etc.)
可以随意存放,如:\xflash\bin\win\img
- Special images and scatter file
可以随意存放,如:\xflash\bin\win\FES。如何生成?
请参考 “How to build special images”。
- cfg.xml
\xflash\bin\win\config
- exe
\xflash\bin\win, 必须放在normal load文件夹下。
- fastboot command script file
自己编写,必须放在normal load文件夹下。
如:fastboot 命令脚本文件名为xflash.bat。
fastboot devices
fastboot flash gpt PGPT
****
fastboot flash userdata userdata.img
fastboot reboot
3.2.4.2 烧写(Windows)
步骤1. 使设备进入fastboot模式。
- 准备好指定的镜像和相关scatter文件。
- 命令行运行程序,如:
xflash.exe enter-fastboot “G:\xflash\bin\win\FES\MT6797_Android_scatter.txt”
- 使用USB连接设备。
- Xfalsh将扫描并打开设备的COM端口然后连接,下载镜像文件使设备进入fastboot模式。
步骤2. 运行fastboot命令脚本文件。
- 需要编写一个烧写脚本文件。
如: xflash.bat
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 | fastboot devices fastboot flash gpt PGPT fastboot flash preloader preloader_amt6797_64_open.bin fastboot flash recovery recovery.img fastboot flash scp1 tinysys-scp.bin fastboot flash scp2 tinysys-scp.bin fastboot flash lk lk.bin fastboot flash lk2 lk.bin fastboot flash boot boot.img fastboot flash logo logo.bin fastboot flash tee1 trustzone.bin fastboot flash tee2 trustzone.bin fastboot flash system system.img fastboot flash cache cache.img fastboot flash userdata userdata.img fastboot reboot |
- 运行烧写脚本文件,烧写成功。
3.2.4.3 准备(Linux)
- xflash
\xflash\bin\linux\xflash
- Normal load(Include image files and scatter file etc.)
可以随意存放,如:\xflash\bin\linux\img
- Special images and scatter file
可以随意存放,如:\xflash\bin\linux\FES。如何生成?
请参考 “How to build special images”。
- cfg.xml
\xflash\bin\linux\config
- fastboot
如果系统不支持fastboot命令,请先安装。
- fastboot command script file
自己编写,必须放在normal load文件夹下。
3.2.4.4 烧写(Ubuntu)
步骤 1. 使设备进入fastboot模式。
- 准备好指定的镜像和相关scatter文件。
- 命令行运行程序,如:
sudo ./xflash enter-fastboot “/**/xflash/bin/win/FES/MT6797_Android_scatter.txt”
- 使用USB连接设备。
- Xfalsh将扫描并打开设备的COM端口然后连接,下载镜像文件使设备进入fastboot模式。
步骤2. 运行fastboot命令脚本文件。
- 需要编写一个烧写脚本文件。
如:xflash.sh
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 | #!/bin/bash fastboot devices fastboot flash gpt PGPT fastboot flash preloader preloader_amt6797_64_open.bin fastboot flash recovery recovery.img fastboot flash scp1 tinysys-scp.bin fastboot flash scp2 tinysys-scp.bin fastboot flash lk lk.bin fastboot flash lk2 lk.bin fastboot flash boot boot.img fastboot flash logo logo.bin fastboot flash tee1 trustzone.bin fastboot flash tee2 trustzone.bin fastboot flash system system.img fastboot flash cache cache.img fastboot flash userdata userdata.img fastboot reboot |
- 运行烧写脚本文件,烧写成功。