[Build Guide][Flo/Deb] - Pure AOSP 6.0.0_r1

Search This thread

vibranze

Inactive Recognized Developer
Feb 22, 2007
1,377
84
Singapore
vibranze.blogspot.com
Did you get it built?

Hey Scott,
I think so.
Creating filesystem with parameters:
Size: 880803840
Block size: 4096
Blocks per group: 32768
Inodes per group: 7680
Inode size: 256
Journal blocks: 3360
Label:
Blocks: 215040
Block groups: 7
Reserved block group size: 55
Created filesystem with 1274/53760 inodes and 62894/215040 blocks
+ '[' 0 -ne 0 ']'
Install system fs image: out/target/product/flo/system.img
out/target/product/flo/system.img+out/target/product/flo/obj/PACKAGING/recovery_patch_intermediates/recovery_from_boot.p maxsize=899137536 blocksize=135168 total=245563542 reserve=9191424

But I don't know what's next? The instruction from android page is to flash the device directly but mine is a VM so I don't think it's applicable. How do I create the .zip file from the build and how do I make customization?

Appreciated your advise. Thanks.

:cowboy:
 
Z

Zpik

Guest
Please add hybrid to this, a pure hybrid version would be awesome! And a first!
 

Scott

Retired Recognized Developer
Hey Scott,
I think so.


But I don't know what's next? The instruction from android page is to flash the device directly but mine is a VM so I don't think it's applicable. How do I create the .zip file from the build and how do I make customization?

Appreciated your advise. Thanks.

:cowboy:

Looks like it created "a" file system but if you want to make flashable zip you have to use this command....


make -j(your number here) otapackage

Im building on a 8 core Xeon so I run 3 threads per core for maximum efficency..

so my build command is this...

make -j24 otapackage

That will get me full signed zip from a clean workspace in about 30 minutes.

And the name of my zip is something like "aosp.flo.eng.debug.scott.zip"

So if you just "make" with no directive after you select the build you will get .img files, such as boot.img, system.img, etc. You can than fastboot flash those img files.

But obviously a .zip is better 99.99% of the time.
 
  • Like
Reactions: vibranze

vibranze

Inactive Recognized Developer
Feb 22, 2007
1,377
84
Singapore
vibranze.blogspot.com
Looks like it created "a" file system but if you want to make flashable zip you have to use this command....


make -j(your number here) otapackage

Im building on a 8 core Xeon so I run 3 threads per core for maximum efficency..

so my build command is this...

make -j24 otapackage

That will get me full signed zip from a clean workspace in about 30 minutes.

And the name of my zip is something like "aosp.flo.eng.debug.scott.zip"

So if you just "make" with no directive after you select the build you will get .img files, such as boot.img, system.img, etc. You can than fastboot flash those img files.

But obviously a .zip is better 99.99% of the time.

Thanks!
Do you know if I want to make changes to build.prop or some other optimizations, where should I do it?
In the meantime, I will do more research on this but if you already knew about it, kindly share. :)

Cheers.
:cowboy:
 

Scott

Retired Recognized Developer
Thanks!
Do you know if I want to make changes to build.prop or some other optimizations, where should I do it?
In the meantime, I will do more research on this but if you already knew about it, kindly share. :)

Cheers.
:cowboy:

Thats what I am researching myself. I know how to edit the apps and all.

But the default props I am not sure :eek:
 

Scott

Retired Recognized Developer
Thanks Scott.
Btw, make otapackage failed with no target error. I read somewhere that you have to include recover inside, I'm figuring out now how the whole things works. :)
Cheers.

Works for me. Just synced and building for tonights build.

I see that they did "something" to the keymaster stuff so I am hoping they realized it was missing... and added it, lol
 

meekrawb

Senior Member
Mar 25, 2012
1,472
1,031
TX
I see that they did "something" to the keymaster stuff so I am hoping they realized it was missing... and added it, lol

I added the keymaster stuff from your zip to my build folder and did a make clobber, but my build still FC's the security setting.

Edit: NM, I guess it wasn't meant to work that way.
 
Last edited:

Scott

Retired Recognized Developer
What I'm finding so interesting about this thread is how you guys go about stepping through the issues you encounter as part of build troubleshooting.

