DroidForums.net is the original Verizon Android Forum! Registered Users do not see these ads. Please Register - It's Free!
Page 1 of 2 12 LastLast
Results 1 to 10 of 18
Like Tree1Likes

Thread: [How to] Build your own Custom ROM!

  1. Droid
    droseum20's Avatar
    Member #
    152319
    Join Date
    Dec 2010
    Posts
    71
    Liked
    1 times
    Twitter
    droseum20
    Phone
    OG Droid, Droid Inc, G-Nexus
    #1

    Cool [How to] Build your own Custom ROM!

    Before we start, just thought I would mention that "$" symbolizes a new line of code. Most of this information can be found on Building the System | Android Open Source

    1) Make sure you have Ubuntu 10.04 installed on your computer.

    2) Download the newest Android SDK for Linux here: http://developer.android.com/sdk/index.html

    3) Extract the insides into /<username>/android/sdk/ (create these directories)

    4) Open up a Terminal. Type:
    Code:
      $ cd android/sdk/tools 
    
      $ ./android
    5) The Android SDK Manager will now pop up, make sure you have platform-tools and Android 4.0.3 checked. Then click Install '#' packages. Make sure to Accept All then select "Install". After a few minutes, it will finish and you can close the window.

    6) Go back into Terminal. Type:
    Code:
     $ cd
    
     $ sudo gedit .bashrc (make sure to give it your password)
    7) A new window will pop-up with words you will not understand. Just make sure to scroll all the way to the bottom on a blank line and enter this: export PATH=${PATH}:~/android/sdk/platform-tools | Save and close the file.

    8) Now, time to install the Java 6 JDK. Open Terminal and type everything as follows:
    Code:
     $ sudo add-apt-repository "deb http://archive.canonical.com/ lucid partner"
    
     $ sudo apt-get update
    
     $ sudo apt-get install sun-java6-jdk
    9) This next code will install a lot of stuff that is critical to building Android. In Terminal copy and paste all of this and then simply hit enter:
    Code:
     $ sudo apt-get install git-core gnupg flex bison gperf build-essential \
    zip curl zlib1g-dev libc6-dev lib32ncurses5-dev ia32-libs \
    x11proto-core-dev libx11-dev lib32readline5-dev lib32z-dev \
    libgl1-mesa-dev g++-multilib mingw32 tofrodos python-markdown \
    libxml2-utils xsltproc
    10) For this next part, we will be configuring USB Access for your Android device. Open Terminal and type:
    Code:
     $ gksu nautilus (enter your password if asked)
    11) This will open up File Browser with root abilities. Find the directory /etc/udev/rules.d/ | Create a new file called 51-android.rules and open it. It will be blank so copy and paste this:

    # adb protocol on passion (Nexus One)
    SUBSYSTEM=="usb", ATTR{idVendor}=="18d1", ATTR{idProduct}=="4e12", MODE="0600", OWNER="<username>"
    # fastboot protocol on passion (Nexus One)
    SUBSYSTEM=="usb", ATTR{idVendor}=="0bb4", ATTR{idProduct}=="0fff", MODE="0600", OWNER="<username>"
    # adb protocol on crespo/crespo4g (Nexus S)
    SUBSYSTEM=="usb", ATTR{idVendor}=="18d1", ATTR{idProduct}=="4e22", MODE="0600", OWNER="<username>"
    # fastboot protocol on crespo/crespo4g (Nexus S)
    SUBSYSTEM=="usb", ATTR{idVendor}=="18d1", ATTR{idProduct}=="4e20", MODE="0600", OWNER="<username>"
    # adb protocol on stingray/wingray (Xoom)
    SUBSYSTEM=="usb", ATTR{idVendor}=="22b8", ATTR{idProduct}=="70a9", MODE="0600", OWNER="<username>"
    # fastboot protocol on stingray/wingray (Xoom)
    SUBSYSTEM=="usb", ATTR{idVendor}=="18d1", ATTR{idProduct}=="708c", MODE="0600", OWNER="<username>"
    # adb protocol on maguro/toro (Galaxy Nexus)
    SUBSYSTEM=="usb", ATTR{idVendor}=="04e8", ATTR{idProduct}=="6860", MODE="0600", OWNER="<username>"
    # fastboot protocol on maguro/toro (Galaxy Nexus)
    SUBSYSTEM=="usb", ATTR{idVendor}=="18d1", ATTR{idProduct}=="4e30", MODE="0600", OWNER="<username>"
    # adb protocol on panda (PandaBoard)
    SUBSYSTEM=="usb", ATTR{idVendor}=="0451", ATTR{idProduct}=="d101", MODE="0600", OWNER="<username>"
    # fastboot protocol on panda (PandaBoard)
    SUBSYSTEM=="usb", ATTR{idVendor}=="0451", ATTR{idProduct}=="d022", MODE="0600", OWNER="<username>"
    12) Still in the file, go to Search --> Replace. In "Search for" enter <username> (yes, include the <>). For "Replace with" enter your computer's username (the one you set up Ubuntu with). Click "Replace All" then save and exit the file.

    13) Open Terminal once again and type:
    Code:
     $ cd
    
     $ mkdir bin
    
     $ sudo gedit .bashrc
    14) In the file that pops up, scroll to the bottom and enter the following on a blank line: export PATH=${PATH}:~/bin | Save and exit the file.

    15) Back in the Terminal window, type:
    Code:
     $ cd bin
    
     $ curl https://dl-ssl.google.com/dl/googlesource/git-repo/repo > ~/bin/repo
    
     $ chmod a+x ~/bin/repo
    16) You just installed the repo command into the bin folder we created recently. Now we need to use that command to access the android source code. Back in the same Terminal window, type:
    Code:
     $ cd ~/android
    
     $ mkdir source
    
     $ cd source
    
     $ repo init -u https://android.googlesource.com/platform/manifest -b android-4.0.3_r1
    17) After running the last command, it should prompt you to type in your name and e-mail address. Please enter in your REAL Gmail's name and e-mail address.

    18) This next step will take possibly anywhere from 1-4 hours depending on your computer. In your Terminal window, type:
    Code:
     $ cd
    
     $ cd android/source
    
     $ repo sync
    19) After the "repo sync" finishes, in the same Terminal window, you will want to verify the Git Tags by typing:
    Code:
     $ gpg --import (nothing will happen, that's okay)
    20) Copy and paste this into Terminal then click CTRL+D to enter:
    -----BEGIN PGP PUBLIC KEY BLOCK-----
    Version: GnuPG v1.4.2.2 (GNU/Linux)

    mQGiBEnnWD4RBACt9/h4v9xnnGDou13y3dvOx6/t43LPPIxeJ8eX9WB+8LLuROSV
    lFhpHawsVAcFlmi7f7jdSRF+OvtZL9ShPKdLfwBJMNkU66/TZmPewS4m782ndtw7
    8tR1cXb197Ob8kOfQB3A9yk2XZ4ei4ZC3i6wVdqHLRxABdncwu 5hOF9KXwCgkxMD
    u4PVgChaAJzTYJ1EG+UYBIUEAJmfearb0qRAN7dEoff0FeXsEa UA6U90sEoVks0Z
    wNj96SA8BL+a1OoEUUfpMhiHyLuQSftxisJxTh+2QclzDviDya TrkANjdYY7p2cq
    /HMdOY7LJlHaqtXmZxXjjtw5Uc2QG8UY8aziU3IE9nTjSwCXeJn uyvoizl9/I1S5
    jU5SA/9WwIps4SC84ielIXiGWEqq6i6/sk4I9q1YemZF2XVVKnmI1F4iCMtNKsR4
    MGSa1gA8s4iQbsKNWPgp7M3a51JCVCu6l/8zTpA+uUGapw4tWCp4o0dpIvDPBEa9
    b/aF/ygcR8mh5hgUfpF9IpXdknOsbKCvM9lSSfRciETykZc4wrRCVGh lIEFuZHJv
    aWQgT3BlbiBTb3VyY2UgUHJvamVjdCA8aW5pdGlhbC1jb250cm lidXRpb25AYW5k
    cm9pZC5jb20+iGAEExECACAFAknnWD4CGwMGCwkIBwMCBBUCCA MEFgIDAQIeAQIX
    gAAKCRDorT+BmrEOeNr+AJ42Xy6tEW7r3KzrJxnRX8mij9z8tg CdFfQYiHpYngkI
    2t09Ed+9Bm4gmEO5Ag0ESedYRBAIAKVW1JcMBWvV/0Bo9WiByJ9WJ5swMN36/vAl
    QN4mWRhfzDOk/Rosdb0csAO/l8Kz0gKQPOfObtyYjvI8JMC3rmi+LIvSUT9806Up
    hisyEmmHv6U8gUb/xHLIanXGxwhYzjgeuAXVCsv+EvoPIHbY4L/KvP5x+oCJIDbk
    C2b1TvVk9PryzmE4BPIQL/NtgR1oLWm/uWR9zRUFtBnE411aMAN3qnAHBBMZzKMX
    LWBGWE0znfRrnczI5p49i2YZJAjyX1P2WzmScK49CV82dzLo71 MnrF6fj+Udtb5+
    OgTg7Cow+8PRaTkJEW5Y2JIZpnRUq0CYxAmHYX79EMKHDSThf/8AAwUIAJPWsB/M
    pK+KMs/s3r6nJrnYLTfdZhtmQXimpoDMJg1zxmL8UfNUKiQZ6esoAWtDg pqt7Y7s
    KZ8laHRARonte394hidZzM5nb6hQvpPjt2OlPRsyqVxw4c/KsjADtAuKW9/d8phb
    N8bTyOJo856qg4oOEzKG9eeF7oaZTYBy33BTL0408sEBxiMior 6b8LrZrAhkqDjA
    vUXRwm/fFKgpsOysxC6xi553CxBUCH2omNV6Ka1LNMwzSp9ILz8jEGqmU tkBszwo
    G1S8fXgE0Lq3cdDM/GJ4QXP/p6LiwNF99faDMTV3+2SAOGvytOX6KjKVzKOSsfJQ
    hN0DlsIw8hqJc0WISQQYEQIACQUCSedYRAIbDAAKCRDorT+Bmr EOeCUOAJ9qmR0l
    EXzeoxcdoafxqf6gZlJZlACgkWF7wi2YLW3Oa+jv2QSTlrx4KL M=
    =Wi5D
    -----END PGP PUBLIC KEY BLOCK-----
    21) Go to Binaries for Nexus Phones and Flagship Devices - Google Support for Nexus Phones and Flagship Devices - Google Code and download the proper Nexus binaries, for Verizon you want to locate "Galaxy Nexus (CDMA/LTE)" and download the Graphics Component. After it finishes, open the imgtech-toro-iml74k.tgz and you will see a .sh file. Copy it and paste it into /android/source/. Do not put it in any other folders.

    22) Locate "extract-imgtec-toro.sh" in the directory just listed and double click it. Select "Run in Terminal". Keep clicking enter until you get to the end of the License. Then type I ACCEPT and enter. You just created a new folder inside of the Android source called "vendor".

    23) In your File Browser window, locate /android/source/device/samsung/toro. In "toro", you should see a file called extract-files.sh. Open this file with gedit. When it opens up, go to Search --> Replace. In "Search for" enter adb pull | In "Replace with" enter ./adb pull | Select "Replace All" then save and exit the file.

    24) Back in the File Browser, locate /android/sdk/platform-tools. You should see a file called "adb". Right click it, select copy, then back into /android/source/device/samsung/toro right click and paste "adb". At this point, you will want to plug in your device and make sure USB Debugging is enabled.

    25) Open a Terminal window and type:
    Code:
    $ cd ~/android/source/device/samsung/toro
    
    $ ./adb devices (it should now show your device is attached)
    
    $ ./extract-files.sh
    26) The last command we just entered extracted files such as CDMA/LTE radios from your phone and stuck them into the source. YOU CAN NOT BE ON A CUSTOM ROM OR THIS WILL NOT WORK. PLEASE BE ON ANDROID 4.0.2 OTA ROOTED (if you are on a custom ROM and don't feel like reverting to stock... please read the second post in this thread explaining a different way to do it)! We are now at the point where we can compile the final product.

    27) In Terminal, type:
    Code:
     $ cd ~/android/source
    
     $ lunch (it will now give you options, find "full_toro-userdebug" and type the number next to it and hit enter)
    
     $ make -j4 otapackage
    28) The last command we just ran can take up to 5 hours, depending on the speed of your computer. If you have a quad-core, I recommend running make -j8 otapackage. It will take less time. After it completes, we will give it root access, and disable the automatic flashing back to stock recovery.

    29) Congratulations! You just compiled your first ROM. Now we must make last minute edits to ensure success. To see your final product, locate /android/source/out/target/product/toro. There should be one .zip file in the directory. Copy and paste it to your Desktop.

    30) We will now add root access. To do so, first go here to download Superuser.apk and the su binary I put together in a zip file: Galaxy Nexus Root by droseum20.zip | After downloading, open up the .zip until you see two folders, app and bin. Open "app" and you will see "Superuser.apk". Then, open your compiled ROM from your desktop. Go to System --> app. copy and paste Superuser.apk from one .zip to the other. Now go to System --> bin in both .zips. Take "su" and drag and drop it into the "bin" folder in your compiled ROM. Now it should have full root access.

    31) When compiling a ROM, it will automatically stick the stock recovery in there and we want to keep ClockworkMod, so we will do as follows. First. you will want to delete the recovery folder that is in your ROM. Next, from your ROM go to /META-INF/com/google/android/ and open updater-script. From here, not only we will delete flashing the OG recovery, we will also add some next text when any users flash our ROM.

    32) Now that you have the updater-script opened, Go to Search --> Search. Type in search for recovery. It will bring you to a line that says, "package_extract_dir("recovery", "/system")". Completely delete this line. If you want to give the users who flash your ROM some nice text while it is in the boring process of flashing, keep reading to 33. If you don't care and just want to finish this long process, skip to 34 (I advise reading 33 though).

    33) Still in the updater-script file, scroll all the way to the top. Make a new, blank, top line. Type ui_print("and then whatever you want. At the end of each line, you must include"); If you are confused, here is an example: ui_print("This is an example"); Now, if you want to make almost a design by using multiple lines, you can do that as well.

    34) After you save and exit the updater-script file, you may move on to this. Here I will show you how to either have Google Apps built into your ROM, or have Google Apps and your ROM flash separately. For this section, I give full credit to @Kejar31, the creator of GummyNex. Download his Google Apps from this ROM thread over at RootzWiki: [ROM][AOSP][4.0.3][CDMA] GummyNex 0.5.0 - 01/10/12 - RootzWiki After downloading, it will come out in a .zip package. Simply drag and drop it to your desktop.

    35) Now, you have Google Apps downloaded, but not baked inside of your ROM. To do this, we will open the GAPPS.zip file. Simply drag and drop the data folder from his GAPPS package into your ROM (not in any folder). Now, drag and drop the signed folder from one to the other. In the GAPPS pacakge, go to System, then app. Copy and paste all of them into the /System/app/ folder in your ROM. Then open the System --> etc from GAPPS and your /System/etc/. Open permissions on both, then copy and paste all the permissions from GAPPS into your ROM. Now copy and paste all the contents from /systesm/framework/ to your ROM. Open, /System/lib/ on both and once again copy and paste the contents from GAPPS into your ROM. Lastly, go to /System/Vendor/ and copy and paste the folder inside vendor (called pitpatt) into /System/vendor/ in your ROM.

    36) Okay, now you are ready to flash the ROM onto your phone to make sure all goes well. Simply transfer the full_toro-ota-eng.<username>.zip onto your phone however you usuaully would. Flash clockworkmod recovery if you already have not, wipe data/factory reset, wipe cache, then dalvik cache, install from zip on sd card, find the ROM and click "Yes" to install. Reboot your phone and make sure everything worked as expected! Run into a problem? Just read the second post or contact me via Google Talk (droseum20@gmail.com).
    cereal killer likes this.
  2.  
     
     
     
  3. Droid
    droseum20's Avatar
    Member #
    152319
    Join Date
    Dec 2010
    Posts
    71
    Liked
    1 times
    Twitter
    droseum20
    Phone
    OG Droid, Droid Inc, G-Nexus
    #2
    THE HELP POST!

    Having trouble with Google Apps? Maybe having duplicates of Gallery, Calender, or something else? Read #1. Superuser permissions not working? Read #2. What's up with the bootanimation? I miss the IceCreamSandwich one! Well, just read #3. On a custom ROM and don't want to revert back to stock? Easy, just read #4!

    #1: So this is rather simple. First, we will open the ROM and delete any multiples. Go to /System/App/ and delete CalendarGoogle.apk and GalleryGoogle.apk. No idea why they are doubled, but it happened to me too. Also, delete Tag.apk and just keep TagGoogle.apk. It is as easy at that.

    #2: Well, my su binary wouldn't work when installing the ROM, what do I do!? Well just download su.zip from here: http://download.clockworkmod.com/test/su.zip and flash it in ClockWorkMod Recovery. That's it.

    #3: If you REALLY REALLY REALLY hate the completely stock Android bootanimation, and want your original Galaxy Nexus animation back, you can do this. Simply take the bootanimation.zip from a ROM with the bootanimation you like and put it in /system/media. That is also where you find the ROM's bootanimation you want to take. Stick it in there and you are done.

    #4: Okay, since this one will be rather long compared to others, it will be formatted different in steps using abc...
    a) So your on step 25, and you don't want to go back to stock. Thanks to @koush, we can fix this.
    b) Open File Browser
    c) Find /android/source/vendor/samsung
    d) Open Terminal and cd to the location listed above
    e) Run "git clone https://github.com/koush/proprietary...e/ics/toro.git toro"
    f) Now, move onto step 26. You are done.

    I will add more help as people get them. For now, these are the only fixes I think you will need.
  4. Theme Developer
    EmericanX's Avatar
    Member #
    238823
    Join Date
    Dec 2011
    Location
    Prince George, VA
    Posts
    260
    Liked
    25 times
    Twitter
    EmericanX
    Phone
    I jump around a lot!!
    DroidForums.net Theme Developer
    #3
    Need some help on root. I'd already compiled from source. No root. Ive tried to flash the su.zip which does flash su and superuser but I still get permission denied. I'm on an insecured boot.img as well... any ideas?

    Oh btw I did compile full toro user debug

    Sent from my Galaxy Nexus using Tapatalk
  5. Droid
    droseum20's Avatar
    Member #
    152319
    Join Date
    Dec 2010
    Posts
    71
    Liked
    1 times
    Twitter
    droseum20
    Phone
    OG Droid, Droid Inc, G-Nexus
    #4
    Quote Originally Posted by EmericanX View Post
    Need some help on root. I'd already compiled from source. No root. Ive tried to flash the su.zip which does flash su and superuser but I still get permission denied. I'm on an insecured boot.img as well... any ideas?

    Oh btw I did compile full toro user debug

    Sent from my Galaxy Nexus using Tapatalk
    Delete Superuser.apk and su from bin. After that, check xbin to see if su is floating around in there. if so, delete it too. Then boot clockworkmod recovery and flash this: Superuser-3.0.7-efgh-signed.zip
  6. Theme Developer
    EmericanX's Avatar
    Member #
    238823
    Join Date
    Dec 2011
    Location
    Prince George, VA
    Posts
    260
    Liked
    25 times
    Twitter
    EmericanX
    Phone
    I jump around a lot!!
    DroidForums.net Theme Developer
    #5
    Failed to flash... error 0 . I'll take another wack at it when I've got my computer with me. I feel like im missing something in my source which is causing the issue... did you have to modify any of the source to gain root? Or just build and drop su and superuser in place?

    Sent from my Galaxy Nexus using Tapatalk
  7. Droid
    droseum20's Avatar
    Member #
    152319
    Join Date
    Dec 2010
    Posts
    71
    Liked
    1 times
    Twitter
    droseum20
    Phone
    OG Droid, Droid Inc, G-Nexus
    #6
    Quote Originally Posted by EmericanX View Post
    Failed to flash... error 0 . I'll take another wack at it when I've got my computer with me. I feel like im missing something in my source which is causing the issue... did you have to modify any of the source to gain root? Or just build and drop su and superuser in place?

    Sent from my Galaxy Nexus using Tapatalk
    I did not modify source, but that may be a good idea. I have a ton of methods I can help you with. Can you contact me on GTalk?
  8. Theme Developer
    EmericanX's Avatar
    Member #
    238823
    Join Date
    Dec 2011
    Location
    Prince George, VA
    Posts
    260
    Liked
    25 times
    Twitter
    EmericanX
    Phone
    I jump around a lot!!
    DroidForums.net Theme Developer
    #7
    Pm sent..

    Sent from my Galaxy Nexus using Tapatalk
  9. Senior Droid
    bmkdroid's Avatar
    Member #
    236611
    Join Date
    Nov 2011
    Location
    Pennsylvania
    Posts
    164
    Liked
    4 times
    Phone
    Galaxy Nexus
    #8
    Just found this, after being nearly done downloading the source. Perfect timing. Thanks a ton for the thread, going to let the downloads finish and work on this tomorrow!
  10. Droid
    droseum20's Avatar
    Member #
    152319
    Join Date
    Dec 2010
    Posts
    71
    Liked
    1 times
    Twitter
    droseum20
    Phone
    OG Droid, Droid Inc, G-Nexus
    #9
    Quote Originally Posted by bmkdroid View Post
    Just found this, after being nearly done downloading the source. Perfect timing. Thanks a ton for the thread, going to let the downloads finish and work on this tomorrow!
    no problem! happy to help.
  11. Senior Droid
    bmkdroid's Avatar
    Member #
    236611
    Join Date
    Nov 2011
    Location
    Pennsylvania
    Posts
    164
    Liked
    4 times
    Phone
    Galaxy Nexus
    #10
    Quote Originally Posted by droseum20 View Post

    #4: Okay, since this one will be rather long compared to others, it will be formatted different in steps using abc...
    a) So your on step 25, and you don't want to go back to stock. Thanks to @koush, we can fix this.
    b) Open File Browser
    c) Find /android/source/vendor/samsung
    d) Open Terminal and cd to the location listed above
    e) Run "git clone https://github.com/koush/proprietary...e/ics/toro.git toro"
    f) Now, move onto step 26. You are done.
    I am working on this step here as my device is already rooted and ROMd and would prefer not to have to go back to stock.

    I am on step E running git clone https://github.com/koush/proprietary...e/ics/toro.git toro and I am receiving the following error:
    Initialized empty Git repository in /home/benkramer/android/vendor/samsung/toro/.git/
    fatal: https://github.com/koush/proprietary....git/info/refs not found: did you run git update-server-info on the server?

    I assume this is an easy fix of cloning a different link, but I am not sure exactly how to find this link. I notice if I follow that link in a browser I see there is a directory named "toro" so I tried https://github.com/koush/proprietary.../toro/toro.git however that did not work either so I think perhaps the directories may have changed?

    Any help would be appreciated, as I do not have much experience using git and am not sure!

    UPDATE 1: Ok, so I ended up noticing at the top of the page when taking that link in a web browser it had the link "https://github.com/koush/proprietary_vendor_samsung.git" so I tried a git clone on that link in a separate folder to test it out. I believe I received within all of that, the toro folder I need. So, I am going to try continuin just copying and pasting that folder to the vendor/samsung where I believe it should be.

    UPDATE 2: That seemed to work just fine doing it the way I did, however, it would probably have been easier to get JUST the toro rather than his entire ICS tree (or whatever it is exactly that I got). Either way, compiled (only took about 1.5hrs on my machine!) and followed the last few steps with SU and GApps and am about to install it on my phone to test. SO EXCITED!
    Last edited by bmkdroid; 01-26-2012 at 02:37 PM.
Page 1 of 2 12 LastLast

Links

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

Similar Threads

  1. Custom build.prop Mashup V5
    By illkasta in forum Droid X2 Development
    Replies: 0
    Last Post: 12-07-2011, 12:18 AM
  2. Replies: 4
    Last Post: 11-04-2011, 07:08 PM
  3. Replies: 311
    Last Post: 06-12-2011, 12:56 PM
  4. Replies: 2
    Last Post: 08-10-2010, 02:36 PM
  5. Could Some One Build Me A Custom Rom?
    By GraphicDemon in forum Android Roms
    Replies: 17
    Last Post: 02-25-2010, 11:04 PM

Search tags for this page

build android rom
,

how to build a custom rom

,
how to build an android rom
,

how to build android rom

,
how to build custom rom
,
how to make a android rom
,

how to make a custom rom

,
how to make a rom
,
how to make an android rom
,
how to make android rom
Click on a term to search our site for related topics.

Tags for this Thread

Find us on Google+