Thursday, 29 April 2010

How to create a goldcard with Ubuntu Linux


Updated 1 March 2012, there's now an easier method ->  here!!


1. Download Android SDK from http://developer.android.com/sdk/index.html- Extract it to your home folder

2. Open terminal and type
  •  sudo gedit ~/.bashrc
Add this line to the file, and don't forget to replace the location of the extracted SDK, my path is :/nazriawang/androidsdk/tools/ , yours will be different.
  • export PATH=${PATH}:/nazriawang/androidsdk/tools
close file, open terminal and type
  • sudo cp /nazriawang/androidsdk/tools/adb /usr/bin/adb
3. Type
  • sudo gedit /etc/udev/rules.d/51-android.rules in terminal
Put this line into the file
  • SUBSYSTEM=="usb", SYSFS{idVendor}=="0bb4", MODE="0666"
Vendor ID is as follows:
Acer: 0502 , HTC: 0bb4 , Huawei : 12d1 , LG: 1004 , Motorola: 22b8 , Samsung: 04e8, Sony Ericsson: 0fce

4. Reboot

5. Connect your phone to your pc (with microSD card unmounted) or put microSD card into SD adapter and plug in to your pc.

6. Open terminal and type
  • adb shell
then type
  • cat /sys/class/mmc_host/mmc1/mmc1:*/cid
**update 27 June, try mmc0 or mmc2 instead of mmc1 for some devices like HTC Legend if you get an error.

7. Copy the code and go to this site http://hexrev.soaa.me/
Put your code and click submit
Copy the reversed code

8. Go to http://psas.revskills.de/?q=goldcard and paste the reversed code and click submit.

9. Now we need to write the goldcard.img to the microSD card.
Unmount your SD card
Go to System > Administration > Startup Disk Creator
Take note of the location of your SD card. In my case it's /dev/sdb1

10. Now create the goldcard by typing
  • sudo dd bs=512 if=~/Downloads/goldcard.img of=/dev/sdb1
in the terminal
Remarks : Don't forget to change the path for the SD card and the location of the goldcard.img according to your configurations.

11. Done !

Compiled and simplified for Ubuntu from
Softbank Sucks, TheUnlockr, and Android.com

