yashsingh1/xdaforums huggingface dataset:
[Atrix 4G General] atrix4g18:
I have created a new thread with a script to build the kernel. Full credit for the script goes to the amazing mapkel. Without him there would be no script.

[Script] Build ICS/JB Kernel

This thread will remain as a Step by Step guide. Either method works fine but the script method is much simpler.

This is an informative guide and I decline responsibility for any damage to your device.

Do not attempt to build this kernel if you are going to complain to devs about issues.

That being said, I designed this so that even those with little knowledge can follow the exact commands and will run into no issues. If you have issues building, post here and I will try to assist you.

The following is a complete tutorial to building the kernel.

Credits:

Kernel Devs: krystianp, lehjr, Epinter, and mmontuori for making this kernel; without them there is no kernel.

Big thanks to benouch for the idea and basic outline of this tutorial.

Another big thanks to zen25205 for help with building the kernel and getting the Linaro Toolchain.

A final big thanks to mchinand for suggesting using "${HOME}" (no need to change for username anymore)

Kernel Kitchen

Thanks to:

quetzalcoatl2435

nlabrad

You need to install Ubuntu 12.04 64bit (Google for instructions)

1. Download linaro.zip (toolchain) from here: http://www.mediafire.com/?ok2paef7uhx2ji8

2. Download kitchen.zip from here: https://mega.co.nz/#!Uc4D0YiD!bs-f4FLWQTu7Q8FQziY0o3GWRPJWGBl-6-Hhm6nta-k

3. Download kernel-working.zip from here: http://www.mediafire.com/?wtavk4yb24x3lj1

4. Download misc.zip from here: http://www.mediafire.com/?q693gipql6a6ty8

If there are any issues with this guide, or if you have any issues building the kernel, post here and I will assist you as best I can.
[Atrix 4G General] atrix4g18:
The following is for Arch Linux Only. Ignore if you are using Ubuntu

pacman -Syu
pacman -S base-devel
pacman -S git
pacman -S bzip2
pacman -S unzip

Ubuntu Users Start Here

If you get an error on apt-get (something about package not found), enable all software sources in Ubuntu Software Center.

Stage 1 (first time only). Go to Stage 2 if you have already built the kernel.

Open a terminal and run the following commands:

sudo apt-get install -y build-essential kernel-package libncurses5-dev bzip2

sudo apt-get install git

Create a folder named “olympus” in your home directory:

mkdir ${HOME}/olympus/

Extract the downloaded .zip files to the “olympus” folder (you can use the file manager or the following commands):

unzip ${HOME}/Downloads/linaro.zip -d ${HOME}/olympus/
unzip ${HOME}/Downloads/kitchen.zip -d ${HOME}/olympus/
unzip ${HOME}/Downloads/kernel-working.zip -d ${HOME}/olympus/
unzip ${HOME}/Downloads/misc.zip -d ${HOME}/olympus/

There should now be 4 folders in ${HOME}/olympus/: “linaro”, “kitchen”, “kernel-working” and “misc”.

In a terminal:

cd ${HOME}/olympus/

git clone git://github.com/CyanogenMod-Atrix/android_kernel_motorola_olympus.git

Stage 2 (start here if you are building again).

cd ${HOME}/olympus/android_kernel_motorola_olympus/

Get the latest updates from git:

git remote update

Now run the following commands to build the kernel:

export CROSS_COMPILE=${HOME}/olympus/linaro/bin/arm-unknown-linux-gnueabi-

make clean && make mrproper

make -j2 ARCH=arm tegra_olympus_defconfig

make -j2 ARCH=arm

Now start packing the new kernel and modules:

cp ${HOME}/olympus/android_kernel_motorola_olympus/arch/arm/boot/zImage ${HOME}/olympus/kitchen/kernel-tools/input/

cp ${HOME}/olympus/misc/CM9/boot.img ${HOME}/olympus/kitchen/kernel-tools/input/

(Replace CM9 with CM10 for CM10)

cd ${HOME}/olympus/kitchen/kernel-tools/

./menu

Press Enter Key

Select Option 1

Press Enter Key (again)

Select Option 1 (again)

Type “olympus” and press Enter Key

Press "Ctrl+C"