As a ROM consumer, it gives me a much greater appreciation about how much dedication goes into crafting something that is even flashable, let alone feature rich.
Indeed!

A lot of people take for granted the complexities that can be had when working with ROMS. They just see ROMS, download, flash, go to next ROM and not even realize the time and effort that goes into just a single ROM and or Mod for that ROM.


Thanks for seeing this!

Edit: NM, I guess it wasn't meant to work that way.

No, there has to be some sort of "vendor" binaries we can download but I am not sure which vendor to look for. I am going to ask around this weekend.

I need a break...
 

TheDarkDefender

Senior Member
Aug 5, 2012
4,092
6,434
33
Reston, VA
Indeed!

A lot of people take for granted the complexities that can be had when working with ROMS. They just see ROMS, download, flash, go to next ROM and not even realize the time and effort that goes into just a single ROM and or Mod for that ROM.


Thanks for seeing this!



No, there has to be some sort of "vendor" binaries we can download but I am not sure which vendor to look for. I am going to ask around this weekend.

I need a break...

These are the binaries

https://developers.google.com/android/nexus/drivers

Sent from my Nexus 4
 
  • Like
Reactions: meekrawb

Scott

Retired Recognized Developer
Yes, I pointed that out on the first page... When intially asked by someone to not forget the binaries... See more below...

I have all of those binaries on my github. It looks like there is something else missing...

Exactly. I dont know what is missing. When I google keymaster nexus7 2013 this is the thread that pops up first...

Second thread is showing a change in keymaster to 4.3.1 but 4.3.1 doesnt compile for Flo, only Deb (I tried last night and 2 nights ago when I initially repoirted that I had seen 4.3.1_R1). I also see that there is an OTA for Deb that is 4.3.1! So maybe we will have 4.3.1 soon.

Maybe google made a mistake because prior to 4.3.0_R2.2 there was not reported ittus. I think they changed "something" in 4.3.0_r3 which is JSS36G.

4.3.1 = JSSL36I??? See LTE forums for info.
 
  • Like
Reactions: meekrawb

meekrawb

Senior Member
Mar 25, 2012
1,472
1,031
TX
Yes, I pointed that out on the first page... When intially asked by someone to not forget the binaries... See more below...



Exactly. I dont know what is missing. When I google keymaster nexus7 2013 this is the thread that pops up first...

Second thread is showing a change in keymaster to 4.3.1 but 4.3.1 doesnt compile for Flo, only Deb (I tried last night and 2 nights ago when I initially repoirted that I had seen 4.3.1_R1). I also see that there is an OTA for Deb that is 4.3.1! So maybe we will have 4.3.1 soon.

Maybe google made a mistake because prior to 4.3.0_R2.2 there was not reported ittus. I think they changed "something" in 4.3.0_r3 which is JSS36G.

4.3.1 = JSSL36I??? See LTE forums for info.

Last night I used
repo init -u https://android.googlesource.com/platform/manifest -b android-4.3.1_r1
put all the proprietary blobs in vendor and it built 4.3.1. Only problem I noticed was the security setting FC.
I have built Slim and CM successfully but this is my first attempt at pure AOSP.
 

Scott

Retired Recognized Developer


I gave the exact same command and it refused to pull it. I wonder if the time of day matters :eek:

But still F/C with keymaster... Interesting...


In the Nexus 4 the keymaster files are in the /vendor partition. I checked ours and no such files exist. Which is what originally prompted me to pull them from /system/vendor.



Now that I think about it I probably did android_4.3.1_r1 instead of android 4.3.1_r1!





I would try it tonight but i had to pull the SSD out of my build box to replace a drive in my laptop. New drive is here today but I wont have time to install and sync again until this weekend.
 
  • Like
Reactions: TheDarkDefender

vibranze

Inactive Recognized Developer
Feb 22, 2007
1,377
84
Singapore
vibranze.blogspot.com
Finally I managed to compile it successfully. :)

