Author Topic: tutoriel: how using fastboot  (Read 38715 times)

Offline pixiebob

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 47
  • Karma: 7
  • freedom is awesome
    • View Profile
tutoriel: how using fastboot
« on: May 01, 2011, 07:30:17 AM »
i will explain how to use fastboot. fastboot is usefull if you want reflash original rom. if you have bootloop that can't be resolved in recovery( with wipe factory reset cache and reinstall cm no effect too on bootloop) the last remedy is fastboot.
but this tuto is for linux user because i haven't success to install nt-driver on xp or seven(maybe i'm a noob in windows  ;D )

 1) download platform-tools.zip it contain adb and fastboot. it is the simplified package from sdk android:
http://www.megaupload.com/?d=B320DBB2

2) dezip the package and copy adb and fastboot in /usr/bin (need to be root)
cp /path dezipped/adb /usr/bin
cp /path dezipped/fastboot /usr/bin

3)edit or create  if it don't exist : /etc/udev/rules.d/51-android.rules (need to be root)
you insert this line in:
SUBSYSTEMS=="usb", ATTRS{idVendor}=="05c6", ATTRS{idProduct}=="9025", MODE="0666"

give permission:
chmod a+r /etc/udev/rules.d/51-android.rules

4) reboot the pc

5)now plug your zero to see if your pc detect it and type:
adb devices
this command must return the number of the device. if it the case you are right you can continue this tuto.

6)download the original rom and dezip it:
http://www.geeksphone.com/zerohome/ZERO_FINAL_Stock_Rom-zero-AP-20110314.zip

7) now we will enter in fastboot mode on your zero, type:
adb reboot bootloader

the phone will reboot in an empty screen black.don't be surprised it's normal(on htc phone it's a white screen the fastboot mode)

8)to be sure fastboot command work type:
fastboot devices
if it detect the phone it return "? ? ? ? ? ? ? ?"

9)we will erase the contents of the userdata partition and erase the cache partition:
fastboot erase userdata
fastboot erase cache

10)now we will flash the original rom, with the file dezipped ZERO_FINAL_Stock_Rom-zero-AP-20110314.zip:

fastboot flash /path in your pc dezipped zero final stock rom/boot.img
fastboot flash /path in your pc  dezipped zero final stock rom/recovery.img
fastboot flash /path in your pc  dezipped zero final stock rom/system.img

yesterday this last line to flash system.img give me an error but it's not important because with the boot+recovery it's sufficient to reinstall CM7 with the new recovery flashed and that's worked for me and resolve my bootloop problem.

i forget to try this command maybe can working, flash directly the stock rom without dezipped in one command:
fastboot update /path to your/ZERO_FINAL_Stock_Rom-zero-AP-20110314.zip

10)for more information about fastboot you can see:
http://developer.htc.com/adp.html
http://android-dls.com/wiki/index.php?title=Fastboot




« Last Edit: May 01, 2011, 08:29:11 AM by pixiebob »

Offline slok

  • Full Member
  • ***
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 132
  • Karma: 10
    • View Profile
    • My twitter
Re: tutoriel: how using fastboot
« Reply #1 on: May 01, 2011, 10:53:40 AM »
Great tutorial. Thanks!



Offline cmdric

  • Jr. Member
  • **
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 55
  • Karma: 3
    • View Profile
Re: tutoriel: how using fastboot
« Reply #2 on: May 02, 2011, 01:53:10 AM »
Great tutorial, but I've got a problem,
When I use "adb reboot bootloader", my zero shutdown, and then nothing can be done with fastboot .....

bty with this loop probem, it is possible to acces the recovery mode ??? (one the GP one, you can press some button to boot in recovery, is it possible on the zero ?)

thanks

Offline pixiebob

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 47
  • Karma: 7
  • freedom is awesome
    • View Profile
Re: tutoriel: how using fastboot
« Reply #3 on: May 02, 2011, 08:57:05 AM »
cmdric: as i say in the tuto after you type adb reboot bootloader , the phone reboot in an empty black screen.we can thinking that the phone is power off but it's not the case you are in the fastboot mode.that's why i say to be not surprised.
if i understand adb can detect your devices but not fastboot?
try again because my first try was same like you and second try fastboot detect my devices.

you can try another way:
dezip my simplified package and place you in this file:
cd /path to your dezip/platform-tools
./fastboot devices(if not working try again this command in root but it's preferable to do this without be root, because operation you do in root can change permission of the file you use)

is it working for you? what return you the command fastboot devices ?

edit: if any of the solution i propose don't work for you , try to install completely the sdk android(don't forget to erase adb and fastboot locate in your pc /usr/bin with the command rm in root), you will need to copy/paste fastboot in the folder platform-tool of the sdk you installed.