cp ${HOME}/olympus/kitchen/kernel-tools/output/bootimg-contents/initrd.img ${HOME}/olympus/kitchen/kernel-tools/input/

cd ${HOME}/olympus/kitchen/kernel-tools/

./menu

Press Enter Key

Select Option 1

Press Enter Key (again)

Select Option 3

Type “olympus” and press Enter Key

Press "Ctrl+C"
[Atrix 4G General] atrix4g18:
Run the following commands:

cp ${HOME}/olympus/kitchen/kernel-tools/output/boot.img ${HOME}/olympus/kernel-working/

find ${HOME}/olympus/android_kernel_motorola_olympus/drivers/ -name *.ko -exec cp -f {} ${HOME}/olympus/kernel-working/system/lib/modules/ \;

cd ${HOME}/olympus/kernel-working/

zip -r new_kernel.zip *

The “new_kernel.zip” file will be located at ${HOME}/olympus/kernel-working/new_kernel.zip

This is a flashable zip that you can flash on top of MROM CM9 and the ROMs that the devs will be releasing.

You will have the latest kernel changes by building it yourself.
[Atrix 4G General] mchinand:
Thanks for the tutorial. Just a quick question, why did you include the kernel modules in the kernel-working.zip; aren't they going to be overwritten with the newly compiled ones?
[Atrix 4G General] Ufoex:
I can do it in debian?
[Atrix 4G General] atrix4g18:
They were useless. I have reuploaded. New link in OP.
[Atrix 4G General] atrix4g18:
I have not tested. You can try and report back. If it works I will update the thread.

Usually devs stick to Ubuntu for Android development.

Seeing as Ubuntu is based off Debian, it should work.
[Atrix 4G General] mchinand:
I think it is better to only include what is necessary in the zips. Not for space/bandwidth reasons (they were small as you said), but more for understanding the process and knowing what's essential to build a flashable kernel.
[Atrix 4G General] atrix4g18:
100 Percent agree. I appreciate the suggestion. As I said the new kernel-working.zip is updated without those files. Check OP.
[Atrix 4G General] paladin881:
Thanks
[Atrix 4G General] quetzalcoatl2435:
You forgot "sudo apt-get install git". ;)

Oh, and if you get an error on apt-get (something about package not found), enable all software sources in Ubuntu Software Center.
[Atrix 4G General] atrix4g18:
Second Post Updated. Thanks. (I don't think anyone will have the apt-get error, but if they do I will let them know).
[Atrix 4G General] quetzalcoatl2435:
I got that error on apt-get, which is why I mentioned it. :D

It was weird, I had to enable local (CD) sources to make apt-get work. It had to read the source list from the CD first before downloading the packages.

It might be a wonky install, though. I just put it here in case anyone faces the same problem.
[Atrix 4G General] crazymania56:
what?

Does the kernel already includes Linaro?

omg Kristian said he'll look at it, so did he? :crying: Happy:crying:
[Atrix 4G General] atrix4g18:
No this is only the Linaro Toolchain used to build the kernel.

Other tutorials would have you download the Android NDK for the toolchains within.. This tutorial uses the Linaro Toolchain instead.

Added to second post. Thanks. Also made a list of credits in the OP and you are in it.
[Atrix 4G General] nlabrad:
Hi, i'm trying this in Arch, i looked for the equivalent packages that are needed in ubuntu and seems that Arch has some of them in the arch-devel group of packages and the *-dev packages are included in the non-dev (arch doesn't splits the packages in dev and nondev).

So, i started unziping, and when i'm unzipping the linaro.zip, some files are overwritten, (it asks if i want to overwrite them or not), i chose yes to overwrite.

I'm compiling, so far no problems, i'll update after i finish.
[Atrix 4G General] atrix4g18:
Good to know.

If it works get into the specifics and I can edit the guide or make a second one for Arch. With full credit to you of course.
[Atrix 4G General] nlabrad:
Im writing this as it compiles

-No errors in make clean && make mproper

-No errors in make mrom_deconfig

The errors must be in the make.

There are a few warnings, unused functions, unused variables, uninitialized variables, i see a few modules being built, but the extension is ".o" not ".ko", for example dhd_something.o

"arch/arm/boot/compressed/head.S: Assembler messages:

