[Linux] fastboot 用法学习归纳

本文介绍在Ubuntu系统环境中如何解决从Windows过渡时遇到的问题,重点讲解了使用Fastboot进行设备分区烧录的方法,包括adb及fastboot的安装、设备驱动安装、常见Fastboot命令的使用等。

本文地址:http://blog.youkuaiyun.com/dearsq/article/details/51517552
欢迎转载,转载请注明出处~

最近一冲动就将 windows 系统给全部格式化掉了,完全地换上了 Ubuntu 系统。
不过好在是 windows 轻度用户,加之原来工作也一般是在 Ubuntu 的虚拟机 + 服务器中,所以过渡到 Linux 环境下也并没有多大的不适。

最蛋疼的有三点,
1、OneNote 的缺失;只能用 web 版的,但是编辑起来太不方便了,只能用来查原来记的东西。
2、 Outlook 的缺失; 耗时近一天配置好了雷鸟。
3、Windows 下烧录工具 ResearchDownload 等工具的缺失; 好在找到了两种曲线救国的办法。(或者说这才是正道,那些烧录工具才是 Windows 用户的曲线救国方式)

这两种烧录方法就是 dd 和 fastboot。前者是针对与 sd卡的,后者是针对与 nandflash 的,所以用了几天的 fastboot 正好就将知识点归纳总结一下。

安装 adb

要进入 fastboot 一般是使用 adb reboot bootloader ,所以第一步是安装 adb 工具。
你可以先直接

$adb

或者

$fastboot

查看是否有安装 adb 或者 fastboot
如果没装利用如下指令进行安装

sudo add-apt-repository ppa:nilarimogard/webupd8
sudo apt-get update
sudo apt-get install android-tools-adb android-tools-fastboot

安装设备的驱动

用 usb 连接好设备后

adb devices

发现 device not found
查阅资料后发现可能没有自动识别设备驱动,展讯平台的安卓设备是通过如下方式来实现安装:

su
ls ~/.android/   看是否有 adb_usb.ini 这个文件,如果没有的话
vi adb_usb.ini   创建文件并且输入 0x1782 保存并退出

重启 adb

sudo adb kill-server
sudo adb start-server

接下来用 adb devices 看看设备出来了没有吧,应该就 OK 了。

fastboot 命令详解

安卓设备的分区,每个分区都有对应的 img 文件对应:
splash1 开机动画
recovery 数据恢复区
boot 内核
system 系统区
cache 数据缓存区
userdata 用户数据区

官方手册

直接用 fastboot 命令也可以看到帮助手册,说的非常详细。
update reflash device from update.zip //通过.zip压缩包进行刷机
flashall “flash boot” + “flash system” //烧录kernel 和 system
flash [ ] write a file to a flash partition
erase erase a flash partition
getvar display a bootloader variable //获取 bootloader 可以配置的变量
boot [ ] download and boot kernel
flash:raw boot [ ] 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 specify device serial number
-p specify product name
-c override kernel commandline
-i specify a custom USB vendor id

常用命令

/* 擦除分区 */
fastboot erase {partition} //fastboot erase boot 或 fastboot erase system
/* 烧录分区 */
fastboot flash {partition} //fastboot flash boot boot.img 或 fastboot flash system system.img
/* 烧录所有分区 */
fastboot flashall
/* 一次烧写 boot system recovery 分区 */
zip {name.zip} a.img b.img c.img 
//zip image.zip boot.img system.img recovery.img
fastboot update {*.img} 
//fastboot update image.zip
/* 烧录开机画面 */
fastboot flash splash1 // 开机画面
/* 重启 */
fastboot reboot

另外 bootloader 的烧写:

fastboot flash 2ndbl u-boot.bin //烧写 uboot //针对展讯平台,其他平台暂时不详

本文地址:http://blog.youkuaiyun.com/dearsq/article/details/51517552
欢迎转载,转载请注明出处~

linux ubuntu fastboot 下载 方法1: GSI Flashing Procedure For Android-Q Fresh Launch Build(DP Enabled): Flash META Change directory to Apps path Flash below Apps and GSI image. Apps Build flashing fastboot flash persist persist.img cd secondary-boot fastboot flash boot_a boot.img (boot.img image for CTS-on-GSI, boot-debug.img for VTS testing) fastboot flash dtbo_a dtbo.img fastboot flash recovery_a recovery.img fastboot flash super super.img fastboot flash userdata userdata.img fastboot flash vbmeta_a vbmeta.img fastboot flash vbmeta_system_a vbmeta_system.img GSI Flashing steps: fastboot reboot fastboot fastboot flash system fastboot -w fastboot flashing lock fastboot reboot NOTE: Dynamic Partition mandatory for android-Q Fresh Launch devices. Device should not come out of fastboot mode between Apps flashing and GSI flashing. For Android-Q Upgraded Build or Android-P Builds: Apps and GSI image flashing: fastboot flash userdata userdata.img fastboot flash persist persist.img cd secondary-boot fastboot flash boot_a boot.img fastboot flash dtbo_a dtbo.img fastboot flash vendor_a vendor.img fastboot flash system_a fastboot --disable-verification flash vbmeta_a vbmeta.img fastboot flashing lock fastboot reboot 方法2: 这个版本刷GSI时,oem unlock的操作有更新如下: adb reboot-bootloader fastboot oem sim-allowunlock (允许解锁) fastboot flashing unlock (这里需要按 音量上键 确认) adb reboot-bootloader fastboot flash system system_xxxxxxxxxxx.img fastboot --disable-verification flash vbmeta vbmeta.img fastboot reboot 取消验证,取消AVB验证 fastboot --disable-verification flash vbmeta vbmeta.img 之后就可以通过fastboot烧录boot.img vendor.img system.img 单独烧录。 3.4 AndroidO userdebug版本刷机时禁止dm-verity AndroidO dm-verity disable flag存在于vbmeta.img(keystore分区)中;而老版本是放置在system.img分区的dm-verity metadata中。 1)在设置中打开OEM unlocking选项 2)在设置中打开USB debugging选项 3)adb reboot bootloader 4)fastboot flashing unlock和fastboot oem unlock 5)fastboot --disable-verity --disable-verification flash vbmeta vbmet
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值