edit2: you ask me if you can access to the recovery.i respond that if your recovery are not broken you can yes access to the recovery.for me even with bootloop issue i was able to reboot in the recovery mode with adb:
adb reboot recovery

if your recovery is broken, normally fastboot mode is always reachable and you can reflash the recovery like i mention in the tuto
« Last Edit: May 02, 2011, 02:26:42 PM by pixiebob »

Offline cmdric

  • Jr. Member
  • **
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 55
  • Karma: 3
    • View Profile
Re: tutoriel: how using fastboot
« Reply #4 on: May 02, 2011, 12:32:19 PM »
Thanks for the answer

I'll try it when i find some time.
I've managed to boot in the recovery mode.

adb reboot recovery

Then I've restored an old installation.

Ill try to comment if i'm back in the loop. But now it boots well. I'm typing from my zero. 

Thanks

Offline Slayra

  • Jr. Member
  • **
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 77
  • Karma: 17
    • View Profile
Re: tutoriel: how using fastboot
« Reply #5 on: May 04, 2011, 11:10:20 AM »
Well, I followed your tutorial just to learn how to use fastboot but I run into some problems and I thought I should share my workarounds:

3)edit or create  if it don't exist : /etc/udev/rules.d/51-android.rules (need to be root)
you insert this line in:
SUBSYSTEMS=="usb", ATTRS{idVendor}=="05c6", ATTRS{idProduct}=="9025", MODE="0666"

give permission:
chmod a+r /etc/udev/rules.d/51-android.rules

4) reboot the pc

In step 3, I had to change "05c6" with "18d1" and "9025" with "d00d"
I believe it's due to the phone in fastboot being recognized as a Google (18d1) Android (d00d) product.

Anyway, one can find this information using "dmesg" or "lsusb" commands under linux after the phone entered fastboot.
My dmesg output looked as follows:

usb 1-5: new high speed USB device using ehci_hcd and address 16
usb 1-5: New USB device found, idVendor=18d1, idProduct=d00d
usb 1-5: New USB device strings: Mfr=1, Product=2, SerialNumber=0
usb 1-5: Product: Android
usb 1-5: Manufacturer: Google

I guess this was the problem cmdric had not being able to use fastboot ;)


In step 4, all I did was to restart udev; Using slackware it's something like:
/etc/rc.d/rc.udev force-restart

9)we will erase the contents of the userdata partition and erase the cache partition:
fastboot erase userdata
fastboot erase cache

10)now we will flash the original rom, with the file dezipped ZERO_FINAL_Stock_Rom-zero-AP-20110314.zip:

fastboot flash /path in your pc dezipped zero final stock rom/boot.img
fastboot flash /path in your pc  dezipped zero final stock rom/recovery.img
fastboot flash /path in your pc  dezipped zero final stock rom/system.img

yesterday this last line to flash system.img give me an error but it's not important because with the boot+recovery it's sufficient to reinstall CM7 with the new recovery flashed and that's worked for me and resolve my bootloop problem.

Then in step 9, one can simply type:
fastboot -w

(which will erase cache and userdata)

In step 10, I believe you're missing one thing (at least I had to use it):

fastboot flash boot /path_to_rom/boot.img
fastboot flash recovery /path_to_rom/recovery.img
fastboot flash system /path_to_rom/system.img


In the end, I rebooted using:
fastboot reboot

The rest was all like you wrote and thanks for doing so.

Offline cmdric

  • Jr. Member
  • **
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 55
  • Karma: 3
    • View Profile
Re: tutoriel: how using fastboot
« Reply #6 on: May 05, 2011, 12:01:49 AM »
thanks Slayra.

ok, in my case.... I dont know it's wierd.
The 05c6 and 9025 were right my lsusb gave me this numbers:

Bus 002 Device 012: ID 05c6:9025 Qualcomm, Inc.

and the the adb devives gave me:
List of devices attached
ZBR3301799022   device

and it doesn't recognized any devices if I put your numbers...

but the when I apply the "adb reboot bootloader"

the fastboot commands do not react:

fastboot devices -> nothing.

I've rechanged the rules to your number now. and and and... magic.... it works with fastboot !!!

306 [cmdric ~] fastboot devices
????????????   fastboot
307 [cmdric ~] fastboot -w
erasing 'userdata'... OKAY
erasing 'cache'... OKAY
308 [cmdric ~] fastboot flash boot Downloads/AP-20110314/boot.img
sending 'boot' (3294 KB)... OKAY
writing 'boot'... OKAY
309 [cmdric ~] fastboot flash recovery Downloads/AP-20110314/recovery.img
sending 'recovery' (4166 KB)... OKAY
writing 'recovery'... OKAY
310 [cmdric ~] fastboot flash system Downloads/AP-20110314/system.img   
sending 'system' (114635 KB)... OKAY
writing 'system'... OKAY
311 [cmdric ~]     


