Jump to content

Build from source, kernel/aosp


Guest pajn

Recommended Posts

Guest L0cu7us

i have got liquid_e kernel sources from acer website, installed sdk (linux) and tryed to compile it with the config.gz i've got from my liquid /proc/ directory,

unzipped as .config under msm-5ddc596 directory and run the cmd:

make ARCH=arm CROSS_COMPILE=~/Desktop/dev/android/mydroid/prebuilt/linux-x86/toolchain/arm-eabi-4.4.0/bin/arm-eabi-

unfortunately i've got an error:

CC kernel/fork.o

CC kernel/exec_domain.o

CC kernel/panic.o

cc1: warnings being treated as errors

kernel/panic.c: In function 'panic':

kernel/panic.c:72: error: unused variable 'ret'

make[1]: *** [kernel/panic.o] Error 1

make: *** [kernel] Error 2

[kki@l0cmobi msm-5ddc596]$

---

any idea ?

edit: for now i have commented out the line 72 ;-) seems to compile now

EDIT2: where can i find the acer's original .config ?

thanks !

Edited by L0cu7us
Link to comment
Share on other sites

Guest L0cu7us

another stop:

---

CC drivers/misc/pmem.o

drivers/misc/pmem.c: In function 'pmem_cache_maint':

drivers/misc/pmem.c:1714: error: implicit declaration of function 'clean_and_invalidate_caches'

drivers/misc/pmem.c:1717: error: implicit declaration of function 'clean_caches'

drivers/misc/pmem.c:1719: error: implicit declaration of function 'invalidate_caches'

make[2]: *** [drivers/misc/pmem.o] Error 1

make[1]: *** [drivers/misc] Error 2

make: *** [drivers] Error 2

---

:-/

Link to comment
Share on other sites

Guest loop0
i have got liquid_e kernel sources from acer website, installed sdk (linux) and tryed to compile it with the config.gz i've got from my liquid /proc/ directory,

unzipped as .config under msm-5ddc596 directory and run the cmd:

make ARCH=arm CROSS_COMPILE=~/Desktop/dev/android/mydroid/prebuilt/linux-x86/toolchain/arm-eabi-4.4.0/bin/arm-eabi-

unfortunately i've got an error:

CC kernel/fork.o

CC kernel/exec_domain.o

CC kernel/panic.o

cc1: warnings being treated as errors

kernel/panic.c: In function 'panic':

kernel/panic.c:72: error: unused variable 'ret'

make[1]: *** [kernel/panic.o] Error 1

make: *** [kernel] Error 2

[kki@l0cmobi msm-5ddc596]$

---

any idea ?

edit: for now i have commented out the line 72 ;-) seems to compile now

EDIT2: where can i find the acer's original .config ?

thanks !

You must disabled the "-Wall" in Makefile because all warnings are treated as errors.

Link to comment
Share on other sites

Guest L0cu7us

