Android OS Forum banner
1 - 20 of 176 Posts

·
Good at breaking things
Joined
·
711 Posts
Thanks for this! I've been stumbling through making some builds over the past few days which seems to be working (after adapting a variety of different tutorials and a bit of guesswork). This confirms I'm on the right path!

One issue I've repeatedly run into... all my builds seem to be missing /system/etc/audio_policy.conf, which makes all audio go over the speaker no matter what. Any hints on what I may be messing up?

And finally... for repeating builds, I assume all that is necessary is:

Code:
<br />
cd ~/aokp_jb<br />
make clobber<br />
repo sync<br />
. build/envsetup.sh && brunch <target>
I read some on source.android.com about enabling CCACHE, but that doesn't appear (to my n00b eyes) to be an option when building AOKP - is this correct?

Thanks again!

... one more thing: I had been using "lunch" followed by "make otapackage" to build; now trying using "brunch maguro" I get a notice that "schedtool" is not installed. No biggie to install, just wondering if I missed something along the way.
 

·
Good at breaking things
Joined
·
711 Posts
For the audio policy config file, that is usually pulled in via your device tree. Might want to take a look at that.

For CCACHE, all AOSP flavors can use it.

For schedutil, just run
Code:
sudo apt-get install schedutil pngcrush
Thanks again for the help. I'm doing my best to learn this, but there just seem to be a few things that don't quite match up (maybe just in my mind). I'm eternally grateful to those who go out of their way to help me help myself :)

For the device tree, does that refer to the ~/aokp_jb/device directory tree, or is it something else? I have confirmed that ~/aokp_jb/device/samsung/tuna/audio/audio_policy.conf does exist. What else should I check? In the meantime, manually copying that file over to /system/etc/ after flashing my build seems to work fine so it's not a huge huge issue.

And thanks for the info on ccache. I guess I was stumped a bit since it didn't seem to exist under prebuilt/linux-x86/ccache as specified in the source.android.com documentation. Found it at prebuilts/misc/linux-x86/ccache though, so I'll give that a go for my next build.
 

·
Good at breaking things
Joined
·
711 Posts
Ohh nevermind, thats basically that last command at the bottom of your post correct?
Correct. Apparently the "brunch" command combines the "lunch" command (which effectively specifies the build target - that is, the device the build will be for) with the "make otapackage" command, which actually kicks off the compiling.

I think. I'm also king n00b.
 

·
Good at breaking things
Joined
·
711 Posts
For me, I ran
Code:
sudo apt-get install schedtool
instead of schedutil running 12.04 if it makes a difference.
Me too. I wonder if schedtool is a piece of schedutil perhaps? *shrug* Just installing schedtool was enough to make brunch seem happy.

I was at least able to locate schedtool on https://launchpad.net/ubuntu/precise/+package/schedtool; couldn't find any results for schedutil. *shrug*
 

·
Good at breaking things
Joined
·
711 Posts
Thanks a lot for this guide! I've managed to build my very 1st bleeding edge AOKP rom for maguro!

Now two little questions:
- How do I actually make cherry-picks? I've seen some guides, but I'm a little confused that when I make a cherry-pick, the next time I won't have a clean code when I do the "repo sync".
I found a good rough guide on cherry-picking over here.

Essentially,
  • Hit up http://gerrit.sudose...status:eek:pen,n,z and find the commit you want. I'm a fan of I36f11787, "Use prebuilt su and supersu.apk"
  • Scroll down to the last patch and click the cherry-pick tab next to Download. Click the clipboard button at the far right to copy that command.
  • Scroll back up and look what Project the commit is under - in this case, AOKP/vendor_aokp.
  • Navigate (in terminal) to that part of your source tree - in my case, ~/aokp_jb/vendor/aokp.
  • Paste the command and hit Enter.
  • Your cherry has been picked! Build that shit!
Each time you repo sync, (I believe) your source tree gets restructured to mirror the merged commits - your cherry-picks will go away, so you have to re-pick each cherry anytime you resync. I think.

- And is it possible to change the build info before I compile the actual ROM?

Thanks a lot again!
I'm also curious on this. I'm sure it's possible, just haven't found the file(s) that need changing.
 

·
Good at breaking things
Joined
·
711 Posts
Thanks a lot codesplice!

That's great info! But the next time that I use "repo sync" my cherry-picks will be lost? (that's what I'm hoping for, since I dunno nothing about coding and I'm unable to find where that cherry went). Bottom line is, are the cherry-picks deleted everytime I do a sync.
Sorry for that, I guess we were writing at the same time

And I read about the audio bug when building, I had the same problem here with maguro. I just need to manually copy the file and it's done? How did you find the missing file? You know the whole tree by head? I read about people using qgit to visually manage branches and missing files but I couldn't make it work :)

