How to build for nexus 7 - Omni Q&A

I have not any nexus but I would like to make a build for one, according what I saw in the website once i have the OS source I have to do this steps:
Code:
. build/envsetup.sh
breakfast tilapia
cd ~/android/omni/device/asus/tilapia
./extract-files.sh
./setup-makefiles.sh
The problem is that I don't have the device...
1. Can I do a compile for nexus 7 even if I don't have the device? I would like to test in an nexus 7 emulator.
2. Also I want to insert some apps before to compile, so it becomes a factory system app, is that possible
Thanks :fingers-crossed:

Related

How to build AOSP for Nexus 7?

I would like to mess with trying to install my own customized ROM's to my Nexus 7, but the first place to probably start is with being able to build AOSP as-is from source.
As I understand currently, building is only supported on Linux and OS X, but I can easily get Ubuntu 10.04 and re-partition my HDD to give it about 100GB (if that much is even needed).
Looking at:
http://source.android.com/source/initializing.html
I need to choose a branch and setup the Linux environment. I'm a bit confused as to what branch I should choose though. I want the latest source of Android available at the time, so I should pick the master branch? Or since I'm only building for the Nexus 7, should I choose it's device-specific branch instead? Although looking at:
http://source.android.com/source/build-numbers.html
the Nexus 7 is only at android-4.1.1_r1.1, but I could of sworn I heard there was r4 out already.
As for setting up the Linux environment, I hope I can just follow all the commands listed there without any problem.
Proceeding on with:
http://source.android.com/source/downloading.html
It looks like a pretty straightforward process that I'm also hoping can be done successfully if I follow the commands exactly as presented. I don't have a proxy nor the need for a local mirror either.
And then moving onto:
http://source.android.com/source/building-devices.html
Some stuff there I find a little bit confusing. It would seem I have to first get proprietary drivers, which all 4 seem to be placed conveniently at:
https://developers.google.com/android/nexus/drivers#grouper
From there, I imagine I can move the script that's bundled inside to the root of the source folder, run it, and follow the instructions. I don't exactly know what the root of the source folder is, but it would probably be obvious once I did start trying to build this. But once I did find it, I would run (using Nvidia's Graphics driver for the example) sh extract-nvidia-grouper.sh in Terminal, and it would place the right files where they need to be.
I don't understand the make clobber part too well at all; should I run this on the very first build, later builds, or all builds?
And once the source and drivers are all downloaded and available, I should then run lunch full_grouper-userdebug and then finally make -j# (# being some number in accordance with how many cores on my CPU I have). I have a triple-core CPU at 3.5Ghz, and I have the ability to unlock to quad-core at 3.3Ghz (but prefer to stay on triple). Should I just run -j32? Also will this build the Kernel as well, or will I have to get the source for that and compile it separately?
And once the build completes, my plan from there was to just go back to Windows and flash it. And if I managed to get it to flash and boot properly, I assume I would of succeeded with compiling AOSP from source
I noticed that userdebug part on full_grouper-userdebug gives "root access and debuggability". Does this mean it comes with some program like Superuser or SuperSU already installed? Or does this mean I can easily install those?
Perhaps after I get comfortable with the basics of flashing AOSP as-is, I can then try to mess with different types of optimizations, like Linaro and perhaps even messing with many types of optimizations from different kernels like faux123 has done .
I also have a 360kb/s DSL connection, so downloading the entire source the first time will probably take a good while. But once I have the source, I take it I don't have to redownload the entire thing for patches and stuff?
Any and all guidance is welcome
Bump before I go for tonight
Bump
You have a bunch of questions. I will answer some. And while I whole-heartedly support learning to build you don't need to build to flash roms.
The best advice I can give you is to just start building. You have found a bunch of instructions and links, obviously. Go ahead and begin, and tackle problems as they arise.
Environment
Okay...really the hardest part is setting upi the environment, if you don' t know linux. After downloading and installing Java and the SDK, make sure you add them to your path.
Most guides will have adding the path in the directions. But make sure to check that it works! It will be extremely frustrating, and you won't know what is wrong. Go to a random directory, Documents would be good, and enter java -version and then adb devices. If the computer says it cannot find the commands, then your path is the problem.
Make sure to setup udev. It is easy, Google it.
Building
Branch
You want to build from the tags.
Code:
repo init -u https://android.googlesource.com/platform/manifest -b android-4.1.1_r4
For the proprietary blobs, whatever directory you repo sync from (~/android/system or whatever) is the root directory. run the extraction from there.
when the proprietary blobs are extracted, and the source has been downloaded, these are your commands.
Code:
. build/envsetup.sh
lunch
Lunch will return a list of devices, Grouper is the Nexus 7, it is number 4. eng and user-debug do have root access, but SU and SuperSU are more than just root, they manage the root access for your apps as well. You can download them from Play or install them as a flashable-zip.
Choose 4 and then
Code:
make otapackage
don't worry about the -j# part. Your machine almost definitley cannot handle -j32. It is -j4 by default, that should be fine for your cpu.
If you want to enable faster builds, you can enter
ENABLE_CCACHE=1
before make otapackage, but it will take up a lot of space on your hd. Your subsequent builds will use some thing from your intial build instead of rebuilding them each time (kernel and other things). So even if you repo sync, some changes won't be reflected in your later builds. For instance, if you do not clean your prebuilts and build system, your build date in the build.prop will always stay the same as the first build.
The way you clear the build directory and make new everything is with make clean or make clobber. You can run it before any build, but the build will take much much longer than one that uses prebuilts. Non-clobbered and with ccache enabled are the fastest of all. But subsequent builds are pretty fast even without ccache.
When you want to update your source, you can just go to your root dir and repo sync. It will only update your source, it won't take nearly as long.
Okay, I answered more than I intended. There are a million guides that show you every step in the process.
Don't ask anymore generic worry questions...you're ready. You understand more than most people do before their first build before I even posted. Get started and if you run into problems, search. If you can't find the answer, then come back and ask us.
Good luck. it is easy, and very satisfying.
I finally got around to installing a Virtual Machine, and Ubuntu 10.04 After doing that, I fully updated Ubuntu, installed VMWare Tools, and then proceeded to start trying to acquire the AOSP source.
Getting sun-java-6 was a bit tricky, but not too hard (I ran the commands exactly as listed on the site, but the package didn't exist; had to get it from somewhere else). After that, I proceeded to do everything else, except CCache (I didn't know what .bashrc was, but I'll look further into this with future AOSP builds).
I then made the folder, did repo sync, and I'm now acquiring the source now from android-4.1.1_r4. As a quick question, does it matter whether I choose to build from android-4.1.1_r4, or master? Would master be more up-to-date?
espionage724 said:
I finally got around to installing a Virtual Machine, and Ubuntu 10.04 After doing that, I fully updated Ubuntu, installed VMWare Tools, and then proceeded to start trying to acquire the AOSP source.
Getting sun-java-6 was a bit tricky, but not too hard (I ran the commands exactly as listed on the site, but the package didn't exist; had to get it from somewhere else). After that, I proceeded to do everything else, except CCache (I didn't know what .bashrc was, but I'll look further into this with future AOSP builds).
I then made the folder, did repo sync, and I'm now acquiring the source now from android-4.1.1_r4. As a quick question, does it matter whether I choose to build from android-4.1.1_r4, or master? Would master be more up-to-date?
Click to expand...
Click to collapse
Sorry for late answer, no, use the r4 branch as it is more up to date. Also, make clobber every time isn't needed but you should as it remove then entire out folder (wich is where compiled stuff go) and this make sure you rebuild a clean thing.
Building CyanogenMod 10
Dunno if this is of any interest, but I have a thread started with a complete walkthrough for building CyanogenMod10 for Nexus 7.
Most of the info is the same, and there are some tips in the comments as well.
espionage724 said:
I would like to mess with trying to install my own customized ROM's to my Nexus 7, but the first place to probably start is with being able to build AOSP as-is from source.
Click to expand...
Click to collapse
So, how did you get on? I've been following the same path I think - repo sync the source and follow Google's own tutorial on compiling Android but with the added step of incorporating the binary drivers for the grouper.
I've built the .img files using make -j8, that all works, fastboot flash worked, but I get no video out when booting up using the new OS. I can ADB into the Nexus and it's certainly booted and working okay apart from, I'm guessing, the missing binary drivers.
I've used each of the 5 binary driver scripts to populate the "vendor" directory in the root of the downloaded source before compiling from scratch, but perhaps I've missed a step, so I'm curious as to whether you've got a fully working AOSP+binary driver compile working.
(By the way, my build environment was Ubuntu 12.04 64bit, SDK r20.0.3, Android 4.1.1 (JRO03R) source, Sun Java 1.6, and it all seems to work well using 8 threads on a Core i5 2500K + 4GB RAM).
Edit:
I re-ran the binary extraction, did a make clean; make clobber, and re-compiled - and now video works. Everything works now apart from the compass, camera and rotation sensor. I also tried compiling CyanogenMod from source, too, and had the exact same three problems. Everything works, and works well, apart from camera, compass and rotation sensor. All of which work in the stock Google ROM. Weird.
OK, So I've just compiled an OTA update package from AOSP source... my question is this:
I already have unlocked the bootloader on my wife's Nexus 7, installed Clockworkmod, rooted it, installed busybox, etc, manually on the stock 4.2 update I downloaded from Google on the device when it asked me to upgrade.
Is the otapackage I just compiled going to replace my custom recovery if I flash it as is? I've looked, and it has a "recovery" folder in the .zip, whereas any of the custom ROMs I have downloaded for my phone do not. Do I simply delete this recovery folder, and flash away? Do I need to edit the updater-script? I'm still trying to read and learn about this, but I haven't gotten a good answer from google or searching this site for my specific problem... maybe I'm wording my searches incorrectly.
I would just rather not have to go back and reinstall Clockworkmod... I know that if I want to have busybox, SuperSU, and other apps installed when I flash I'm going to have to add them to the zip and resign... I just don't want to mess my recovery. And being that this is my wife's tab (and not mine to play with, as she pointed out ) I don't want her to get the impression that I'm having to "fix" something I "broke" lol.
hallowed.mh said:
OK, So I've just compiled an OTA update package from AOSP source... my question is this:
I already have unlocked the bootloader on my wife's Nexus 7, installed Clockworkmod, rooted it, installed busybox, etc, manually on the stock 4.2 update I downloaded from Google on the device when it asked me to upgrade.
Is the otapackage I just compiled going to replace my custom recovery if I flash it as is? I've looked, and it has a "recovery" folder in the .zip, whereas any of the custom ROMs I have downloaded for my phone do not. Do I simply delete this recovery folder, and flash away? Do I need to edit the updater-script? I'm still trying to read and learn about this, but I haven't gotten a good answer from google or searching this site for my specific problem... maybe I'm wording my searches incorrectly.
I would just rather not have to go back and reinstall Clockworkmod... I know that if I want to have busybox, SuperSU, and other apps installed when I flash I'm going to have to add them to the zip and resign... I just don't want to mess my recovery. And being that this is my wife's tab (and not mine to play with, as she pointed out ) I don't want her to get the impression that I'm having to "fix" something I "broke" lol.
Click to expand...
Click to collapse
Sorry if a bit late, but here are some answers:
yes, the rom will replace your recovery. but if you delete the recovery folder and delete every line containing the word "recovery" in the updater-script, you should be good to go.
And if you accidentally remove the recovery, you can always flash it back very easily using: "fastboot flash recovery [filename.img]" (your n7 has to be in the bootloader)
And again, yes, you will have to put the extra apps into the zip and update the updater-script to install them too.
Also, you will need the gapps package if you want to use the play store and other google apps.
Hope this helped
Nexus 7 3G does not boot after flashing AOSP
Hi,
I followed the steps provided on source.android.com to build and flash the AOSP for Nexus 7 3G Tilapia. After successful flash, the device does not show anything after Google logo. Please help me out.
Thanks,
Veeren
Compile with ccache makes build time extremely fast.
How to do:
_Open a terminal
_Install ccache:
sudo apt-get install ccache
_Open .bashrc:
sudo gedit ~/.bashrc
_Add these lines:
#ccache
export USE_CCACHE=1
_Save and exit
_Sync source code
_After source synced, run in same terminal (in root directory of your source):
prebuilts/misc/linux-x86/ccache/ccache -M 20G (20G is the size in giga of space allocated for ccache, change it as you want)
_Start building
How to see if ccache works:
_Open another terminal in the root directory of your source and type:
watch -n1 -d prebuilts/misc/linux-x86/ccache/ccache -s
First build using ccache may be a little much longer but the others will be faster...
veerndra said:
Hi,
I followed the steps provided on source.android.com to build and flash the AOSP for Nexus 7 3G Tilapia. After successful flash, the device does not show anything after Google logo. Please help me out.
Thanks,
Veeren
Click to expand...
Click to collapse
Did you pull the proprietary files for your nexus and include them in the build? I believe things like your video drivers are included in there, so if those are missing....
I think the prop files are available for download from Google on source.android.com... If not, they tell you how to use an included script to pull them via adb. I can't remember... It's been a while since I built vanilla AOSP.
Sent from my Inspire 4G using xda app-developers app
Modifying stock AOSP
I have built AOSP following the Google tutorial.
I am compiling using the master branch and
Code:
aosp_grouper-userdebug
.
I have downloaded and extracted the appropriate proprietary binaries.
I am modifying two files in the source tree (see attachments; search for "// MODIFICATION ADDED HERE" to find my changes). Will these changes work? I am using Eclipse, set up in the exact way the tutorial explains, and I am not receiving any new errors.
When I compile the source using the following commands
Code:
$ . build/envsetup.sh
$ lunch aosp_grouper-userdebug
$ make fastboot adb
and flash it to my device with
Code:
$ fastboot -w flashall
BEFORE my modifications, it works just fine. The android-info.txt file and all the image files are produced properly.
However, AFTER adding the modifications, the build completes with no errors, but android-info.txt and all image files are no longer produced.
Why am I experiencing these problems? What can I do to make it work the way I want?
P.S. YES, I am aware that my modifications are not secure; these are for my own purposes, not for a public build.

compiling android (CM)

hi,
I'm wondering if someone can help me with compiling android from source. I've set up the build environment as described here: http://developer.android.com/guide/index.html
and downloaded the CM sources via repo.
the biggest question that I have at the moment is, how do I merge the code from our devs with the CM sources and then start compiling the whole thing? e.g. if I downloaded CM10 and want to merge it with marcellusbe's git development files..
I'm a bit confused about all the shell scripts in the CM sources..
do I need the kernel sources? or can I use for example one of the flashable zip files?
maybe someone can lead me through this step by step, or make a step by step tutorial, which would be great.
I do have linux experience but I'm not really into development stuff.
thanks in advance
sharukins said:
hi,
I'm wondering if someone can help me with compiling android from source. I've set up the build environment as described here: http://developer.android.com/guide/index.html
and downloaded the CM sources via repo.
the biggest question that I have at the moment is, how do I merge the code from our devs with the CM sources and then start compiling the whole thing? e.g. if I downloaded CM10 and want to merge it with marcellusbe's git development files..
I'm a bit confused about all the shell scripts in the CM sources..
do I need the kernel sources? or can I use for example one of the flashable zip files?
maybe someone can lead me through this step by step, or make a step by step tutorial, which would be great.
I do have linux experience but I'm not really into development stuff.
thanks in advance
Click to expand...
Click to collapse
1. Download sources from CM
Code:
# mkdir cm10
# cd cm10
cm10 # repo init -u git://github.com/CyanogenMod/android.git -b jellybean
cm10 # repo sync -j4
2. Take my cm10 device config from git and put it in device/samsung folder. It is not updated yet with all the fixes but good to start compiling.
there are problems in compiling with external/valgrind and external/regex-re2 : thanks to aaa801, he gave me link to a valgrind patch that solves the compile failure for armv6.
For regex-re2, for now, just delete the folder.
then you can compile jellybean :
Code:
cm10 # . build/envsetup.sh
cm10 # lunch
You're building on Linux
Lunch menu... pick a combo:
1. full-eng
2. full_x86-eng
3. vbox_x86-eng
4. mini_armv7a_neon-userdebug
5. mini_armv7a-userdebug
[B]6. cm_apollo-userdebug[/B]
7. full_panda-userdebug
8. cm_grouper-userdebug
9. cm_maguro-userdebug
10. cm_toro-userdebug
11. cm_toroplus-userdebug
Which would you like? [full-eng] [B]6[/B]
cm10 # make -j4
Jellybean needs modifications in the initial ramdisk ... I can provide you the kernel until I upload the changes to github.
providing the kernel would be great
but I can wait until you upload the latest changes and fixes, too

Help compiling Nexus 4 kernel from sources

Hi, I'm trying to compile the Nexus 4 kernel from the sources following the android.developers tutorial:
http://source.android.com/source/building-kernels.html
And also this guides:
[Tutorial] Building Your First Kernel: http://forum.xda-developers.com/showthread.php?t=1748297
Getting Started: Building a Kernel from source: http://xda-university.com/as-a-developer/getting-started-building-a-kernel-from-source
My goal is to learn to compile from AOSP, but I'm failing hard. After doing this step:
Code:
$ git clone https://android.googlesource.com/device/lge/mako-kernel
And after downloading the sources:
Code:
$ git clone https://android.googlesource.com/kernel/msm.git
All I get is a "kernel" file (without extension) and a folder .git folder. Inside that folder there aren't the files I assume I need, because I can't do "make mako_defconfig" as there isn't such file.
I don't know what I'm doing wrong as I'm not getting the files I need, althought download was nearly 1GB (I think they should be like this android tree):
https://android.googlesource.com/kernel/msm.git/+/android-msm-mako-3.4-jb-mr1.1
I'll appreciate your help, and sorry if this is the wrong section. Thanks in advance.
PS: I forgot, I already have the toolchain 4.6 and know how to call it, I tried it after clonning the trinity kernel git, I just wonder why I don't get similar files when clonning mako kernel from google source.
I solved it. I had to add the desired branch to the end of the command:
$ git clone https://android.googlesource.com/kernel/msm.git -b "brand"
Doubt is solved, thread can be closed.

[Q] Building from source for multiple devices

Just wondering how I can build pacrom for multiple devices, i.e. my nexus 5 and nexus 4
when I run
Code:
./build-pac -c -s hammerhead
it says
Code:
No external out, using default (/home/mk/android/out)
so I'm assuming there is a way to define where you want to output files to. I'm sure it's something easy but I can't seem to figure it out. I want to be able to have both devices building
Just do not do 'make clean' between builds and you can build for as many devices as you want. Each device will get it's own folder under out/target/product (I do not remember the exact path now)
Sent from my Xperia Ray using Tapatalk

Trouble Compiling Omnirom 6 for Nexus 6

So, I'm trying to compile my own omnirom 6 rom for my nexus 6. I've been using the instructions here: https://github.com/omnirom/android/blob/android-6.0/README.md
These instructions make it seem pretty simple:
1. Initialize the repo.
repo init -u git://github.com/omnirom/android.git -b android-6.0
2. Sync the repo.
repo sync
3. Build
cd <source-dir>; . build/envsetup.sh; brunch shamu
If I run these commands, as stated, my ROM builds successfully. However, when I install it on my nexus 6 using TWRP, and reboot, I'm hang on the Google logo. I never see the animated omni boot screen, or anything else.
I assume this means that I'm missing the nexus 6 device drivers. The instructions listed above don't state anything about needing to download the device drivers from https://developers.google.com/android/nexus/drivers
However, if I download the drivers, extract the three tar files, run the install scripts for the drivers, run "make clean" or "make clobber" and then repeat the compilation steps listed at the beginning of this post, the compilation fails within a minute or two.
So, can anybody confirm if anything might be missing from the steps mentioned at https://github.com/omnirom/android/blob/android-6.0/README.md ? Do I need to manually extract the device drivers? Anything else I need to do (or not do)?
Thanks!

Categories

Resources