this error was due to wrong .config used ;-) (yes i'm noob kernel maker ;-)) - solved

Now that kernel does compile well, i need to know wich options i need to enable for netfilter to work

for tethering, any hint ?

Does they need to be compiled as module or included into kernel ?

thanks !

Edited by L0cu7us
Link to comment
Share on other sites

Guest eumate

I have built the kernel based on eclair branch on phh repository.

It boots but still have a huge network power drain, as every custom built kernel I've seen.

I'm trying to fix it.

Link to comment
Share on other sites

Guest L0cu7us

---

CC net/netfilter/x_tables.o

CC net/netfilter/xt_tcpudp.o

CC net/netfilter/xt_CLASSIFY.o

make[2]: *** No rule to make target `net/netfilter/xt_CONNMARK.o', needed by `net/netfilter/built-in.o'. Stop.

make[1]: *** [net/netfilter] Error 2

make: *** [net] Error 2

---

mmm, any idea ?

Link to comment
Share on other sites

Guest Riekr

add CONNMARK to .config, it should work

maybe you have modified .config manually and after that ran a make? there should be a step for recalculating dependencies (make dep? or something similar, i don't remember)

Link to comment
Share on other sites

Guest L0cu7us

what the hell...

seemes the xt_CONNMARK.c doesn't exists on my sources !

i hev download this: App.Guide_Acer_1.0_A21E_A.zip from acer website, any other official source !??

Link to comment
Share on other sites

Guest zuko1989

nobody has read this???:

So, technical details.

Google decided to use prelinking technique to speed everything up and to waste as little RAM as possible. Great! So they took prelink utility and modified it to fit their needs. Two tools were born: apriori and soslim. They are run on every build to produce optimized and prelinked system libs. Almost every .so file you see in /system/lib is prelinked via soslim/apriori.

Prelinking works by loading libs at known base addresses which are defined in a special file . This file contains a list of libs with their predefined base addresses. What Acer did is that they modified this file and did not share it with us. So every AOSP attemp failed. If you compile any lib from Android sources and put it on your Liquid boom happens and nothing works. Studying Android sources I've found a small utility which is called isprelinked. It checks binary library if it is prelinked and if it is, then base address is shown.

So yesterday I ran isprelinked on Acer libs and recreated prelink-linux-arm.map for Liquid. Then I built test version of webkit (libwebcore.so), put it into /system/lib replacing version from Acer and rebooted the phone - it worked! I can not share prelink map at the moment - it is at my home PC and I don't have remote access. I will share this file in the evening, but you can make it yourself, actually.

How to make prelink map? Quite simple. First of all you need to create isprelinked binary. cd to your Android source (cd ~/mydroid as in docs) and run "make isprelinked" (without quotes, of course). You will get app binary in a while, it will be somewhere in ~/mydroid/out/host/bla-bla-bla. The correct path will be shown in console once compilation is done.

Next step is run isprelinked over Acer binaries. It is quite simple, but will take some time. Copy all libs from your Liquid to some folder, for example to ~/acer-libs. Now open original prelink map (make a backup!), copy its contents to empty text file, in this new text file remove comments and base addresses, leave only lib names. Put a new line at top with full path to isprelinked and merge all lib names into single line with spaces between. You should have text file with one line looking like this:

CODE

~/mydroid/out/host/tools/isprelinked libdl.so libc.so libstdc++.so

This line will be very long (: Now go back into console, cd ~/acer-libs and run this BIG line. It will fail (: Because this list has some libs which Acer does not have. It will fail WITHOUT telling which lib is missing. But you will see base addr of previous lib. So find all unneeded libs and remove them from command line. Hell of a work, actually. But once again - I'm not at home, I can not paste correct line at the moment. Sorry.

Once isprelinked runs clean without errors you will see a list of all libs and their base addresses. Remove ":" character between lib name and address, paste it into prelink-linux-arm.map replacing all previous contents (you made a backup, right?) and this part is finished - now you have all base addresses needed for successful compilation of system binaries.

But if you run compilation now it will fail - apriori will tell you that lib addresses are out of bound. You need to modify prelinkmap.c. There is a line:

CODE

#define PRELINK_MIN 0x90000000

Change it to:

CODE

#define PRELINK_MIN 0x50000000

And recompile apriori tool with "make apriori" from your ~/mydroid. Now you have a 100% Acer compatible build environment!

Now if you wish to compile any component just run "make SOMETHING" where SOMETHING is what you need to compile. For example, "make libwebcore" compiles WebKit (: This is the simplest way of compilation, but you also want to make Snapdragon optimizations generated. So you need to compile with additional option TARGET_ARCH_VARIANT to target Snapdragon. SD has armv7-a CPU inside. So final string for WebKit is "make TARGET_ARCH_VARIANT=armv7-a libwebcore". That will make default WebKit with all CPU dependent optimizations. Compilation result can be found in ~/mydroid/out/target/system/lib - full and correct path will be shown in console after compilation.

What does it all mean? Well, AOSP is finally possible! This will also be helpful for porting binaries from other non-acer ROMs - now you can easily rebase libs to Acer standard and everything will work.

Today I will put map file I've generated from Acer libs and will continue working on Flash support for 2.1. I also think I will compile Flash supporting WebKit with V8 JavaScript engine (like in Froyo), SVG support and I will look into animated GIFs issue. There will be two libwebcores from me: stock with Flash and full-blown (which may eat your RAM and kill CPU).

Link to comment
Share on other sites

Guest eumate

Probably the battery drain was caused by the 'fast dormancy' setting of wcdma that is off by default on the custom kernel.

Can be enabled on the hidden menu.

Link to comment
Share on other sites

Guest L0cu7us

i'm on linux, can anyone point me to a guide on how to build boot.img after i have compiled my own kernel image ?

I think i need also some tools to unpack/repack boot.img...

thanks !

Link to comment
Share on other sites

Guest Riekr
Play with it at work? :angry:

So, from here download the nessesary things

http://android.git.kernel.org/

I used repo so I downloaded all the things, but I think it's enough just this. I don't known where is the prebuilt arm-eabi sorry.

Install git of course before this command.

git clone git://android.git.kernel.org/kernel/common.git android-kernel

And after that you should

make ARCH=arm CROSS_COMPILE=~/mydroid/prebuilt/linux-x86/toolchain/arm-eabi-4.4.0/bin/arm-eabi-

The path may vary of course. You need a .config file or add as a parameter.

EDIT: I have just found it. There is in platform/prebuilt.git.

So the correct command is : git clone git://android.git.kernel.org/platform/prebuilt.git

i downloaded the prebuilt repo but now at the end of the git pull i get:

$ git pull
You asked me to pull without telling me which branch you
want to merge with, and 'branch.master.merge' in
your configuration file does not tell me, either. Please
specify which branch you want to use on the command line and
try again (e.g. 'git pull <repository> <refspec>').
See git-pull(1) for details.

If you often merge with the same branch, you may want to
use something like the following in your configuration file:

[branch "master"]
remote = <nickname>
merge = <remote-ref>

[remote "<nickname>"]
url = <url>
fetch = <refspec>

See git-config(1) for details.[/codebox]

what should i do?

Link to comment
Share on other sites

Guest Riekr
Probably the battery drain was caused by the 'fast dormancy' setting of wcdma that is off by default on the custom kernel.

Can be enabled on the hidden menu.

even enabling it from the hidden menu the checkbox goes to off when returning to it.. maybe custom kernel completely miss fast dormancy? :angry:

are you sure it works on stock kernel?

Link to comment
Share on other sites

Guest eumate
even enabling it from the hidden menu the checkbox goes to off when returning to it.. maybe custom kernel completely miss fast dormancy? :angry:

are you sure it works on stock kernel?

Yes I've noticed that.

Anyway after enabling that (and a reboot), the battery is going down normally and the 'network' is no more the more hungry process in the battery consumption summary.

Maybe luck and nothing related to the fast dormancy, anyway.

EDIT: just to be sure, I have restored stock kernel with nandroid, fast dormancy is enabled.

Edited by eumate
Link to comment
Share on other sites

Guest Riekr
Play with it at work? :D

So, from here download the nessesary things

http://android.git.kernel.org/

I used repo so I downloaded all the things, but I think it's enough just this. I don't known where is the prebuilt arm-eabi sorry.

Install git of course before this command.

git clone git://android.git.kernel.org/kernel/common.git android-kernel

And after that you should

make ARCH=arm CROSS_COMPILE=~/mydroid/prebuilt/linux-x86/toolchain/arm-eabi-4.4.0/bin/arm-eabi-

The path may vary of course. You need a .config file or add as a parameter.

EDIT: I have just found it. There is in platform/prebuilt.git.

So the correct command is : git clone git://android.git.kernel.org/platform/prebuilt.git

i'm finally compiling in a virtual box linux machine (eclair branch) ;)

i will let you know about my experiments :angry:

thanks all!

phusson what is the current state of head?

Link to comment
Share on other sites

Guest csics5
i'm finally compiling in a virtual box linux machine (eclair branch) :D

i will let you know about my experiments :angry:

thanks all!

phusson what is the current state of head?

;)

Link to comment
Share on other sites

Guest Riekr

sorry guys, i've seen in the past posts in this thread scripts for rebuilding boot.img... now i can't find them, can someone point them to me?

thanks!

Link to comment
Share on other sites

Guest Riekr

ok, did it.. now..

how can i access fastboot to restore a working kernel? :angry:

(camera+power button led me to fastboot only one time... not i can't access it.... don't know/find the correct procedure)

edit: did it via a zip in recovery mode. when i flash a new boot.img can i simply "fastboot -i 0x0502 flash boot boot.img" or do i need something more?

Edited by Riekr
Link to comment
Share on other sites

Guest eumate
ok, did it.. now..

how can i access fastboot to restore a working kernel? :angry:

(camera+power button led me to fastboot only one time... not i can't access it.... don't know/find the correct procedure)

edit: did it via a zip in recovery mode. when i flash a new boot.img can i simply "fastboot -i 0x0502 flash boot boot.img" or do i need something more?

adb reboot bootloader

fastboot -i 0x0502 flash boot boot.img

But you can boot a boot image without flashing it, it's good for trying it.

fastboot -i 0x0502 boot boot.img

For fastboot hardware boot, if I remember well, disconnect cable and battery for 10 seconds, then plug the battery, then cable, hold camera button and press < (back) touchkey.

Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.