fastboot 教程
1.参考
http://blog.csdn.net/geniusmen/article/details/7892398
http://www.cnblogs.com/eastnapoleon/p/3270857.html
http://www.omappedia.org/wiki/Android_Fastboot#Updating_system_image_on_NAND
2.fastboot简介
fastboot是Android快速升级的一种方法,fastboot的协议fastboot_protocol.txt在源码目录./bootable/bootloader/legacy下可以找到。
fastboot客户端是作为Android系统编译的一部分,编译后位于./out/host/Linux-x86/bin/fastboot目录下。
fastboot命令实例:sudo fastboot flash kernel path-to-kernel/uImage
烧写rootfs类似:sudo fastboot flash system path-to-system/system.img
3.Android手机分区
每个分区都可以被烧写,并有相应的img文件对应:
- 开机启动画面区(splash1)
- 数据恢复区(recovery)
- 内核区(boot)
- 系统区(system)
- 数据缓存区(cache)
- 用户数据区(userdata)
4.fastboot命令
4.1 查看fastboot命令的帮助
输入fastboot,显示如下信息:
usage: fastboot [ <option> ] <command> commands:
update <filename> reflash device from update.zip
flashall flash boot + recovery + system
flash <partition> [ <filename> ] write a file to a flash partition
erase <partition> erase a flash partition
getvar <variable> display a bootloader variable
boot <kernel> [ <ramdisk> ] download and boot kernel
flash:raw boot <kernel> [ <ramdisk> ] create bootimage and flash it
devices list all connected devices
reboot reboot device normally
reboot-bootloader reboot device into bootloader options:
-w erase userdata and cache
-s <serial number> specify device serial number
-p <product> specify product name
-c <cmdline> override kernel commandline
-i <vendor id> specify a custom USB vendor id
-b <base_addr> specify a custom kernel base address
-n <page size> specify the nand page size. default: 2048
4.2 擦除分区:fastboot erase <partition>
$ sudo fastboot erase boot xx/boot.img
$ sudo fastboot erase system xx/system.img
$ sudo fastboot erase userdata xx/userdata.img
$ sudo fastboot erase cache xx/cache.img
4.3 烧写指定分区:fastboot flash <partition> [*.img]
$ sudo fastboot flash boot path-to-kernel/boot.img
$ sudo fastboot flash zimage path-to-kernel/arch/arm/boot/zImage
$ sudo fastboot flash system path-to-system/system.img
$ sudo fastboot flash splash1 开机画面
4.4 烧写所有分区:fastboot flashall
注意:此命令会在当前目录中查找所有img文件,将这些img文件烧写到所有对应的分区中,并重新启动手机。
$ sudo fastboot flashall
4.5 一次烧写boot,system,recovery分区:fastboot update <*.zip>
创建包含boot.img,system.img,recovery.img文件的update.zip。
$ sudo fastboot update update.zip
4.6 重启手机
$ sudo fastboot reboot
4.7 以指定的img或bin 启动系统,通常用于调试
In addition to flashing the eMMC, Fastboot can also be used to boot from files already flashed to the eMMC. To do, so start Fastboot on the target, and then run a command on the host PC, for example to boot the u-boot:
$ sudo fastboot boot u-boot.bin
4.8 更新eMMC分区
Regions in eMMC are given names. Their offsets and sizes are set in u-boot in the mmc.c file of the board directory that you are using. For example, for the Blaze, this file is u-boot/board/omap4430sdp/mmc.c:
static struct partition partitions[] = {
{ "-", },
{ "xloader", },
{ "bootloader", },
/* "misc" partition is required for recovery */
{ "misc", },
{ "-", },
{ "efs", },
{ "recovery", * },
{ "boot", * },
{ "system", * },
{ "cache", * },
{ "userdata", },
{ , },
};
修改上面的内容,然后执行:
$ sudo fastboot oem format
4.9 退出fastboot
- 拔usb
- ctrl+c
- 超时退出命令
# fastboot 100
或
# fastboot
4.10 获取客户端(手机端)变量信息
$sudo fastboot getvar version:version-bootloader:version-baseband:product:serialno:secure
getvar后和参数用:分开,它们的含义如下:
| version | 客户端支持的fastboot协议版本 |
| version-bootloader | Bootloader的版本号 |
| version-baseband | 基带版本 |
| product | 产品名称 |
| serialno | 产品序列号 |
| secure | 返回yes 表示在刷机时需要获取签名 |
4.11 如何查看fastboot是否成功
fastboot支持环境变量文件,通常在fastboot烧写nand flash时,会将偏移量和大小写入环境变量中,命名格式为:
- <partition name>_nand_offset
- <partition name>_nand_size
例如,内核烧写完成后printenv可以看到:
- kernel_nand_offset=0x140000
- kernel_nand_size=0x1f70000
4.12 u-boot中定义定义的偏移和地址
| name | offset | size | type of file | usual file |
| xloader | 0x00000000 | 0x00080000 | xloader binary | MLO |
| bootloader | 0x00080000 | 0x00180000 | uboot binary | u-boot.bin |
| environment | 0x001C0000 | 0x00040000 | text file | list of variables to set |
| kernel | 0x00200000 | 0x01D00000 | kernel or kernel + ramdisk | uImage, uMulti |
| system | 0x02000000 | 0x0A000000 | yaffs2 | system.img |
| userdata | 0x0C000000 | 0x02000000 | yaffs2 | userdata.img |
| cache | 0x0E000000 | 0x02000000 | yaffs2 | ? |
fastboot重用内核的nand地址分配方式,并且大部分是可以变化的,但是xloader、bootloader 、environment地址是不变的。
4.13 文件大小限制
最大下载文件大小为240M。
fastboot 教程的更多相关文章
- Fastboot的使用简单教程
大家都知道HTC手机重新启动进入所谓的project模式,就是HBOOT,然后能够进入FASTBOOT界面,在这个界面.我们能够在电脑端能够做非常多事,特别是HBOOT被改动过,假设是ENG S-OF ...
- New Moto X 2014 全版本RSD&Fastboot刷官方底包教程
本来我是不想写教程的,因为这样的教程实在是太多了,基本上大家也都会了,为什么还要多次一举,发来发去的呢?实在没什么意义!但是我觉得吧,别人的教程写的都太过简单,太过明了了,有时候我们很难理解,这到底是 ...
- 编译android源码官方教程(5)编译完之后刷机、编译fastboot
Running Builds IN THIS DOCUMENT Building fastboot and adb Booting into fastboot mode Unlocking the b ...
- PyQt5系列教程(五)制作fastboot烧写器
软硬件环境 Windows 7 Python 3.4.2 PyQt 5.5.1 PyCharm 5.0.2 前言 fastboot是针对Android设备的一种刷机方式,它比recovery更底层,刷 ...
- 华为U8810的用户如何获取ROOT权限详细教程
由于在论坛里看到有人在找这个手机的详细的root教程,所以刷机啦小编在这里整理了一下方便新手来操作,其实这个手机root起来还是蛮简单的,只需要一个root软件就可以了,相当于一键root了,在这里整 ...
- HTC One M7简易刷Recovery教程
HTC One M7作为当下HTC旗下的旗舰热门机,用户们对于刷机的需求都比较强烈,对于刷ROM的前提就是要刷入Recovery,当然作为安卓智能手机HTC one而言也不例外,最近有些用 ...
- ADB工具包15秒快速安装器,已集合ADB、FASTBOOT工具箱和最新的驱动程序
http://www.cnroms.com/adb-and-fastboot-toolkit-with-google-usb-drivers.html 通过电脑管理安卓手机需要的三个最常用的工具包集合 ...
- [Android Pro] Android fastboot刷机和获取Root权限
参考文章: https://developers.google.com/android/nexus/images 转载自: http://www.inexus.co/article-1280-1 ...
- 小米2/2S 手机由 Smartisan OS ROM 刷回 MIUI 教程
刷机所需文件1.请前往 MIUI 官网下载小米 2/2S 标准版 MIUI ROM 包.下载地址:http://www.miui.com/getrom.php?r=2:下载后请将原文件名修改为“upd ...
随机推荐
- Node.js Express 获取request原始数据
app.use(bodyParser.json());客户端请求接口时如果指名请求头类型 为Content-Type=application/jsonbodyParser 会自动将 body 里的 j ...
- bzoj3304 [Shoi2005]带限制的最长公共子序列
dp,时间复杂度O(n^3),f[i][j][k]表示a串到i,b串到j的时候,匹配了c串的k位,要用滚动数组 代码 #include<cstring> #include<algor ...
- 1009: 恺撒Caesar密码
1009: 恺撒Caesar密码 时间限制: 10 Sec 内存限制: 128 MB提交: 349 解决: 215[提交][状态][讨论版] 题目描述 Julius Caesar 生活在充满危险和 ...
- CCF真题之相反数
201403-1 问题描述 有 N 个非零且各不相同的整数.请你编一个程序求出它们中有多少对相反数(a 和 -a 为一对相反数). 输入格式 第一行包含一个正整数 N.(1 ≤ N ≤ 500). ...
- angular 自定义指令
Template-expanding directive: <div ng-controller="Controller"> <div my-customer&g ...
- 夺命雷公狗ThinkPHP项目之----企业网站17之网站配置页的添加
为了网站可以智能一点,所以我们开始来写一个网站配置的功能.. 所以我来写他的数据表: 先来完成他的添加功能,页面效果如下所示: lists.html代码如下所示: <!doctype html& ...
- Reporting Service报表项默认可见+号和-号的显示问题
在Reporting Service里面可以设置报表项(组.tablix行.tablix列.文本框等所有SSRS报表项)的可见性,并且可以设置某个报表项的可见性由点击另外一个报表项来控制,比如报表项A ...
- 为该目录以及子目录添加index.html
add index.html to a directory recursively using Perl5 使用的目录,是从Perl下载的perl5.18.2的文档 Look Here #!/usr/ ...
- 23、jQuery九类选择器/jQuery常用Method-API/jQuery常用Event-API
1)掌握jQuery九类选择器及应用 2)掌握jQuery常用Method-API 3)掌握jQuery常用Event-API 一)jQuery九类选择器[参见jQueryAPI.chm手册] 目 ...
- java 面试每日一题4
题目:有1.2.3.4个数字,能组成多少个互不相同且无重复数字的三位数?都是多少? 1.程序分析:可填在百位.十位.个位的数字都是1.2.3.4.组成所有的排列后再去 掉不满足条件的排列. publ ...