33 comments:

  1. Whats wrong ... ?


    When I type :
    sudo adb shell

    I get :

    * daemon not running. starting it now *
    * daemon started successfully *
    error: device not found

    ReplyDelete
  2. Try
    adb devices
    If no serial number come out, then you might have not installed the driver correctly. Did you miss any of the steps? especially this one

    3. Type sudo gedit /etc/udev/rules.d/51-android.rules in terminal
    Put this line into the file SUBSYSTEM=="usb", SYSFS{idVendor}=="0bb4", MODE="0666"
    and replace vendor id with your respective android maker's:
    Acer: 0502 , HTC: 0bb4 , Huawei : 12d1 , LG: 1004 , Motorola: 22b8 , Samsung: 04e8, Sony Ericsson: 0fce

    ReplyDelete
  3. I have the same problem as Ozan, it can't find my Desire....
    And like I said it's a desire so I didn't need to change anything in the step 3 addition...

    also I would like to note that in step 2 copy command you need root privileges... thus you need to add sudo... and for me I had to add /home to it

    Also I changed export PATH=${PATH}:/nazriawang/androidsdk/tools to export PATH=${PATH}:/home/vincent/androidsdk/tools

    without anyluck

    So do you know what I might be doing wrong?

    ReplyDelete
  4. When you unzip the android sdk, what is the name of the folder? make sure you got it right because I renamed the folder to "androidsdk". Yours should be different.

    ReplyDelete
  5. Good Call, but I also renamed mine to androidsdk

    any other ideas?

    ReplyDelete
  6. If you follow step 1 to 3 correctly, the only thing I could think of is, try to restart your pc. Because after I did that, it recognizes my Desire. Before it didn't.

    ReplyDelete
  7. No luck, but just a silly question.... doesn't the SD card need to be formated somewhere along the way? I know in the windows guide they want you to do that, or is that not required with ubuntu?

    ReplyDelete
  8. I found the secret!

    You have to put the HTC Desire in Sync mode... then everything works perfectly!

    Now for the last couple of steps

    ReplyDelete
  9. One thing you may need to change. Apparently the goldcard image needs to be written to the device (Physical device, not partition on device) so /dev/sdb1 should be /dev/sdb instead. (And this is also why no formatting needs to be done). After changing this the gold card worked fine for me!

    Thanks

    ReplyDelete
  10. I cannot write the goldard.img on my sd-card. Startup Disk Creator gives an error while trying to write the disk image. Is there any other tool to do that?

    ReplyDelete
  11. @Giarados use the startup disk creator only to recognize the correct name of your sd card. It might be sda or sdb. In my case it's sdb1,

    follow the next step to write the image to the sd card

    ReplyDelete
  12. It didn't work. I did it exactlly like in the tutorial but NO root rights :( I have a G1 with 1.6 Donut DRC92. Could you tell me, what's wrong,plz? thy in advance.

    ReplyDelete
  13. This is not to root the phone, but to create goldcard for rooting which is usually needed by HTC Hero, Desire and the likes. I think goldcard is necessary for G1 as what I can see from theunlockr.

    http://theunlockr.com/2010/04/26/how-to-root-the-htc-g1dream/

    ReplyDelete
  14. Sorry. I meant to say that gold card is not necessary for rooting G1

    ReplyDelete
  15. The 6th step doesnt works for me. It says "error: device not found". What can I do ?

    ReplyDelete
  16. Use your sd card in the phone and select sync mode rather than in an adapter, just worked for me

    ReplyDelete
  17. Nice guide, one little hiccup, rooting my desire now

    ReplyDelete
  18. Hope everything worked out alright for you guys

    ReplyDelete
  19. Is it possible that the dd command should write to the physical sector 0 of the SD card instead of the first sector of the first partition? I mean "sudo dd bs=512 if=~/Downloads/goldcard.img of=/dev/sdb".

    Following your tutorial did not work for me. I tried two different SD card. When I exchanged your step 10 with the matching step from a Windows based tutorial using HxD for writing the SD card everything worked. What HxD actually did was a little obfuscated but I think it wrote to the first physical sector.

    ReplyDelete
  20. what was the command you used?

    ReplyDelete
  21. nevermind I saw you fixed the command I am an idiot that fixed it for me.

    ReplyDelete
  22. I just worked on a HTC Desire that needed a Goldcard. I am now 100% sure that your step 10 is not working but can be fixed by doing this instead:

    sudo dd bs=512 if=~/Downloads/goldcard.img of=/dev/sdb

    It would be great if you could fix your original blog entry so other people so not fall into this trap.

    ReplyDelete
  23. well ive got everything to step 10 and when i enter sudo dd bs=512 if=/Downloads/goldcard.img of=/dev/sdc1 terminal says sudo: permission denied. any suggestions? thanks

    ReplyDelete
  24. well ive got everything to step 10 and when i enter sudo dd bs=512 if=/Downloads/goldcard.img of=/dev/sdc1 terminal says sudo: permission denied. any suggestions? thanks

    ReplyDelete
  25. For those who couldn't make it through step 6: if you have a linux computer you can execute the same "cat" command from a terminal provided you have a card-reader and have inserted your SD-card.
    I had this problem since my HTC Desire was not booting and I had no other way of getting the CID through ADB.

    ReplyDelete
  26. That's what step 9 is for, to determine how your sd card being determined by your system. In my case sdb1 worked just fine, it might be different for you. :D

    ReplyDelete
  27. I tried many times to write the goldcard.img, but get an error every time!
    I used the app Goldcard helper and copied the code directly to create the goldcard.img

    in other tutorials they say to write the img on /dev/sdx (without a number!), which one is correct?

    ReplyDelete
  28. if adb shell doesn't find the device you need to enable USB debugging

    ReplyDelete
  29. Step 2: When I write
    "sudo cp /gustavo/androidsdk/tools/adb/usr/bin/adb"
    I get
    "cp: missing destination file operand after `/gustavo/androidsdk/tools/adb/usr/bin/adb'
    Try `cp --help' for more information.
    "

    ReplyDelete
  30. (Saw my mistake) Step 2: When I write
    "sudo cp /gustavo/androidsdk/tools/adb /usr/bin/adb"I get"cp: cannot stat `/gustavo/androidsdk/tools/adb': No such file or directory"

    ReplyDelete
  31. That simply means, there's no folder called /gustavo/androidsdk

    Notice the first step. Download Android sdk, extract it to your home folder. What does the folder called? I renamed mine to androidsdk. So, if you rename that folder to androidsdk. Things should work out alright. :)

    ReplyDelete