using device-specific extensions in device/asus/flo
building image from target_files BOOT...
running: mkbootfs -f /tmp/targetfiles-QSqkWw/META/boot_filesystem_config.txt /tmp/targetfiles-QSqkWw/BOOT/RAMDISK
running: minigzip
running: mkbootimg --kernel /tmp/targetfiles-QSqkWw/BOOT/kernel --cmdline console=ttyHSL0,115200,n8 androidboot.hardware=flo user_debug=31 msm_rtb.filter=0x3F ehci-hcd.park=3 --base 0x80200000 --pagesize 2048 --ramdisk_offset 0x02000000 --ramdisk /tmp/tmparRa4C - -output /tmp/tmpRuaV3n
building image from target_files RECOVERY...
running: mkbootfs -f /tmp/targetfiles-QSqkWw/META/recovery_filesystem_config.txt /tmp/targetfiles-QSqkWw/RECOVERY/RAMDISK
running: minigzip
running: mkbootimg --kernel /tmp/targetfiles-QSqkWw/RECOVERY/kernel --cmdline console=ttyHSL0,115200,n8 androidboot.hardware=flo user_debug=31 msm_rtb.filter=0x3F ehci-hcd.park=3 --base 0x80200000 --pagesize 2048 --ramdisk_offset 0x02000000 --ramdisk /tmp/tmpJHyM kS --output /tmp/tmpYdNju0
running: imgdiff -b /tmp/targetfiles-QSqkWw/SYSTEM/etc/recovery-resource.dat /tmp/tmpi76Kvp /tmp/tmpfzFCgb /tmp/tmppxFIpG
boot size (7049216) is 30.56% of limit (23068672)
no bootloader.img in target_files; skipping install
no radio.img in target_files; skipping install
no DDR.bin in target_files; skipping install
running: openssl pkcs8 -in build/target/product/security/testkey.pk8 -inform DER -nocrypt
running: java -Xmx2048m -jar out/host/linux-x86/framework/signapk.jar -w build/target/product/security/testkey.x509.pem build/target/product/security/testkey.pk8 /tmp/tmpABT9L_ out/target/product/flo/aosp_flo-ota-eng.vibranze.zip
done.

And I have a 'aosp_flo-ota-eng.vibranze.zip' file in my out folder.

Next question is can I flash this directly to my Nexus as usual? Regarding the keymaster F/C, is this happen after you flashed the ROM?

Will update here again later.

Cheers.
 

vibranze

Inactive Recognized Developer
Feb 22, 2007
1,377
84
Singapore
vibranze.blogspot.com
I gave the exact same command and it refused to pull it. I wonder if the time of day matters :eek:

But still F/C with keymaster... Interesting...


In the Nexus 4 the keymaster files are in the /vendor partition. I checked ours and no such files exist. Which is what originally prompted me to pull them from /system/vendor.



Now that I think about it I probably did android_4.3.1_r1 instead of android 4.3.1_r1!





I would try it tonight but i had to pull the SSD out of my build box to replace a drive in my laptop. New drive is here today but I wont have time to install and sync again until this weekend.

I'm using 'repo init -u https://android.googlesource.com/a/platform/manifest -b android-4.3.1_r1'.

Hope this help.

Cheers.
 

vibranze

Inactive Recognized Developer
Feb 22, 2007
1,377
84
Singapore
vibranze.blogspot.com
Quick Summary

Here is the summary of the whole process, hope it helps who want to build their own ROM instead of keep flashing other people ROM.