arch/arm/boot/compressed/head.S:[num]: Warning: (null) (it appears a like 30 times.

Then i see, for example

"LD [M] drivers/char/hw_random/rng-core.ko" so i guess it was compiled.

Ok nevermind, the find command DOES FIND the files, but i thought that it didn´t because im used to run cp with -v, and i saw no output and i got confused.

ITS OK THEN.

Something else, after running the kitchen, its faster to press CTRL-C instead of closing/opening the terminal.

Plus you have the log of what you've been doing so far.
[Atrix 4G General] nlabrad:
No current issue, the modules were compiled, i got confused.

I have the kernel zip ready to be tested.

CTRL-C will work in any bash terminal, which is the one that Ubuntu uses.

Instead of closing the terminal, it just ends the current running process (in this case, the kitchen script will end, and you get the prompt ready again).

My english is weak so if you need to change some grammar of this next few lines, feel free to do so:

So far, to compile it in Arch you need to run: (or check if you already have the packages)

pacman -Syu

pacman -S base-devel

pacman -S git

pacman -S bzip2

pacman -S unzip

Then follow the tutorial normally.

Is MROM CM9 = MROM ICS?
[Atrix 4G General] atrix4g18:
Updated Second Post. Take a look.
[Atrix 4G General] nlabrad:
Great, it should work. Im making a nandroid of my current CM7.
[Atrix 4G General] atrix4g18:
I have divided the tutorial into 2 stages.

Start at Stage 2 if you have already built the kernel.
[Atrix 4G General] nlabrad:
Ok i got installation aborted in the recovery :(

I will repeat everything again, don't know what's wrong.
[Atrix 4G General] atrix4g18:
Strange... look inside the zip file and make sure there is "META-INF" "system" and "boot.img"

I am currently building the kernel using the steps in the tutorial.
[Atrix 4G General] Obartuckc:
At the current build, how's the camera doing?

~Sent from my Motorola Atrix 4G Badass~
[Atrix 4G General] atrix4g18:
Camera has been disabled due to battery issues. Check below:

https://github.com/CyanogenMod-Atrix/android_kernel_motorola_olympus/commits/master

The thread has been cleaned. Everything should be straight forward: follow the guide and you will get a kernel.
[Atrix 4G General] beatphreek:
So it has to be 64bit ubuntu? I have a 32bit already running. I can make another if i need to tgough.
[Atrix 4G General] atrix4g18:
I would get 64bit.

The toolchain (linaro.zip) was made for 64bit.

Let me know how it goes.
[Atrix 4G General] mastercarlox:
Ubuntu 9 or 11

Can i use ubuntu 9 or 11? (64bits)
[Atrix 4G General] atrix4g18:
I haven't tested it. You can either try and let us know how it goes or install 12.04 and be certain it will work.

Is there any reason not to upgrade to 12.04?
[Atrix 4G General] odystyle:
so to get this working i need to install ubuntu 64bit on my PC
[Atrix 4G General] atrix4g18:
Yes. I used WUBI. It is fairly simple to install.
[Atrix 4G General] BigJeff:
I have the kernel now in a flashable zip, where is the stock cm10 be epinter that is compatible with the kernel on github? Thanks dawg!
[Atrix 4G General] odystyle:
thnks mate appreciated :)

---------- Post added at 06:56 AM ---------- Previous post was at 06:51 AM ----------

so this kernel will compatible with epinter latest cm10 bulid right
[Atrix 4G General] nlabrad:
It booted fine! Great. So i can say, that the tutorial is ok, and that it works in arch.
[Atrix 4G General] quetzalcoatl2435:
...or you could install it in a virtual machine (I use VirtualBox). Works great either way.
[Atrix 4G General] phazon:
No it doesn't work on debian.

Debian as the wrong version of libc6 for linaro toolchain.

Toolchain is based on Glibc 2.14 but debian has glibc 2.13.
[Atrix 4G General] Xerox98:
atrix4g18 I have a some questions (problems) for you...

They are in the order that they happened....

1.When executing the command

unzip ${HOME}/Downloads/linaro.zip -d ${HOME}/olympus/

about 4/5 of the way through it asks me what I want to do with duplicate files... I just pressed replace, but what did you do..?

2. Does Wi-Fi work for you? Because it seems to not be for me... I this may have to do with pressing yes above.. so I currently rebuilding the kernel and I pressed no this time.

3. Where is the CM10 that can be used with this kernel, can I just flash it over Epinters latest CM10?

4. This kernel supports CM10.1 right? It's just that there are some major problems with it.. isn't it?

The kernel was built on Ubuntu 12.04.2
[Atrix 4G General] odystyle:
well i compile the kernel with the latest ubuntu 12.04 but sadly the kernel wont boot up :(

i used MROM-ICS [CM9] build:20121114 i did full wipe include system before flashing rom
[Atrix 4G General] chxb868:
Thanks for your hard work！
[Atrix 4G General] quetzalcoatl2435:
Kitchen.zip mirror: https://mega.co.nz/#!Uc4D0YiD!bs-f4FLWQTu7Q8FQziY0o3GWRPJWGBl-6-Hhm6nta-k
[Atrix 4G General] wpaiva:
There is no need to flash ramfix and if you do this above the new_kernel.zip you will probably be stuck with "that rom" again :)

Just flash mrom-ics9 > new_kernel > boot into your atrix > reboot it > wipe caches > flash gapps...

By the way: everything is working fine (hwa, battery drain, etc) MINUS camera because it was intentionally disable (drain battery problems)
[Atrix 4G General] atrix4g18:
For CM10 you will need to wait for public release.

For CM9 use latest MROM.

Sorry I don't know what time zone you guys are in but I was sleeping. OP updated with new link.

If anyone still has issues post here even if you already have. Or feel free to PM me.
[Atrix 4G General] atrix4g18:
I made a post in the CM10 thread asking if epinter could make his CM10 compatible with the kernel.

He has a private build that is compatible but it is private so you guys can't use it.

If he releases this you will be able to build the kernel for CM10 and use it.

http://xdaforums.com/showthread.php?t=1781970&page=569
[Atrix 4G General] nlabrad:
I was able to use the camera, or you mean the videocamera?

I had a few reboots, i didnt try without flashing ramfix. I flashed the kernel AFTER the ramfix tho.
[Atrix 4G General] atrix4g18:
Go from stage 2 and don't use ramfix.

The code was updated. You probably built it before. Check below. I know the camera may seem like a feature, but it was removed due to battery issues.

https://github.com/CyanogenMod-Atrix/android_kernel_motorola_olympus/commits/master
[Atrix 4G General] H3llNuN:
I have a few problems:

1. If I start the Command "make clean && make mrproper" it says "command not found" twice.

2. If I start "make -j2 ARCH=arm" it says "waiting for unclosed process" or something like that (my ubuntu is in German)

3. If i try to ignore the first 2 problem and start "cp ${HOME}/olympus/android_kernel_motorola_olympus/arch/arm/boot/zImage ${HOME}/olympus/kitchen/kernel-tools/input/", it says "Data not found".

What I am doing wrong?

Thanks in advance
[Atrix 4G General] ravilov:
Well congrats then, you accomplished precisely nothing. :p

Ramfix modifies the kernel image, what good is it if you're just going to flash a new kernel after that anyway?

Next time you could try actually looking into a ZIP you're about to flash. Someone who's willing to compile and flash a piece of highly unfinished exprimental alpha-quality software like this kernel should have enough technical knowledge to be able to look into a ZIP and know what it does...
[Atrix 4G General] atrix4g18:
Good question.

Check that all the files are in the correct place.

In your home folder there should be a folder named olympus and within that 4 folders: linaro, kernel-working, kitchen, and misc.

After syncing with github there should be a 5th folder: android_kernel_motorola_olympus

Make sure you copy and paste each command correctly and in the right order. You may have missed one.

It seems like something went wrong with your export command. That is the one right before make clean && make mrproper
[Atrix 4G General] quetzalcoatl2435:
I compiled the kernel using the CM10 preset. Boots fine with epinter's jb-new branch. Alternatively, you can use someone's CM10 which (I think) is built from the same sources.

Can't say anything about stability yet, though.
[Atrix 4G General] atrix4g18:
Yeah, if someone wants to compile from epinter's new jb branch it will work.

But that takes some time and knowledge. If you want to make a guide I will link it in this thread and the discussion thread.
[Atrix 4G General] H3llNuN:
I missed the "-" after "gnueabi" -.-

Thank you very much :D

Another question: With wich CM10 should / could I test it?
[Atrix 4G General] atrix4g18:
You will have to compile epinter's jb-new branch.

Also make sure you change the command with CM9 to CM10
[Atrix 4G General] mapkel:
Great theme) :laugh:

made some script to compile kernel. maybe it helps to our dev's

cd ~
wget https://dl.dropboxusercontent.com/u/62868237/kernel.zip
unzip ${HOME}/kernel.zip -d ${HOME}
cd kernel
./script

enjoy...

p.s sorry for my english)

before using script you must

sudo apt-get install -y build-essential kernel-package libncurses5-dev bzip2
sudo apt-get install git
[Atrix 4G General] Ufoex:
flashing the kernel, but the rom still with kernel 2.6
[Atrix 4G General] atrix4g18:
I need more details than that.

What ROM?

What is inside the kernel zip?
[Atrix 4G General] mapkel:
Do you flash ramfix? :laugh:
[Atrix 4G General] jhonnyx:
dafuq? please post contents of the zip in a screenshot
[Atrix 4G General] nlabrad:
Ok but do o need to flash the ramfix or not? Because if its not needed anymore, and i flashed the new kernel over that, it should be the same as not flashing it at all right? So my procedure with or without the ramfix should be the same. ((If its not needed now)
[Atrix 4G General] Ufoex:
already solved, I went back to make another
[Atrix 4G General] nlabrad:
This is what im being asked to replace when unzipping linaro:

replace /home/nicolas/olympus/linaro/arm-unknown-linux-gnueabi/sysroot/usr/lib64? [y]es, [n]o, [A]ll, [N]one, [r]ename: y

error: cannot delete old /home/nicolas/olympus/linaro/arm-unknown-linux-gnueabi/sysroot/usr/lib64

Is a directory

replace /home/nicolas/olympus/linaro/arm-unknown-linux-gnueabi/sysroot/usr/lib32? [y]es, [n]o, [A]ll, [N]one, [r]ename: y

error: cannot delete old /home/nicolas/olympus/linaro/arm-unknown-linux-gnueabi/sysroot/usr/lib32

Is a directory

replace /home/nicolas/olympus/linaro/arm-unknown-linux-gnueabi/sysroot/lib64? [y]es, [n]o, [A]ll, [N]one, [r]ename: y

error: cannot delete old /home/nicolas/olympus/linaro/arm-unknown-linux-gnueabi/sysroot/lib64

Is a directory

replace /home/nicolas/olympus/linaro/arm-unknown-linux-gnueabi/sysroot/lib32? [y]es, [n]o, [A]ll, [N]one, [r]ename: y

error: cannot delete old /home/nicolas/olympus/linaro/arm-unknown-linux-gnueabi/sysroot/lib32

Is a directory

replace /home/nicolas/olympus/linaro/arm-unknown-linux-gnueabi/lib64? [y]es, [n]o, [A]ll, [N]one, [r]ename: y

error: cannot delete old /home/nicolas/olympus/linaro/arm-unknown-linux-gnueabi/lib64

Is a directory

replace /home/nicolas/olympus/linaro/arm-unknown-linux-gnueabi/lib32? [y]es, [n]o, [A]ll, [N]one, [r]ename: y

error: cannot delete old /home/nicolas/olympus/linaro/arm-unknown-linux-gnueabi/lib32

Is a directory

replace /home/nicolas/olympus/linaro/arm-unknown-linux-gnueabi/lib? [y]es, [n]o, [A]ll, [N]one, [r]ename: y

error: cannot delete old /home/nicolas/olympus/linaro/arm-unknown-linux-gnueabi/lib

Is a directory

There are 3 files in the zip at /linaro/arm-unknown-linux-gnueabi/ that are called lib32, lib64 and lib, and other two called lib32 and lib64 in /linaro/arm-unknown-linux-gnueabi/sysroot, that aparently having the same name as the dirs creates a conflict when extracted.
[Atrix 4G General] Xerox98:
Yeah, I Posted this a few pages back, if you press yes it seems to boot with no Wi-Fi, if you press No it wont boot, if you press None it wont boot, I am going to try again using ALL....

EDIT: Actually, since no one else has had this problem yet (or has said about it) I am just going to delete the olympus folder and try again...

EDIT 2: I pressed YES and it is booting on my phone right now... Wi-FI WORKS!
[Atrix 4G General] nlabrad:
Actually, i pressed yes in my first build and i had wifi, booted fine. Anyway, pressing yes doesn't replace the dirs in my case.
[Atrix 4G General] Xerox98:
Yeah, I must have done something wrong :confused: Anyway it works thats the main thing..

I don't think you can use Somebody's 'CM10' with 'those libs', that was discussed in the development thread when someone compiled the kernel and tried to flash it over that it didn't boot.
[Atrix 4G General] atrix4g18:
Always press "Yes" when unzipping.

Wi-Fi worked for me always.
[Atrix 4G General] wpaiva:
Actually I'm using "someone's cm10 with those libs" with my new_kernel.zip compilation without any problems. I just give it a shot, download the rom from XDA forum, generate a new flashable kernel (changing that cm10 path when following the instructions here), flash "someones cm10 with those libs", flash my new_kernel, boot, reboot again, flash epinter's gapps and everything is working amazing (again just camera isn't working)!

No reboots, no battery drain fast, no screen shaking... amazing!
[Atrix 4G General] atrix4g18:
Can you upload it to Mega?

I will update the thread with a link to that as well as a link to CM9 MROM.

This will help everyone out.
[Atrix 4G General] ravilov:
Correct.
[Atrix 4G General] wpaiva:
- ROM: http://xdaforums.com/showthread.php?t=1934662 (look for "NEW 10232012" link on this page > http://www.mediafire.com/?p3cl9j16v828i6y)

My step was: erase data/system/cache/dalvik (full clean) > flash the ROM above > flash my_kernel.zip compilet with CM10 img (instructions on your tutorial - thanks by the way) > boot > everything was fine > reboot > format cache/dalvik > flash gapps on the epinters cm10 page...
[Atrix 4G General] quetzalcoatl2435:
I'm getting random reboots and heat using someone's CM10. I'm gonna try building epinter's CM10 from source later.
[Atrix 4G General] atrix4g18:
Good idea. I'm assuming you didn't have any issues with CM9
[Atrix 4G General] quetzalcoatl2435:
Didn't try CM9. :p
[Atrix 4G General] Xerox98:
So I rebuilt the kernel (CM10 this time) and I have to say that I have had a significant battery drop over CM9... I am using CM10 with 'Those Libs' and my battery was at 39% when I started, now it is at 18% with 1h 2m on battery and 34 minutes screen on... TBH I wouldn't consider this 'good' but a SIGNIFICANT improvement over those libs.
[Atrix 4G General] wpaiva:
Xerox98, I must say that I noted this too. Using cm9 with new_kernel and I end with much more battery time than cm10.

Right now I think that my cm10 battery life time should be a little more higher than "those libs"... about 18 hours...

Well, but I have no reboots, no screen shaking and even my MX player is working correctly ( I have a strange issue when using it on cm9 and new_kernel).
[Atrix 4G General] quetzalcoatl2435:
Really??? I got the same problems as the leak kernel using someone's CM10. Random reboots, overheating, battery drains like crazy... Do you have an external SD card inserted?
[Atrix 4G General] farran:
Last night I did exactly what wpaiva did and it's running beautifully.

For those of you with terrible battery life, overheating and random reboots, I can say that it's almost certainly the MediaScannerService (I think it's called that but it's not running atm).

After booting up, I usually leave it for 5 - 10 minutes to make sure it's finished detecting content, but then I go into Settings → Apps → Running → Media and kill MediaScannerService. Phone cools down, battery usage returns to normal (still not that great but I can get a day out of it), and it'll spontaneously reboot maybe once a week. Afaik it's a CM10 issue, and it's something to do with how external storage works in Jelly Bean.
[Atrix 4G General] todobarato:
Hello,

I have build the kernel on Debian, it works but you need to upgrade to Experimental, where the c lib are new.

I install on the MROM9 and I have the same issue, when screen go off the phone reboots....I need to remove SD-card, this looks like not to kernel related.

Best regards,

Ferenc.