I'm deeply sorry about all those questions, but one little more
. After I've built the ROM, I've extracted the zip, edited the build.prop and repacked the zip, then my ROM was unflashable, is this commom?

Thanks a lot!
I haven't had good results trying to manually repackage the zip (what method were you using?). I've been able to manually pull the audio_policy.conf file from ~/aokp_jb/device/samsung/tuna/audio; I then adb push it to /system/etc after flashing the ROM. That works for me (so far).
 

·
Good at breaking things
Joined
·
711 Posts
Interesting. This morning's build finally completed (slow slow slow laptop...), and it does seem to have the audio_policy.conf file included. The only thing I did different (other than resyncing my repos this morning) was using brunch to build rather than lunch + make. Well, I'm pleased to have that sorted out.
 

·
Good at breaking things
Joined
·
711 Posts
question about the required packages:

in the OP it says to get these:
sudo apt-get install git-core 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 openjdk-6-jdk tofrodos python-markdown libxml2-utils xsltproc zlib1g-dev:i386

and then:
sudo ln -s /usr/lib/i386-linux-gnu/mesa/libGL.so.1 /usr/lib/i386-linux-gnu/libGL.so

on the ICS tutorial it says to get these:
sudo apt-get install curl git-core gnupg flex bison gperf libsdl1.2-dev libesd0-dev libwxgtk2.6-dev squashfs-tools build-essential zip curl libncurses5-dev zlib1g-dev sun-java6-jdk pngcrush schedtool g++-multilib lib32z1-dev lib32ncurses5-dev lib32readline5-dev gcc-4.3-multilib g++-4.3-multilib

So should I redo the packages using the listed jb packages? Will they just update whatever needs it? Also still on 11.10, so am guessing I can go ahead and let ubuntu update to 12.04 before doing this? Thanks.
Since this tutorial was written with 12.04 in mind, I'd probably go on and upgrade to that and install the listed packages.
 

·
Good at breaking things
Joined
·
711 Posts
followed the guide synced the repo i go to build and get

[email protected]:~/aokp_jb$ build/envsetup.sh && brunch captivatemtd
bash: build/envsetup.sh: Permission denied
[email protected]:~/aokp_jb$
Make sure the envsetup.sh script has execute permission set (chmod +x build/envsetup.sh). Also try ". build/envsetup.sh".
 

·
Good at breaking things
Joined
·
711 Posts
[background=rgb(245, 245, 245)]Anyone with experience compiling:[/background]
[background=rgb(245, 245, 245)]1. When you make a build, is the device kernel apart of the .zip file created? Or do I have to flash a kernel with the new .zip?[/background]
A kernel is always included. It wouldn't boot otherwise.

[background=rgb(245, 245, 245)]2. Let's say I run a repo sync today, and then a week from now I decide to run repo sync again to get every new change.[/background]
[background=rgb(245, 245, 245)]When I run that second repo sync does it automatically delete the old repo sync files?[/background]
[background=rgb(245, 245, 245)]Or do I have to go find the old files and delete them?[/background]
[background=rgb(245, 245, 245)]Or does that second repo sync only download what has changed? [/background]
Each repo sync should only download/replace what changes have been merged since the last sync. This means that if you've cherry-picked any commits they will be overwritten. Or at least that is my understanding. I've only been building successfully for a few days now.
 

·
Good at breaking things
Joined
·
711 Posts
Thanks! What you said sounds right to me, especially with the kernel being included, it would be pretty stupid to not include it. Out of curiosity are you building using Ubuntu in a virtual machine or is it actually running on your machine?
I'm actually running Ubuntu.
 

·
Good at breaking things
Joined
·
711 Posts
You do not need to change the permissions on envsetup.sh - but you DO need the '. ' in the line, as in:
. build/envsetup.sh && brunch toro

The '.' means to include the contents of the file into your shell environment - this file contains alot of function definitions and environment variables using to build with.
Thanks for the clarification; I figured the "." did something to that effect but wasn't exactly sure what.
 

·
Good at breaking things
Joined
·
711 Posts
I found a good rough guide on cherry-picking over at http://forum.xda-developers.com/showpost.php?p-23527685&postcount=29.

Essentially,
  • Hit up http://gerrit.sudose...status:eek:pen,n,z and find the commit you want. I'm a fan of I36f11787, "Use prebuilt su and supersu.apk"
  • Scroll down to the last patch and click the cherry-pick tab next to Download. Click the clipboard button at the far right to copy that command.
  • Scroll back up and look what Project the commit is under - in this case, AOKP/vendor_aokp.
  • Navigate (in terminal) to that part of your source tree - in my case, ~/aokp_jb/vendor/aokp.
  • Paste the command and hit Enter.
  • Your cherry has been picked! Build that shit!