1. Install Ubuntu - in this case I'm using 13.04 but I believe any earlier version will do with some adjustment
2. Install OpenSSH server - I installed Ubuntu as a Virtual Machine and I prefer to use Putty (SSH client) to work instead of working directly within the console.
Code:
sudo apt-get install openssh-server
3. Ubuntu repo update
Code:
sudo apt-get update
4. Dist upgrade
Code:
sudo apt-get dist-upgrade
5. Reboot and connect via Putty
6. Follow the guide from - http://xdaforums.com/showthread.php?t=2224142 up to source code folder creation.
7. For the Android repo address, I used
Code:
curl http://commondatastorage.googleapis.com/git-repo-downloads/repo
instead of the one from the guide because I kept having an 'Failed with could not verify the tag 'v1.12.4' error if I used that.
8. After the source code folder is created, configure the git username and email.
Code:
git config --global user.email "your@emailaddress.com"
git config --global user.name "your name"
9. Create a .netsh file which contains a password from password generator - https://android.googlesource.com/new-password
10. First time repo initialization
Code:
repo init -u https://android.googlesource.com/a/platform/manifest -b android-4.3.1_r1
11. Tweak TCP/IP stack, this is optional.
Code:
sudo sysctl -w net.ipv4.tcp_window_scaling=0
12. Repo sync
Code:
repo sync -jXX
The value of the XX is depend on how many CPU socket and core you have, adjust accordingly.
13. Initialize the build environment
Code:
. build/envsetup.sh
14. Choose a host target to use with lunch, I'm using aosp_flo-userdebug, not sure if this is correct or not
Code:
lunch aosp_flo-userdebug
15. Last step is code compilation
Code:
make -jXX otapackage
This is briefly the process I went through and there are some other areas that I have not explore yet, e.g. setting up the local mirror, ccache which is good to have to speed up the build time.

I will share more once my hand is getting dirtier. :laugh:

:cowboy:
 
Last edited:

Top Liked Posts

  • There are no posts matching your filters.
  • 411
    This is a PURE AOSP ROM build guide. I have opted not to post an actual AOSP ROM based on 6.0.0 due to the fact I just dont care for it much. The instructions are up to date as of 10/21/2015



    Deprecated-> This thread is about learning to build your own ROM following the instructions in post #2. The ROM posted in this thread is for example output. Feel free to download and use the ROMS @GROGG88 and I build! Feel free to try and build your own. We will try to help!

    Quick Change Log
    • 10/21 - Updated guide to reflect Android version 6.0.0_r1. No ROM for download (at this time).
    • 1/17 - Updated build with official 5.0.2 Binaries. Fixed Browser "Settings" crash.
    • 12/19 - Updated my Flo builds to Android 5.0.2_r1
    • 12/9 - Updated my Flo build. Will not be doing a Deb Build any more.
    • 12/2 @GROGG88 has updated his builds. I have not! I will update tomorrow. I did however get thefactory stock rooted ROM up HERE!
    • 11/18 - @GROGG88 and I have joined forces to create two ROMS! I will be creating PURE AOSP ROMS and he will be creating Modified ROMS with many useful features! Each ROM can als be user built because all commits are shared in post #2!!!
    • 11/15 - B8 - Updated the 5.0.0_r6. Deb is only using preview binaries due to lack of final binary files.
    • 11/14 - B7 - Updated the 5.0.0_r5. Deb is only using preview binaries due to lack of final binary files.
    • 11/10 - B6 - File system install instead of block install, Added Google Location Services to framework, Fixed a root issue that couple DEB users were having
    • 11/9 - B5 - Changed wallpaper again. Fixed stock recovery at source level (Thanks to @Gnome and @GROGG88)
    • 11/8 - B4 - Changed wallpaper to android 5 Wallpaper, fixed reverting to stock recovery (No need for save-recovery.zip), pre-rooted boot.img (No need for extra boot.img!)
    • 11/7 - B3 - Removed it. Bad files. Reverted back to Build 2.
    • 11/5 - B2 -- Fixed MTP bug that google has left in every version of AOSP, made ROM recovery flashable and added 2 zips to the OP
    • 11/4 - B1 - Update to 5.0.0_r2. PC install via fastboot


    Additional Downloads
    • Root by @Chainfire HERE!
    • Gapps for Lollipop HERE! There may be others so shop around!
    • Stericson's Busybox in flashable zip format is attached! Thanks to @Stericson for the binaries!




    @GROGG88's Special Builds are HERE!


    MOD EDIT: Link removed as domain has expired. Thread closed until new links can be installed



    Please hit Thanks! It just as easy as hitting Download!
    82
    Ubuntu 14.04 Set up and Build Guide

    Updated 11/05/2014

    Feel free to ask any questions about the build process. Do not ask questions about Ubuntu!

    This guide assumes the following
    1. Have Ubuntu 14.04 setup, fully operation, and up to date. Hard Machine or Virtual, makes no difference. Must meet the minimum specs for compiling. Info from Google HERE
    2. Understand terminal command line entry as this is all command line processors.
    3. You are not here to ask for help with Linux, only the Android build process!


    Add Java
    Code:
    sudo apt-get install openjdk-7-jdk


    Add Build tools (Adds the required packages at the time of this posting)
    Code:
    sudo apt-get install git gnupg flex bison gperf build-essential \
      zip curl libc6-dev libncurses5-dev:i386 x11proto-core-dev \
      libx11-dev:i386 libreadline6-dev:i386 libgl1-mesa-glx:i386 \
      libgl1-mesa-dev g++-multilib mingw32 tofrodos \
      python-markdown libxml2-utils xsltproc zlib1g-dev:i386


    Add Repo command (Syncs Google Repository with your local machine)
    Code:
    mkdir ~/bin && curl http://commondatastorage.googleapis.com/git-repo-downloads/repo > ~/bin/repo && chmod a+x ~/bin/repo


    Add bin folder to path for repo command (After you do this close Terminal and re-open to institute changes (easy way))
    Code:
    sudo gedit .bashrc
    export PATH=~/bin:$PATH <-(add to end of bashrc)

    Identify Yourself to the Repo (One day you may make commits so think about that when choosing your info!)
    Code:
    git config --global user.email "you@youremail.com"
    git config --global user.name "yourpreferredusername"

    Synch Repo (Download source... Sit back and grab a pop and a sandwich...)
    Code:
    mkdir ~/AOSP
    cd ~/AOSP
    repo init -u https://android.googlesource.com/platform/manifest -b android-6.0.0_r1
    repo sync
    Note: I use AOSP as my directory name. You can use what you want. You could use "aosp" or "Source" or "android" or "whateveryoulike"


    Install proprietary binaries (Needed for things like GPS and Bluetooth, they are not Open Source like android) (Install proprietary binaries from here in the root of AOSP folder (or whatever you called yours))
    Code:
    [url]https://developers.google.com/android/nexus/drivers[/url]



    Run envsetup.sh
    Code:
    source build/envsetup.sh

    Choose Device
    Code:
    lunch

    Build it!
    Code:
    make -j8 otapackage


    See Build Notes and ramblings from me in post #3!
    60
    I have decided to bring this project out of the shadows. The builds are now accessible through dedicated device threads:

    hammerhead

    flo

    deb
    52
    Notes
    • The ROM build will be a PURE AOSP ROM with no Gapps at all. See links in post #1 to PA Gapps for a good set of Google Apps!
    • The ROM will also have terminal level SU. So becareful! In other words its fully rooted and could be open to vulnerabilities. Flash your favorite Superuser Package if you need it. I dont. I recommend SuperSU by @Chainfire HERE. Download the flashable zip and flash after you flash ROM.
    • make -j8 is the number of worker threads that the make command will use to build. To me 8 is a safe number for an i7 processors. For an i5 Processor I would use -j4. I have experimented with a multitude of different values and it seems to me that the number of logical cores is also the best number to use with the make command.
    • Google recommends between -j24 and -j32 (to me that is excessive and causes my machine to error out every once in a while). Keep in mind the higher you push the more load the CPU will undertake. If your O/C'ing real hard you better have some nice cooling! I had to cut back OC on my 4770k from 4.65 to 4.4 with a Corsair H60 cooler just so it wouldn't over heat. When in doubt start low.
    • My i7 machine clocked at 4.4 and 16 gigs of RAM on a Samsung 840 Pro 256 Gig SSD take about 38 minutes to build the entire ROM.
    • With a 50 Meg download link it took maybe 30 to 45 minutes to sync the repo.

    Changes from Source
    27
    Build 6 is up!


    The following changes were made...


    • File system install instead of block install
    • Added Google Location Services to framework
    • Fixed a root issue that couple DEB users were having



    The ROM is now like a standard ROM install as far as the system.dat vs a /system install. What does this mean? It means you edit the ROM now like add your own apps, take things out and repost it with your changes (as long as credit is given).

    Edit: I posted a Diff of all changes made from Source to this ROM. Its in post #2 for anyone wanting to know the changes that were made to get it where its at.

    Enjoy!