.... no comment but thanks a lot !!!


Offline Slayra

  • Jr. Member
  • **
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 77
  • Karma: 17
    • View Profile
Re: tutoriel: how using fastboot
« Reply #7 on: May 05, 2011, 06:26:26 AM »

Hey cmdric, I'm gald you managed to sort things out!
But I believe I didn't explain myself right regarding the use of lsusb ou dmesg and I'll try to make it clearer:

If you have your phone running normally and if you connect it to the computer, the lsusb will look like this:

Bus 001 Device 003: ID 05c6:9025 Qualcomm, Inc.

That is correct indeed. The thing is, when the phone enters fastboot mode, it will be recognised differently.
Here's the lsusb in fastboot mode:

Bus 001 Device 004: ID 18d1:d00d Google Inc.

And that's why we have to change the udev rule for the ID/Vendor of Google Inc.

Hope I made things a bit more clear ;)

Offline EowynCarter

  • Full Member
  • ***
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 226
  • Karma: 5
    • View Profile
Re: tutoriel: how using fastboot
« Reply #8 on: May 21, 2011, 04:59:46 AM »
Oh, that was EXACTLY the topic I needed  :D

I was unsure where to find a zero compatible version of fastboot for linux.

Offline WerN1211

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 24
  • Karma: 1
    • View Profile
Re: tutoriel: how using fastboot
« Reply #9 on: May 28, 2011, 07:30:43 AM »
 >:(

I am fighting with Ubuntu for hours now.  fastboot does not want to work !
everything seems to be installed and copied where it should (JDK, Android SDK, plateform-tools, ...)

sending "adb devices" finally returns my phone ID 'ZBR..." !

fastboot devices returns nothing at all and thus fastboot reboot-bootloader returns "waiting device" for ages.

I am a Windows usr but no usb driver seems to be good enough to use adb and fastboot under Win7.
That's why I turned to Ubuntu (Live) ran from a memory stick (now with the casper-rw persistent-thingy).
I am a fast learner, but I am definitely stuck here.  Googling solutions since 7 a.m. (my kids hate me).    :(

Help ?

Offline dobrov78

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 43
  • Karma: 0
    • View Profile
Re: tutoriel: how using fastboot
« Reply #10 on: May 29, 2011, 02:19:35 PM »
I'm in a big problem, i'm unable to make it work on seven, ubuntu and xp...
Is there any french people living near Paris?
the zero is out of order after a flash of the asop rom...

Offline Slayra

  • Jr. Member
  • **
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 77
  • Karma: 17
    • View Profile
Re: tutoriel: how using fastboot
« Reply #11 on: May 29, 2011, 03:01:57 PM »

@WerN1211
Well I'm not using ubuntu, but I believe the steps mentioned above should work.
Perhaps this is a stupid question but  are you starting your phone in fastboot mode?
If adb is working, I can't see why fastboot wouldn't work too...

@dobrov78
Can't help you with that... Sorry!

Offline dobrov78

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 43
  • Karma: 0
    • View Profile
Re: tutoriel: how using fastboot
« Reply #12 on: May 30, 2011, 12:57:37 AM »
ok cool!if someone needs help using windows xp, just Pm me ;D

Offline schweig

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 26
  • Karma: 2
    • View Profile
Re: tutoriel: how using fastboot
« Reply #13 on: May 30, 2011, 11:35:28 AM »
>:(

I am fighting with Ubuntu for hours now.  fastboot does not want to work !
everything seems to be installed and copied where it should (JDK, Android SDK, plateform-tools, ...)

sending "adb devices" finally returns my phone ID 'ZBR..." !

fastboot devices returns nothing at all and thus fastboot reboot-bootloader returns "waiting device" for ages.

I am a Windows usr but no usb driver seems to be good enough to use adb and fastboot under Win7.
That's why I turned to Ubuntu (Live) ran from a memory stick (now with the casper-rw persistent-thingy).
I am a fast learner, but I am definitely stuck here.  Googling solutions since 7 a.m. (my kids hate me).    :(

Help ?

try for udev:

BUS=="usb", ATTRS{idVendor}=="18d1", ATTRS{idProduct}=="d00d", GROUP="plugdev", MODE="0660"


worked for me and i had the waiting for device problem



Offline WerN1211

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 24
  • Karma: 1
    • View Profile
Re: tutoriel: how using fastboot
« Reply #14 on: May 30, 2011, 01:05:10 PM »
@Slayra
Do you mean that I missed the part where it says : "now we will enter in fastboot mode on your zero, type:
adb reboot bootloader" ?
 :-[ :-[ :-[
I am so confused!
Sending "fastboot devices" now returns "? ? ? ? ? ? ? ? ?"
Thanks a million.
« Last Edit: May 30, 2011, 01:09:04 PM by WerN1211 »