Each time you repo sync, (I believe) your source tree gets restructured to mirror the merged commits - your cherry-picks will go away, so you have to re-pick each cherry anytime you resync. I think.
To "sync and keep up", just do this each time you want to make a new build:
  • cd ~/aokp_jb to move into the root of your build tree
  • make clobber to remove any previous builds
  • repo sync to synchronize any changes since the last time you synced
  • . build/envsetup.sh && brunch <target> to build as usual
 

·
Good at breaking things
Joined
·
711 Posts
Hello there guys,

I've followed the guide, installed all necessary packages, I input the last command, then the build runs for about an hour, but there's no flashable .zip file in the end


I used to go with no problems with Ubuntu 10, now using 12.04

Any ideas?
Does the build finish successfully, or does it terminate with an error message? What files are present in your ~/aokp_jb/out/target/product/<target> directory afterwards?
 

·
Good at breaking things
Joined
·
711 Posts
pulled the trigger on another ssd, should be here by end of the week. once i get the new drive ill commit the entire thing (128gb) to my VM and hopefully i wont have any further issues.
I do wish I had an SSD to play with. My laptop (M11X) only has a single drive bay though, and I need at least 500GB for all my OSes. SSDs that size are still $$$ :-/

I have had pretty good results after enabling CCACHE though; builds do seem to go at least a little bit quicker.
 

·
Good at breaking things
Joined
·
711 Posts
This was the end of my log:

Code:
<br />
make: *** [out/target/common/obj/JAVA_LIBRARIES/framework_intermediates/noproguard.classes-with-local.dex] Killed<br />
make: *** Waiting for unfinished jobs....
If this is somehow Java related, I have a big warning at the start about using a non compliant Java version.

And at my Out folder, I have ramdisk.img, ramdisk-recovery.img and ramdisk-recovery.cpio --- no zip


Thank a lot as always!
I'm afraid that error doesn't mean anything to me, but an incompatible version of Java could be an issue. Do you know what version you are using?
 

·
Good at breaking things
Joined
·
711 Posts
not a bad idea. i've used bridged on my vm's for quite a few years as a standard practice. everything seems to work better that way (at least, in my experience it has).

quick "n00b" question: after syncing repo, where do i start making changes/tweaks to my liking? say i want to change up the systemui.apk, or framework, is there a place in the directory tree i can put my modified apk, then compile from there? or do people usually swap stuff out after compiling? same with build.prop edits, can those be done prior to compiling, or after?
Fellow n00b here, but I believe the "correct" way to implement those mods is to alter the various source and config files that control how the various apks and .prop files are built at compile time. I haven't found a good "so I compiled aokp from source, now what?" tutorial yet but I have done some poking around. I've started to study which files are modified in what way each time I cherry pick a commit, which has shown me a few places to look. So the best advice I can give a fellow n00b at this point is just to dig around a bit.
 

·
Good at breaking things
Joined
·
711 Posts
It's a 128gb Samsung that was on sale. You're not going to see ssd's that large for that cheap for a long time. They were about $1 per gig for a while and just recently starting going lower, but spindle prices are still way off. Just get a 120gb or 240gb and use the drive as your OS drive, you'll enjoy the performance increases.
I'd love to, but as I mentioned I only have a single drive bay and several OSes loaded on my laptop. I really can't get by with less than 500 GB. Oh well, I'll continue to wait.

BTW, I mentioned earlier that I've had pretty good results since enabling ccache. If anyone is curious, here's how I did it:
  1. Put the following in your .bashrc or equivalent ( .bashrc is a file in your user's home directory which is executed each time you start up a bash shell. It is used for setting environment variables, aliases, the format of your prompt, etc. Very handy file.)
    Code:
    export USE_CCACHE=1
    By default, the cache will be stored in ~/.ccache. The recommended size is 50-100GB, so if you need to put the ccache directory elsewhere you should also add the following to your .bashrc
    Code:
    export CCACHE_DIR=<path-to-your-cache-directory>
  2. Make sure those new variables get loaded into your shell with
    Code:
    source ~/.bashrc
  3. Initialize the ccache with the following command (executed from the top of your aokp_jb tree, ~/aokp_jb). Again, the recommended size is 50-100GB; that said, I'm using 30GB due to limited space available and it seems to work fine.
    Code:
    prebuilts/misc/linux-x86/ccache/ccache -M 50G
    This setting will be stored in your ccache directory and is persistent; you'll only have to set this up once.

Now go ahead and build something as usual. It may take a while, but subsequent rebuilds should be significantly quicker.
 
1 - 20 of 176 Posts
This is an older thread, you may not receive a response, and could be reviving an old thread. Please consider creating a new thread.
Top