[Nexus 7 (2013) General] fuser-invent:
Fastboot Commands

Click To Show Content for examples of each commands usage, partitions that are excepted by a command and additional info.

Regular fastboot commands

fastboot update

fastboot update update.img

fastboot flashall

fastboot flash

fastboot flash aboot aboot.img ?
fastboot flash bootloader bootloader.img
fastboot flash rpm rpm.img ?
fastboot flash sbl1 sbl1.img ?
fastboot flash sbl2 sbl2.img ?
fastboot flash sbl3 sbl3.img ?
fastboot flash tz tz.img ?
fastboot flash boot boot.img
fastboot flash cache cache.img
fastboot flash recovery recovery.img
fastboot flash system system.img
fastboot flash userdata userdata.img

fastboot erase

fastboot erase all
fastboot erase boot
fastboot erase cache
fastboot erase recovery
fastboot erase system
fastboot erase userdata

fastboot format

fastboot format boot
fastboot format cache
fastboot format recovery
fastboot format system
fastboot format userdata

Example of advanced functions:

fastboot format cache:ext4:0x0000000023000000 cache

(hex value for 587202560 bytes (= 587 MB / 573440 don’t know what this value is but it equals a hex value of 008c000)

fastboot format cache:0x0000000023000000 cache

(skips fs type and uses default)

fastboot getvar

fastboot getvar all
fastboot getvar version-bootloader
fastboot getvar version-baseband
fastboot getvar version-hardware
fastboot getvar ersion-cdma
fastboot getvar variant
fastboot getvar serialno
fastboot getvar product
fastboot getvar secure_boot
fastboot getvar lock_state
fastboot getvar project
fastboot getvar off-mode-charge
fastboot getvar uart-on
fastboot getvar partition-type:<partition name>
fastboot getvar partition-size:<partition name>

fastboot continue

fastboot boot

fastboot boot recovery.img
fastboot boot boot.img
fastboot boot bootloader.img

Example of advanced functions:

fastboot boot <kernel> [ <ramdisk> [ <second> ] ]

Examples of booting the kernel and ramdisk:

fastboot boot zImage boot.img-ramdisk.cpio.gz
fastboot -c *cmdline* boot zImage boot.img-ramdisk.cpio.gz

fastboot flash:raw boot

Same command format as the advanced "fastboot boot" command:

fastboot flash:raw boot <kernel> [ <ramdisk> [ <second> ] ]
fastboot flash:raw boot zImage boot.img-ramdisk.cpio.gz

fastboot devices
fastboot continue
fastboot reboot
fastboot reboot-bootloader
fastboot help

Regular fastboot options that might be useful

-c <cmdline>	override kernel commandline

Add -c followed by a kernel command. If more than one kernel command is in the line then they should have parenthesis around them like this "console=ttyHSL0,115200,n8 androidboot.hardware=flo". This is used for the "fastboot boot" command to boot into a kernel with different commandline parameters. Here are the kernel commandlines listed in /proc/cmdline:

console=ttyHSL0,115200,n8 androidboot.hardware=flo user_debug=31 msm_rtb.filter=0x3F ehci-hcd.park=3 androidboot.emmc=true androidboot.serialno=049973d5 bootreason=PowerKey fuse_info=Y ddr_vendor=hynix androidboot.baseband=apq asustek.hw_rev=rev_e androidboot.bootloader=FLO-04.04

-i <vendor id>	specify a custom USB vendor id

Add -i and then the vendor id you want to use. The Nexus 7 vendor id is 18d1 and Hexidecimal Syntax is 0x18D1. Fastboot wants the Hex value:

-i 0x18D1

-b <base_addr>	specify a custom kernel base address.

I haven't done this in long enough that I've forgotten how to use it. The default is 0x10000000 and the BOARD_KERNEL_BASE is listed as 0x80200000 in the Nexus code.

-n <page size>	specify the nand page size.

The default value is 2048. Add -n and then the value you want to use:

-n 2048

-S <size>[K|M|G]	automatically sparse files greater than size. 0 to disable.

I've never used this. If anyone has any insight, let me know.

fastboot oem commands

I extracted the aboot.img and used Notepad++ to look at the commands. I’m not sure what the variables are for some of them but I’m working on testing some things out. This is how how I figured out “fastboot oem reset-dev_info” would allow “fastboot boot twrp.img” though.

fastboot oem unlock
fastboot oem lock
fastboot oem device-info
fastboot oem memtest_
fastboot oem gpt-info
fastboot oem fuse_blow
fastboot oem check-fuse
fastboot oem reset-dev_info

fastboot oem erase_

Usage is erase_<partition name>. I've only tested it on persist so far. I'm assuming this is for partitions that aren't supported by the regular "fastboot erase" command.

fastboot oem erase_persist

fastboot oem off-mode-charge 1
fastboot oem off-mode charge 0
fastboot oem uart-on
fastboot oem uart-off