[Step by Step] Build ICS/JB Kernel - Atrix 4G General

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.

The following is for Arch Linux Only. Ignore if you are using Ubuntu
Code:
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:
Code:
sudo apt-get install -y build-essential kernel-package libncurses5-dev bzip2
Code:
sudo apt-get install git
Create a folder named “olympus” in your home directory:
Code:
mkdir ${HOME}/olympus/
Extract the downloaded .zip files to the “olympus” folder (you can use the file manager or the following commands):
Code:
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:
Code:
cd ${HOME}/olympus/
Code:
git clone git://github.com/CyanogenMod-Atrix/android_kernel_motorola_olympus.git
Stage 2 (start here if you are building again).
Code:
cd ${HOME}/olympus/android_kernel_motorola_olympus/
Get the latest updates from git:
Code:
git remote update
Now run the following commands to build the kernel:
Code:
export CROSS_COMPILE=${HOME}/olympus/linaro/bin/arm-unknown-linux-gnueabi-
Code:
make clean && make mrproper
Code:
make -j2 ARCH=arm tegra_olympus_defconfig
Code:
make -j2 ARCH=arm
Now start packing the new kernel and modules:
Code:
cp ${HOME}/olympus/android_kernel_motorola_olympus/arch/arm/boot/zImage ${HOME}/olympus/kitchen/kernel-tools/input/
Code:
cp ${HOME}/olympus/misc/CM9/boot.img ${HOME}/olympus/kitchen/kernel-tools/input/
(Replace CM9 with CM10 for CM10)
Code:
cd ${HOME}/olympus/kitchen/kernel-tools/
Code:
./menu
Press Enter Key
Select Option 1
Press Enter Key (again)
Select Option 1 (again)
Type “olympus” and press Enter Key
Press "Ctrl+C"
Code:
cp ${HOME}/olympus/kitchen/kernel-tools/output/bootimg-contents/initrd.img ${HOME}/olympus/kitchen/kernel-tools/input/
Code:
cd ${HOME}/olympus/kitchen/kernel-tools/
Code:
./menu
Press Enter Key
Select Option 1
Press Enter Key (again)
Select Option 3
Type “olympus” and press Enter Key
Press "Ctrl+C"

Run the following commands:
Code:
cp ${HOME}/olympus/kitchen/kernel-tools/output/boot.img ${HOME}/olympus/kernel-working/
Code:
find ${HOME}/olympus/android_kernel_motorola_olympus/drivers/ -name *.ko -exec cp -f {} ${HOME}/olympus/kernel-working/system/lib/modules/ \;
Code:
cd ${HOME}/olympus/kernel-working/
Code:
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.

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?

I can do it in debian?

mchinand said:
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?
Click to expand...
Click to collapse
They were useless. I have reuploaded. New link in OP.

Ufoex said:
I can do it in debian?
Click to expand...
Click to collapse
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.

atrix4g18 said:
They were useless. I have reuploaded. New link in OP.
Click to expand...
Click to collapse
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.

mchinand said:
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.
Click to expand...
Click to collapse
100 Percent agree. I appreciate the suggestion. As I said the new kernel-working.zip is updated without those files. Check OP.

Thanks

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.

quetzalcoatl2435 said:
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.
Click to expand...
Click to collapse
Second Post Updated. Thanks. (I don't think anyone will have the apt-get error, but if they do I will let them know).

I got that error on apt-get, which is why I mentioned it.
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.

what?
Does the kernel already includes Linaro?
omg Kristian said he'll look at it, so did he? :crying: Happy:crying:

crazymania56 said:
what?
Does the kernel already includes Linaro?
omg Kristian said he'll look at it, so did he? :crying: Happy:crying:
Click to expand...
Click to collapse
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.
quetzalcoatl2435 said:
I got that error on apt-get, which is why I mentioned it.
Click to expand...
Click to collapse
Added to second post. Thanks. Also made a list of credits in the OP and you are in it.

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.

nlabrad said:
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.
Click to expand...
Click to collapse
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.

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.

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?

nlabrad said:
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?
Click to expand...
Click to collapse
Updated Second Post. Take a look.

Related

[HOW-TO] Build CM9 Kernel w/o Building ROM!

For those of you with lower powered computers like me (My computer right now is 2gb RAM, Core 2 Duo) its a hassle every time you build ICS. For me it takes around 10 hours, and half the time the build crashes.
So since I wanted to just get my feet wet with the development going on here as far as the actual ROM, I decided I wanted to go the kernel route.
The actual compilation guides around the internet are just for compiling the kernel and then adding it into the ROM's build directory so that it gets build along with the ROM. The thing is though that if you don't compile the build kernel with the ROM, then it lacks the ramdisk and doesn't boot.
So thanks to the help of jcsullins, we now have a guide for building CM9 without the ROM building It is below. Many parts of this guide were taken from here: https://www.evernote.com/shard/s102...6dfbf53e0fe5/ba173394b43ed99ae6a90a4d1c51210f (by danabw) and from here: http://code.google.com/p/moboot/issues/detail?id=20
This guide assumes you havent build android before on your system. The build requires some extra programs which are explained in the steps below as well.
Where ever there is multiple lines of code, run the code lines one at a time. Also, I am not responsible for anything that happens as a result of this guide, though it works perfectly for me on Ubuntu 10.04 and the CM9 Nightlies.
Without further ado, here it is:
Prerequisites:
-Touchpad (d'oh)
-PC running Ubuntu 10.04 or higher (I recommend 10.04 for the best stability as far as android builds go including this one)
-Run these lines of code to install most of the prerequisites you need for building android (approx 103 mb)
sudo add-apt-repository ppa:ferramroberto/java
sudo apt-get update
sudo apt-get install sun-java6-bin
sudo apt-get install sun-java6-jdk
sudo apt-get install 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
Click to expand...
Click to collapse
1. Create the kernel build directory
mkdir -p ~/android/kernel/
Click to expand...
Click to collapse
2. Get the kernel source.
cd ~/android/kernel/
git clone git://github.com/CyanogenMod/hp-kernel-tenderloin.git -b ics
Click to expand...
Click to collapse
3. Download & install uboot-mkimage and set the PATH to it:
sudo apt-get install uboot-mkimage
PATH=${PATH}:~/usr/bin
Click to expand...
Click to collapse
4. Download & install CodeSourcery for the ARM Toolchain
Click on the link here: https://sourcery.mentor.com/sgpp/lite/arm/portal/release1802
Click "IA32 GNU/Linux Installer"
Let the package download
After done, go to terminal and navigate to your download directory (mine is /home/rohan/Download)
Type these commands:
chmod +x arm-2011.03-42-arm-none-eabi.bin
./arm-2011.03-42-arm-none-eabi.bin
Click to expand...
Click to collapse
Follow the directions it gives you. If it comes up with an error about reconfiguring dpkg, do what the message in the terminal says about turning off a settings. You can reenable this later if you want by doing the same command and choosing yes instead of no.
5. Configure the configuration file
Close out of that terminal and open a new one.
Navigate to the kernel's build folder (the one whose path ends in the folder hp-kernel-tenderloin)
Then type:
make ARCH=arm tenderloin_android_defconfig
Click to expand...
Click to collapse
6. Build the kernel
Type the following into terminal:
make ARCH=arm -j8 CROSS_COMPILE=~/CodeSourcery/Sourcery_G++_Lite/bin/arm-none-eabi- uImage
Click to expand...
Click to collapse
Where it says "-j8" above, replace with the number of CPU/cores on your system. On a dual core system that should be -j8, but -j3 worked fine on my dual core system as well.
This took my system around 7 minutes.
7. Ready the uimage-extractor tool
Go up one directory in your terminal and then do the following commands:
git clone https://code.google.com/p/moboot
cd moboot/tools
gcc -lz uimage-extract.c -o uimage-extract
Click to expand...
Click to collapse
Now grab the uImage.CyanogenMod you have in your Touchpad's /boot folder (via a file manager with root access or adb) and put the uImage in the moboot/tools directory (where the terminal currently is in)
8. Decompile the existing uImage
Type the following:
./uimage-extract uImage.CyanogenMod
Click to expand...
Click to collapse
9. Grab the built uImage and put it in the extracted folder
Type the following:
cp <location to the hp-kernel-tenderloin folder here>/arch/arm/boot/uImage <location to the moboot/tools folder here>/uImage
Click to expand...
Click to collapse
10. Build the new kernel using the old ramdisk and your new built uImage
Type the following:
mkimage -A arm -O linux -T ramdisk -C none -a 0x60000000 -e 0x60000000 -n "Image" -d ramdisk.img uRamdisk
mkimage -A arm -O linux -T multi -a 0x40208000 -e 0x40208000 -C none -n "multi image" -d uImage:uRamdisk uImage.CyanogenMod.new
Click to expand...
Click to collapse
Thats it!
Your new kernel should now be in the moboot/tools directory under the name "uImage.CyanogenMod.new"
Transfer it to the /boot folder of your device and watch your hard work pay off
Again, HUGE thanks to jcsullins for all his work, along with the entire CM Team. It is truly awesome what they have put together!
Nice job man. While I haven't worked on the kernel side of things much, may have to give it more thought now.
Sent from my PG86100 using Tapatalk
Win7
OP,
Is there a similar guide for Win7 aside from Ubuntu? The above process looks manageable and TC in my experience is semi-unbrickable.
austin_dreq said:
OP,
Is there a similar guide for Win7 aside from Ubuntu? The above process looks manageable and TC in my experience is semi-unbrickable.
Click to expand...
Click to collapse
No. </10char>
For ubuntu users:
Instead of the CodeSourcery compilers you could also use the package gcc-arm-linux-gnueabi which has everything you need. Aside from not installing the CodeSourcery compilers the only thing in the guide that needs to be changed is the compile operation:
From
Code:
make ARCH=arm -j8 CROSS_COMPILE=~/CodeSourcery/Sourcery_G++_Lite/bin/arm-none-eabi- uImage
To
Code:
make ARCH=arm -j8 CROSS_COMPILE=arm-linux-gnueabi- uImage
austin_dreq said:
OP,
Is there a similar guide for Win7 aside from Ubuntu? The above process looks manageable and TC in my experience is semi-unbrickable.
Click to expand...
Click to collapse
Over on RootzWiki there is a similar guide for building the kernel that is incorporated into the ROM, using Oracle VM on Win7. It is very clear and wish I would had this when I started building projects and kernels. I believe that is what Rohan was referring to in his OP. So you can follow those steps, including setting up the VM. The main difference then is the last few steps in terms of making the kernel with the ramdisk.
As an aside, my computer system is not very special, an older quad core amd with 8GB memory and I can typically build the ROM in a VM environment, depending on how many new commits there are, in ~30 minutes. But I do tend to build every day to keep up with the commits and thus keep my build time down. In terms of the kernel, as mentioned, I can usually build in only a few minutes. There are many fewer commits to the kernel, so that is pretty static unless you are doing a lot of development yourself.
O.a.T. said:
Over on RootzWiki there is a similar guide for building the kernel that is incorporated into the ROM, using Oracle VM on Win7. It is very clear and wish I would had this when I started building projects and kernels. I believe that is what Rohan was referring to in his OP. So you can follow those steps, including setting up the VM. The main difference then is the last few steps in terms of making the kernel with the ramdisk.
As an aside, my computer system is not very special, an older quad core amd with 8GB memory and I can typically build the ROM in a VM environment, depending on how many new commits there are, in ~30 minutes. But I do tend to build every day to keep up with the commits and thus keep my build time down. In terms of the kernel, as mentioned, I can usually build in only a few minutes. There are many fewer commits to the kernel, so that is pretty static unless you are doing a lot of development yourself.
Click to expand...
Click to collapse
Yeah I want to develop kernels mainly because I've never done it before for Android. I've developed for a Symbian device before since thats my current phone. The Touchpad is my first Android device, and I really hope to get a GNex soon as soon as it is brought to AT&T. If not, I'll probably either switch to VZ since AT&T is getting really annoying.
As for the non-installation of Code Sourcery, thanks! I never knew that package existed! Seems a lot less bloated than the Code Sourcery version.
And also for the developing on Windows, I'd just set up a VM for Ubuntu 10.04. Or you could install wubi, which is a dual boot solution to your Windows predicament. I'm currently running wubi since my only machine right now is old and aging. I need to migrate over to a full dual boot soon though.
This guide can be used on other phones?
sahibunlimited said:
This guide can be used on other phones?
Click to expand...
Click to collapse
If they use the same uImage format then yes. However, I'm not sure if other devices allow you to boot from the uImage, you may need to further compile a boot.img from this. The Touchpad allows this since it needs the uImage for moboot.
rohan32 said:
Yeah I want to develop kernels mainly because I've never done it before for Android. I've developed for a Symbian device before since thats my current phone. The Touchpad is my first Android device, and I really hope to get a GNex soon as soon as it is brought to AT&T. If not, I'll probably either switch to VZ since AT&T is getting really annoying.
Click to expand...
Click to collapse
HTC ONE X<Should have been the Nexus instead of Samsung version.

GUIDE - Compile latest Dzo's 3.0.8 kernel (Aurora)

Ok, in this guide, we'll build our development environment so we can start compiling aurora's kernel (3.0.8) in ubuntu.
NOTES:
- Every command is to be used in the terminal (Applications-Accessories-Terminal).
- There are scripts you can use to automate stuff, I'll post them in the second post on this thread.
- Sorry, I won't guide you on how to install Ubuntu or Android SDK, there are guides on the web all over the place.
1 - First things first, here's what we need:
a) Ubuntu 10.04 LTS x64 (this is recommended by google, it might work in other ubuntu versions, but I didn't tried it). To download it, go to:
http://releases.ubuntu.com/lucid/
And select the 64-bit PC (AMD64) desktop CD version. Your processor must support 64bits (most modern ones support it, else, use the x86 iso, not tested though).
Install ubuntu, you can use dual-boot with windows. I won't post a guide to this, as it's very easy and there are guides all over the net.
b) Install android sdk, to use adb (this is optional, but you really should if you use adb).
Follow this guide:
http://forum.xda-developers.com/showthread.php?t=921169
Note: Eclipse is not needed
c) Install some tools that are needed, like git, compiler stuff etc (this is a single command, copy and paste everythin):
Code:
sudo apt-get install git-core gnupg flex bison gperf build-essential zip curl zlib1g-dev libc6-dev lib32ncurses5-dev ia32-libs x11proto-core-dev libx11-dev lib32readline5-dev lib32z-dev libgl1-mesa-dev g++-multilib mingw32 tofrodos python-markdown libxml2-utils xsltproc abootimg
NOTE: If abootimg doesn't install (It didn't for me, for some reason) go in here, download and install the deb package.
d) Install the toolchain (it's a set of tools used to compile the kernel, I think. This takes a while):
Code:
git clone https://android.googlesource.com/platform/prebuilt
e) Download dzo's kernel from git and set the git branch to "master":
Code:
git clone https://github.com/dzo/kernel_huawei.git
git checkout master
2 - Getting to the fun stuff...
a) First, copy the boot.img attached to this post to your /home/kernel_huawei folder.
b) Set up the environment. Do this, in the terminal (must be done for each compilation session, I'll post scripts in the end, to automate this stuff):
Code:
cd kernel_huawei
export ARCH=arm
export CROSS_COMPILE=/home/username/prebuilt/linux-x86/toolchain/arm-eabi-4.4.3/bin/arm-eabi-
make u8800_defconfig
Note, replace /username/ in the third command with your username.
c) Compile. This takes like 10 minutes, depending on your pc:
Code:
make
TIP - Speedup compilation (thanks to Unrealized)
You can use
Code:
make -jx
to speed up the compilation.
ie, if you have 2 cores, use
Code:
make -j3
for 4
Code:
use -j5
3 - Create the boot.img. If you aren't already in the kernel_huawei folder, do this:
Code:
cd kernel_huawei
Then:
Code:
abootimg -u boot.img -k arch/arm/boot/zImage
After this, the boot.img in your kernel_huawei folder is updated. You can copy that to your phone.
_________________________________________
That's it. In the second post, I'll tell you how to check for latest version, check changelogs and scripts to automate stuff.
If you find any errors, please let me know.
ADDITIONAL STUFF
CHECK FOR UPDATES AND CHANGELOG's
In the terminal:
Code:
cd kernel_huawei
git pull
git log
SCRIPTS
To create a script, create an empty document (no extension), copy the commands and save it. Then right click it, go to "Properties-Permissions" and set it to execute.
To run the script, use the therminal and do:
Code:
cd /path/to/script/file/
./scriptfilename
OR, you can create a shortcut to the script in the panel, for example:
- Right click on the panel and select "Add to panel - Custom application launcher"
- Then, in type, select "Application in terminal"; give it any name, and then browse to the script file.
To run the script just click in the icon in the panel.
a) Automatically download the latest updated files and see what has changed, without compiling:
Code:
cd ~/kernel_huawei
git pull
git log
$SHELL
b) Automatically download the latest updated files, immediately compile and create a new boot.img in the kernel_huawei folder:
Code:
cd ~/kernel_huawei
git pull
export ARCH=arm
export CROSS_COMPILE=/home/username/prebuilt/linux-x86/toolchain/arm-eabi-4.4.3/bin/arm-eabi-
make u8800_defconfig
make
abootimg -u boot.img -k arch/arm/boot/zImage
$SHELL
In this script, you must change the /username/ in the 4th command to your username.
Installing the kernel on the phone
a) Use adb to put the boot.img, (assuming it is on the kernel_huawei folder) in the phone and reboot the phone:
Code:
cd kernel_huawei
adb shell mount -o rw,remount /dev/block/mmcblk0p1 /.cust_backup
adb push boot.img /.cust_backup/image/boot.img
adb shell mount -o ro,remount /dev/block/mmcblk0p1 /.cust_backup
adb reboot
c) Manual installation:
- Copy the updated boot.img to your sdcard.
- Use root explorer (make sure it is set to show hidden files) and copy the boot.img to ./cust_backup/image, replace the original and reboot.
Thank you for this! gonna try it!
whats about pro?
well i dont get any of that... :\
can we use your upload with any rom?
thanks in advance for your replies..
birginioss said:
well i dont get any of that... :\
can we use your upload with any rom?
thanks in advance for your replies..
Click to expand...
Click to collapse
What do you mean? There's no upload here for any ROM... the files here are just for compiling Dzo kernel to use in Aurora... I suggest you ignore this thread if you don't know what this is all about
Sent from my U8800
Matoxas said:
whats about pro?
Click to expand...
Click to collapse
Sorry, this is only for Dzo kernel for Aurora, I know nothing about U8800 pro...
Sent from my U8800
Can you post latest 3.0.8 kernel so we can flash it over cwm. Thx
Sent from my U8800 using Tapatalk 2 Beta-5
boss_y said:
Can you post latest 3.0.8 kernel so we can flash it over cwm. Thx
Sent from my U8800 using Tapatalk 2 Beta-5
Click to expand...
Click to collapse
It's in Aurora's thread, search posts by Dzo, it's 3.0.8 v2...
Sent from my U8800
Thanks
Good Work!
fjsferreira said:
It's in Aurora's thread, search posts by Dzo, it's 3.0.8 v2...
Sent from my U8800
Click to expand...
Click to collapse
so there is a Zip that we can flash?
what are the adventages of this kernel?
Sent from my U8800 using XDA
Great stuff, thanks heaps for this. Finally understand how to compile kernels for this phone now.
levibuko said:
so there is a Zip that we can flash?
what are the adventages of this kernel?
Sent from my U8800 using XDA
Click to expand...
Click to collapse
Yes, Dzo posted the zip already. I suggest you search Aurora's thread and read about what 3,0 kernel does... 1 hint: you'll be amazed
Sent from my U8800
Matoxas said:
whats about pro?
Click to expand...
Click to collapse
just want to explain about the pro version. every kernel needs a defconfig, it's like a configuration while compiling a kernel. but, the pro version have a different defconfig so you must pull it first, the file is /proc/config.gz
about the source, we all know the kernel source of .35 kernel for u8800 and pro version are the same but the defconfig is different. so as fjsferreira said, this source isn't compatible for pro version. unless someone port the 3.0.8 source into the pro version. i don't know how to port the kernel, i just want to tell you what is needed to build a kernel
sorry for my bad english
fjsferreira said:
Yes, Dzo posted the zip already. I suggest you search Aurora's thread and read about what 3,0 kernel does... 1 hint: you'll be amazed
Sent from my U8800
Click to expand...
Click to collapse
i searched for a half hour but didnt find sth....
edit: found the zip
Sent from my U8800 using XDA
levibuko said:
i searched for a half hour but didnt find sth....
edit: found the zip
Sent from my U8800 using XDA
Click to expand...
Click to collapse
Make sure to use v2 with fixed USB storage...
Sent from my U8800
Here, kernel from today, changelog is "Make button backlight even brighter", pretty self explanatory... Again, don't go to aurora thread posting bugs regarding this kernel as it wasn't an "official" dzo release, please...
fjsferreira said:
Here, kernel from today, changelog is "Make button backlight even brighter", pretty self explanatory... Again, don't go to aurora thread posting bugs regarding this kernel as it wasn't an "official" dzo release, please...
Click to expand...
Click to collapse
Should we put this boot.img file while on pink screen.
I read the first page.But i can't see that ,where is the place of boot.img.
Sorry about this silly question
Thank you fjsferreira.
Mr.Moriarty said:
Should we put this boot.img file while on pink screen.
I read the first page.But i can't see that ,where is the place of boot.img.
Sorry about this silly question
Thank you fjsferreira.
Click to expand...
Click to collapse
Yes, if you have usb storage access in pink mode, you can put it in the "image" folder, or you can copy it directly with root explorer to ./cust_backup/image/ and then reboot. If you can't see that folder with root explorer, go to options and make sure it's set to show invisible files. It's in the root of filesystem, where /system/ and /etc/ folders are with all the others
Of course, in both cases, replace the original boot.img.
i have tryed the new kernel "Make button backlight even brighter" and the lights to turn on must change to autobright, but backlight are brighter...

[GUIDE][ICS] Compile Cyanogenmod 9 on Mac OS X Lion

There are a lot of toturials for building CM9 on ubuntu or CM7 on Mac but I couldn't find a decent toturial for building CM9 on Mac (specially Lion). Development in AOSP/CM land is rapid and guides frequently need updating. I had to spend a little time to figure everything out and I decided to share it here.
This tutorial is for building CM9 (ICS) for Galaxy Nexus GSM (maguro) on Mac OS X Lion 10.7.3 using Xcode 4.3 and homebrew . You can easily make the instructions work for most other cm9 devices, but I wouldn't know anything about that.
DISCLAIMER: I'm not responsible if you blow yourself up, blah blah blah
However, I've tried to make this as noob friendly as possible because, well I'm a noob myself
Instrunctions:
UPADTE (MAY 29TH) : The Xcode 4.3 default compiler (llvm-gcc) used to be incompatible with CM9. Thanks to jocelyn and topprospect, the LLVM compatibility patches from mainline AOSP are now merged into CM9. Therefore, you can now use Xcode 4.3 and its command line tools without installing another compiler. However, since GCC is still the only officially supported compiler, incompatibilites with llvm-gcc could still be introduced with future updates. Therefore, if your build fails, it might be worth it to try installing and compiling with GCC 4.2. See the Troubleshooting section for more info.
Now that we have Xcode 4.3 and Xcode command line tools (CLT) installed, let's continue.
Open Terminal and run
Code:
java
if you don't have Java, you will get a prompt asking you to download and install Java. Go ahead and install it.
If you don't have adb and fastboot working, download the android-sdk from google (version r18 as of now) and put it in /usr/local/ and rename the folder to "android-sdk".
Install the homebrew package manager
Code:
/usr/bin/ruby -e "$(/usr/bin/curl -fsSL https://raw.github.com/mxcl/homebrew/master/Library/Contributions/install_homebrew.rb)"
To make sure that homebrew and android-sdk executables are in $PATH:
Code:
touch ~/.bash_profile && echo "PATH=/usr/local/bin:/usr/local/sbin:$PATH:/usr/local/android-sdk/tools:/usr/local/android-sdk/platform-tools" >> ~/.bash_profile
Relaunch Terminal for the change to take effect.
At this point you can run
Code:
brew doctor
to detect any problems there might be (Homebrew may instruct you to use the xcode-select utility to select the xcode installation path). Hopefully, your system is raring to brew
Now we have to install a bunch of packages:
Code:
brew install git coreutils findutils gnu-sed gnupg pngcrush repo
We now need to create a couple of symlinks so that the gnu versions of 'sed' and 'find' are used rather than the osx provided versions :
Code:
ln -s /usr/local/bin/gfind /usr/local/bin/find && ln -s /usr/local/bin/gsed /usr/local/bin/sed && ln -s /usr/local/bin/gstat /usr/local/bin/stat
It's time to create a case sensitive image which will hold our working directory:
Code:
hdiutil create -type SPARSE -fs "Case-sensitive Journaled HFS+" -size 40g -volname "android" -attach ~/Desktop/Android
Now we have a disk image in ~/Desktop/Android. Mount it if it's not mounted already. (Don't be picky about the size, the image will only take as much as space as its contents).
Now we need to create a working directory inside the mounted volume:
Code:
cd /Volumes/android && mkdir cm9 && cd cm9
We can initialize and download the source now:
Code:
repo init -u git://github.com/CyanogenMod/android.git -b ics && repo sync && say 'finished'
Now we need to get the required proprietry files for our device. We can get these from the device itself. Connect your phone (make sure USB Debugging is enabled) and run the following (for maguro):
Code:
cd /Volumes/android/cm9/device/samsung/maguro/ && ./extract-files.sh
[If you see errors in the output from extract-files.sh, see the Troubleshooting section below]
For Google devices,we can also get them directly from google. For maguro, download the 3 files and extract them to /Volumes/android/cm9. Then,
Code:
cd /Volumes/android/cm9
/Volumes/android/cm9/extract-broadcom-maguro.sh
/Volumes/android/cm9/extract-imgtec-maguro.sh
/Volumes/android/cm9/extract-samsung-maguro.sh
We also need the prebuilts (like ROM manager and Term.apk):
Code:
/Volumes/android/cm9/vendor/cm/get-prebuilts
You can optionally tell the build to use the ccache tool. CCache acts as a compiler cache that can be used to speed-up rebuilds :
Code:
export USE_CCACHE=1 && /Volumes/android/cm9/prebuilt/darwin-x86/ccache/ccache -M 20G
Default is 1GB. Anything between 20GB-50GB should be fine.
Before starting the build, we need to workaround an issue with Lion and compiling the QEMU emulator.
[This step doesn't seem to be needed anymore. QEMU is automatically ignored on OS X/Darwin]
If you build now, you're probably gonna get kernel build errors regarding the missing elf.h header (this error might be device specific). Fortunately, we already have this file downloaded, so we only need to copy it to /usr/local/include:
Code:
cp /Volumes/android/cm9/external/elfutils/libelf/elf.h /usr/local/include
FINALLY, we are ready to build:
Code:
cd /Volumes/android/cm9 && source build/envsetup.sh && brunch
Pick your device from the list and enter the number. For maguro, you could use "brunch maguro" instead and skip the menu. Depending on your system, this will take 30min-4hours.
You should now see a beautiful zip file waiting to be flashed:
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
​Troubleshooting:
The extract script for maguro seems to be a little outdated, as it doesn't pull the gps proprietary blob. You can either use the google provided scripts, or add koush's git repository for your device to your local_manifest.xml.
As explained above, the CM9 source is currently compatible with llvm-gcc. In the future, if llvm-gcc fails to build correctly, you should try installing and compiling using GCC4.2 (the Xcode 3 compiler). You can install apple-gcc4.2 from homebrew:
Code:
brew install https://raw.github.com/Homebrew/homebrew-dupes/master/apple-gcc42.rb
This version of gcc can happily coexist with Xcode 4.x .
So now you have GCC 4.2 installed, but it won't be used unless we update the corresposing environment variables:
Code:
export CC=/usr/local/bin/gcc-4.2 && export CXX=/usr/local/bin/g++-4.2
Notice that using the export command is temporary. If you relaunch Terminal, you will need to set these again. However, this is a good thing, because changing these values permanently (by putting them in ~/.bash_profile) can interfere with other builds.
If you use this method, the build might fail while compiling "external/zlib/x86/adler32.c". It appears that a recent change in zlib has introduced an incompatibility with gcc 4.2. you have to revert the following 2 commits:
Code:
cd external/zlib
git revert dd6786cae3f4493faa6661d5f74db587932f15d7
git revert 13bf40af68236c961542bdee1d4b7c0176bf15a0
Alternatively, you can add topprospect's zlib on github (which has those commits reverted) to your local_manifast.xml. Simply run:
Code:
nano /Volumes/android/cm9/.repo/local_manifest.xml
and add the following line
Code:
<project name="dferg/android_external_zlib" path="external/zlib" remote="github" />
If you get a build error, and your error is not covered here, copy the last 20-30 lines of the build output AND the output from the following command into pastebin and post the link. Hopefully me or someone else will help you.
Code:
echo -e "\nENV:\n$(env)\n\nWHICH GCC\n:$(which gcc)\n\nWHICH G++:\n$(which g++)\n\nWHICH CC:\n$(which cc)\n\nWHICH C++:\n$(which c++)\n\nBREW DOCTOR:\n$(brew doctor)\n\nBREW LIST:\n$(brew list)\n\n/USR/BIN:\n$(ls -l /usr/bin | grep gcc)\n\n/USR/LOCAL/BIN:\n$(ls -l /usr/local/bin | grep gcc)\n\n"
​Notes/Extras:
To quickly setup your environment, add an alias like the following to ~/.bash_profile:
Code:
alias cm9env="hdiutil attach PATH-TO-DISK-IMAGE -mountpoint /Volumes/android && cd /Volumes/android/cm9 && source ./build/envsetup.sh && export USE_CCACHE=1"
alias cm9build="cm9env && make clobber && reposync && brunch maguro"
Now you can save time by using "cm9env" to get your environment setup or "cm9build" to compile a clean updated build.
To clear your output directory for a new build, run "make clobber". You probably don't need this if you've only changed a few lines of code.
To cherry pick yet-to-be-merged changes from the gerrit instance:
1. Pick an open commit from CM Gerrit
2. Under list of Patch Sets pick the latest and open cherry-pick tab
3. Check what Git repository the url is pointing e.g. http://review.cyanog...frameworks_base
4. In your CM9 working tree go to the corresponding directory, which in this case is something like ~/your-working-directory/frameworks/base/
5. Now simply paste the whole line seen in CM Gerrit cherry-pick tab e.g. "git fetch http://review.cyanog....rameworks_base refs/changes/00/13100/4 && git cherry-pick FETCH_HEAD"
It should be now included in your next compiled build. When doing repo sync again, cherry picks will be lost.[CREDIT Fihlvein from xda]
Click to expand...
Click to collapse
Enjoy your custom built CM9!
I updated OP with some updated info about Xcode 4.3.
Nice work man. Very helpful.
conantroutman said:
Nice work man. Very helpful.
Click to expand...
Click to collapse
thanks! I'll try to keep this topic updated as issues with mac are introduced/resolved.
Nice write up. Thanks.
Before I start again from scratch I have a question. Does this guide apply to previous versions of mac os x (mine is 10.6.8)? I used the official android initializing build environment page & cm7 wiki page for the instructions to setup my build environment.
Also, any tips to switch from macports to homebrew?
In the past I've had to cherry pick to get my OS X build environment set up for CM9. The compile from source fails because I started with macports instead of homebrew (bad idea). I tried to switch to homebrew without success. Any tips to switch from macports to homebrew?
For the sake of keeping this page on topic a pm response is ok if that is what you prefer.
Hi thanks for this !! Helpful one question what do i change so i can do AOSP instead of cm9??
grad061980 said:
Nice write up. Thanks.
Before I start again from scratch I have a question. Does this guide apply to previous versions of mac os x (mine is 10.6.8)? I used the official android initializing build environment page & cm7 wiki page for the instructions to setup my build environment.
Also, any tips to switch from macports to homebrew?
In the past I've had to cherry pick to get my OS X build environment set up for CM9. The compile from source fails because I started with macports instead of homebrew (bad idea). I tried to switch to homebrew without success. Any tips to switch from macports to homebrew?
For the sake of keeping this page on topic a pm response is ok if that is what you prefer.
Click to expand...
Click to collapse
Yes, this guide should work fine on Snow Leopard. It mostly depends on your Xcode version. If you have Xcode 3, you can skip step 1 entirely, since you already have gcc4.2 as part of Xcode.
If you have access to Xcode 4.2 and above, you will need to install gcc4.2 separately, as explained in the guide.
Now regarding Macports, I strongly suggest that you completely uninstall Macports before installing homebrew. Instructions are here: http://guide.macports.org/chunked/installing.macports.uninstalling.html
WonkyYew said:
Hi thanks for this !! Helpful one question what do i change so i can do AOSP instead of cm9??
Click to expand...
Click to collapse
Full instructions are available on android.com : http://source.android.com/source/initializing.html
If you are using this guide, you need to change the repo initialization command to :
Code:
repo init -u https://android.googlesource.com/platform/manifest
and then do repo sync. You can setup ccache as usual. I don't think AOSP has the "brunch command", so you have to use launch and then make.
Run "lunch" and select an option from the menu. You can find more info about the options here: http://source.android.com/source/building.html. For maguro, you should use "full_maguro-userdebug".
To start the build, use
Code:
make -j$(sysctl -n hw.ncpu)
@ArmanUV. Sounds good & thanks for the input. I'll give the link to macports uninstall a go.
Im a real noob, whats the advantage of compiling from source?
Thanks for the help man !
Hi, thanks for your guide, setting up the repo was no problem at all!
But: I'm getting the following error when building.
Code:
external/zlib/x86/adler32.c: In function ‘adler32_MMX’:
external/zlib/x86/adler32.c:747: error: can't find a register in class ‘GENERAL_REGS’ while reloading ‘asm’
external/zlib/x86/adler32.c:747: error: ‘asm’ operand has impossible constraints
make: *** [out/host/darwin-x86/obj/STATIC_LIBRARIES/libz_intermediates/adler32.o] Error 1
make: *** Waiting for unfinished jobs....
Seems to be a problem with the compiler, but I'm on xcode 4.3 and I've installed gcc-4.2 and set the env vars. Any help?
ArmanUV,
Thanks so much for posting this guide. Very helpful!
Are you having any trouble with errors like this?
Code:
external/zlib/x86/adler32.c: In function ‘adler32_MMX’:
external/zlib/x86/adler32.c:747: error: can't find a register in class ‘GENERAL_REGS’ while reloading ‘asm’
external/zlib/x86/adler32.c:747: error: ‘asm’ operand has impossible constraints
Googling for this error implies that the fix is to use a version of GCC > 4.2. But there does not seem to be a GCC 4.4 in Homebrew.
Thanks again for the guide!
EDIT: Sorry for the double post with empyyy. Seems like there is someone else having my same issue!
topprospect said:
ArmanUV,
Thanks so much for posting this guide. Very helpful!
Are you having any trouble with errors like this?
Code:
external/zlib/x86/adler32.c: In function ‘adler32_MMX’:
external/zlib/x86/adler32.c:747: error: can't find a register in class ‘GENERAL_REGS’ while reloading ‘asm’
external/zlib/x86/adler32.c:747: error: ‘asm’ operand has impossible constraints
Googling for this error implies that the fix is to use a version of GCC > 4.2. But there does not seem to be a GCC 4.4 in Homebrew.
Thanks again for the guide!
EDIT: Sorry for the double post with empyyy. Seems like there is someone else having my same issue!
Click to expand...
Click to collapse
empyyy said:
Hi, thanks for your guide, setting up the repo was no problem at all!
But: I'm getting the following error when building.
Code:
external/zlib/x86/adler32.c: In function ‘adler32_MMX’:
external/zlib/x86/adler32.c:747: error: can't find a register in class ‘GENERAL_REGS’ while reloading ‘asm’
external/zlib/x86/adler32.c:747: error: ‘asm’ operand has impossible constraints
make: *** [out/host/darwin-x86/obj/STATIC_LIBRARIES/libz_intermediates/adler32.o] Error 1
make: *** Waiting for unfinished jobs....
Seems to be a problem with the compiler, but I'm on xcode 4.3 and I've installed gcc-4.2 and set the env vars. Any help?
Click to expand...
Click to collapse
You guys seem to have the same issue. What sort of Xcode configuration are you using? Can you post the output from "which gcc","which g++", "gcc -v", "g++ -v" and "cc -v"?
ArmanUV said:
You guys seem to have the same issue. What sort of Xcode configuration are you using? Can you post the output from "which gcc","which g++", "gcc -v", "g++ -v" and "cc -v"?
Click to expand...
Click to collapse
I am on Lion 10.7.4 with Xcode 4.3.2. Here is the output that you asked for:
Code:
# echo -n "which gcc: "; which gcc; echo -n "which g++: "; which g++; echo ""; echo "gcc -v:"; gcc -v; echo ""; echo "g++ -v:"; g++ -v; echo ""; echo "cc -v:"; cc -v
which gcc: /usr/bin/gcc
which g++: /usr/bin/g++
gcc -v:
Using built-in specs.
Target: i686-apple-darwin11
Configured with: /private/var/tmp/llvmgcc42/llvmgcc42-2336.9~22/src/configure --disable-checking --enable-werror --prefix=/Applications/Xcode.app/Contents/Developer/usr/llvm-gcc-4.2 --mandir=/share/man --enable-languages=c,objc,c++,obj-c++ --program-prefix=llvm- --program-transform-name=/^[cg][^.-]*$/s/$/-4.2/ --with-slibdir=/usr/lib --build=i686-apple-darwin11 --enable-llvm=/private/var/tmp/llvmgcc42/llvmgcc42-2336.9~22/dst-llvmCore/Developer/usr/local --program-prefix=i686-apple-darwin11- --host=x86_64-apple-darwin11 --target=i686-apple-darwin11 --with-gxx-include-dir=/usr/include/c++/4.2.1
Thread model: posix
gcc version 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2336.9.00)
g++ -v:
Using built-in specs.
Target: i686-apple-darwin11
Configured with: /private/var/tmp/llvmgcc42/llvmgcc42-2336.9~22/src/configure --disable-checking --enable-werror --prefix=/Applications/Xcode.app/Contents/Developer/usr/llvm-gcc-4.2 --mandir=/share/man --enable-languages=c,objc,c++,obj-c++ --program-prefix=llvm- --program-transform-name=/^[cg][^.-]*$/s/$/-4.2/ --with-slibdir=/usr/lib --build=i686-apple-darwin11 --enable-llvm=/private/var/tmp/llvmgcc42/llvmgcc42-2336.9~22/dst-llvmCore/Developer/usr/local --program-prefix=i686-apple-darwin11- --host=x86_64-apple-darwin11 --target=i686-apple-darwin11 --with-gxx-include-dir=/usr/include/c++/4.2.1
Thread model: posix
gcc version 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2336.9.00)
cc -v:
Apple clang version 3.1 (tags/Apple/clang-318.0.58) (based on LLVM 3.1svn)
Target: x86_64-apple-darwin11.3.0
Thread model: posix
They are pointing to LLVM, but my CC and CXX variables point to:
Code:
env|grep 4.2
CXX=/usr/local/bin/g++-4.2
CC=/usr/local/bin/gcc-4.2
Do I need to add something to PATH? I'm sure I just missed something obvious in your instructions.. Thanks for helping!
topprospect said:
I am on Lion 10.7.4 with Xcode 4.3.2. Here is the output that you asked for:
Do I need to add something to PATH? I'm sure I just missed something obvious in your instructions.. Thanks for helping!
Click to expand...
Click to collapse
Everything checks out. I'm away from my main machine so I can't run a test build, but I suspect that a recent change is causing problems.
Now, regarding the compiler, Setting CC/CXX *should* take care of everything, but I am currently not 100% sure that somewhere in a makefile, these environment variables aren't being ignored. Since I wrote the guide, I noticed a lot of clang warnings in the build, which means that CC/CXX is not honored and /usr/bin/cc and /usr/bin/c++ is being used.
A more robust method of making sure gcc-4.2 is being used is creating symlinks to gcc-4.2 and g++-4.2 :
Code:
ln -s /usr/local/bin/gcc-4.2 /usr/local/bin/gcc
ln -s /usr/local/bin/gcc-4.2 /usr/local/bin/cc
ln -s /usr/local/bin/g++-4.2 /usr/local/bin/c++
ln -s /usr/local/bin/g++-4.2 /usr/local/bin/g++
Obviousely, a systemic method like this has its downsides but it may be the only choice without having to change CM code (especially since I lack the knowledge to do so )
[I recently found out that master aosp is no longer using CC/CXX to find the compiler (see ./build/core/combo/). Instead, it uses "gcc" and "g++" directly, which means that llvm-gcc will be used no matter what env variable you have. Fortunately, unlike cm9, master aosp is supposed to build fine with llvm-gcc (except for qemu, which doesn't matter for device images). ]
ArmanUV said:
Everything checks out. I'm away from my main machine so I can't run a test build, but I suspect that a recent change is causing problems.
Now, regarding the compiler, Setting CC/CXX *should* take care of everything, but I am currently not 100% sure that somewhere in a makefile, these environment variables aren't being ignored. Since I wrote the guide, I noticed a lot of clang warnings in the build, which means that CC/CXX is not honored and /usr/bin/cc and /usr/bin/c++ is being used.
A more robust method of making sure gcc-4.2 is being used is creating symlinks to gcc-4.2 and g++-4.2 :
Code:
ln -s /usr/local/bin/gcc-4.2 /usr/local/bin/gcc
ln -s /usr/local/bin/gcc-4.2 /usr/local/bin/cc
ln -s /usr/local/bin/g++-4.2 /usr/local/bin/c++
ln -s /usr/local/bin/g++-4.2 /usr/local/bin/g++
Click to expand...
Click to collapse
Okay, just tried this. I created a new dir (/Volumes/Android/bin) that simply houses those softlinks you recommended. Then I put /Volumes/Android/bin at the beginning of my PATH. That should fix it without breaking the rest of the system, e.g. homebrew.
The GENERAL_REGS problem still exists though. Pretty sure b/c gcc 4.2.1 doesn't understand this construct properly (need a newer version of gcc).
So I backed out the change that introduced this adler32.c.
https://github.com/CyanogenMod/android_external_zlib/commit/13bf40af68236c961542bdee1d4b7c0176bf15a0
The compile is getting farther now. I have to run to work so I'll post later if it succeeds.
The weird thing is: This change was made back in December. Why would it have worked for you?
topprospect said:
The compile is getting farther now. I have to run to work so I'll post later if it succeeds.
Click to expand...
Click to collapse
Build works (and boots!) with the following:
Code:
cd external/zlib
git revert dd6786cae3f4493faa6661d5f74db587932f15d7
git revert 13bf40af68236c961542bdee1d4b7c0176bf15a0
Note the 1st revert is just to avoid massive conflicts seen when reverting the 2nd one by itself. The 2nd revert is the one that really matters here.
So this isn't really a solution.. Seems like we need to move to a newer version of gcc or figure out a patch to adler32.c that makes it gcc 4.2 compatible.
topprospect said:
Build works (and boots!) with the following:
Code:
cd external/zlib
git revert dd6786cae3f4493faa6661d5f74db587932f15d7
git revert 13bf40af68236c961542bdee1d4b7c0176bf15a0
Click to expand...
Click to collapse
The first revert works fine, however the second one gives me the following error:
Code:
$ git revert 13bf40af68236c961542bdee1d4b7c0176bf15a0
error: could not revert 13bf40a... Implement vectorized adler32 and optimized slhash
hint: after resolving the conflicts, mark the corrected paths
hint: with 'git add <paths>' or 'git rm <paths>'
hint: and commit the result with 'git commit'
error: Could not parse conflict hunks in zlib.h
empyyy said:
The first revert works fine, however the second one gives me the following error:
Code:
$ git revert 13bf40af68236c961542bdee1d4b7c0176bf15a0
error: could not revert 13bf40a... Implement vectorized adler32 and optimized slhash
hint: after resolving the conflicts, mark the corrected paths
hint: with 'git add <paths>' or 'git rm <paths>'
hint: and commit the result with 'git commit'
error: Could not parse conflict hunks in zlib.h
Click to expand...
Click to collapse
Well, run git status. You'll see that the only conflict is in the comments in zlib.h. So, you can just ignore it.
topprospect said:
Okay, just tried this. I created a new dir (/Volumes/Android/bin) that simply houses those softlinks you recommended. Then I put /Volumes/Android/bin at the beginning of my PATH. That should fix it without breaking the rest of the system, e.g. homebrew.
The GENERAL_REGS problem still exists though. Pretty sure b/c gcc 4.2.1 doesn't understand this construct properly (need a newer version of gcc).
So I backed out the change that introduced this adler32.c.
https://github.com/CyanogenMod/android_external_zlib/commit/13bf40af68236c961542bdee1d4b7c0176bf15a0
The compile is getting farther now. I have to run to work so I'll post later if it succeeds.
The weird thing is: This change was made back in December. Why would it have worked for you?
Click to expand...
Click to collapse
topprospect said:
Build works (and boots!) with the following:
Code:
cd external/zlib
git revert dd6786cae3f4493faa6661d5f74db587932f15d7
git revert 13bf40af68236c961542bdee1d4b7c0176bf15a0
Note the 1st revert is just to avoid massive conflicts seen when reverting the 2nd one by itself. The 2nd revert is the one that really matters here.
So this isn't really a solution.. Seems like we need to move to a newer version of gcc or figure out a patch to adler32.c that makes it gcc 4.2 compatible.
Click to expand...
Click to collapse
Nice find. I tried to compile this morning and I ran into the same issue. This is what I don't understand: I did a couple of builds about a week ago without running into this issue. But, the latest commits on zlib are from 2 months ago.
Amazingly, the Xcode 4.3 toolchain (clang and llvm-gcc) builds this external/zlib/adler32.c just fine.
An alternative to this problem is to install an up to date gcc 4.7 :
Code:
brew install https://raw.github.com/Homebrew/homebrew-dupes/master/gcc.rb
and then create symlinks to gcc-4.7/g++-4.7. I have not tested this yet.

[B928] OC kernel 0.1 [one-hit wonder]

This will not be worked on any longer thanks to Huawei's incompetence. I'm glad my main phone isn't by them. I leave my 0.2 diff attached (which did make my phone faster FWIW - and has fsync() control. Not of use to me, but people who use a modified libsqlite would like it...). Feel free to apply it and see if you can somehow fix dhd.ko loading.
Hi,
Not one for names, so this shall be known as "OC kernel" This is built from the ICS U8800pro source that Huawei put out.
Install at your own risk; I take no responsibilty for any damage that may occur through the usage of this kernel.
Features:
ADB as root
Overclocking enabled (thanks to genokolar)
Undervolting interface added (from genokolar, who took it from a SE kernel modder somewhere) - I think SetXperia can use it
SIO I/O scheduler added
SmartassV2 cpufreq scheduler (AnDyX mod) - although I think ondemand does a bit better IMO
sysfs entry to turn off keypad lights (I wrote an applet for this some time back, I'll dig it out later)
Logcat is always enabled now as the ServiceMenu toggle doesn't work anymore
Minimum display backlight is set to 15, but I think Android needs a framework change to use it. You could try RootDim
Kernel actually builds (and Bluetooth works)
ZRAM (+ swap) support. ZRAM is optimized for Android (taken from Siyah kernel). I'll write up the instructions on enabling this later
CIFS as module
Extras:
Change schedulers and phone speed:
Use a tool like No Frills CPU or SetCPU.
Turn off button lights:
Install the ButtonLight widget and add it to your main screen. I've published the source before in another thread; seek it out if you're after its (bad) code.
It's buggy the first few times you run it, but works fine after that.
Dim screen to 14:
The minimum backlight level is now set to 15. RootDim from the Play Store lets you set it to that.
Mount Windows shares:
Grab CifsMounter and point it to the cifs.ko in /system/lib/modules. You may also need to insmod nls_utf8.ko and md4.ko.
Enable ZRAM (taken from Siyah kernel):
(Note I've not used ZRAM so I have nothing to say on its stability, good or bad)
Grab a BusyBox binary from somewhere
Run the following commands:
Code:
echo 90 > /proc/sys/vm/swappiness #You must set the swappiness high to ensure that the compressed RAM is accessed first!
echo $SIZE > /sys/devices/virtual/block/zram0/disksize #Set size to whatever you wish. 100MB is 104857600 = 100 * 1024 * 1024
busybox mkswap /dev/block/zram0
busybox swapon /dev/block/zram0
Dump the lines in install-recovery.sh if you want to be ZRAMMed every time you boot the phone (although in that case, make sure you have
Code:
busybox swapoff /dev/block/zram0 > /dev/null 2>&1 #Use > /dev/null 2>&1 for every busybox command in install-recovery.sh as it will discard any messages outputted
echo 1 > /sys/devices/virtual/block/zram0/reset
before the lines above)
Install:
Flash the attached ZIP in CWM recovery. You should backup your original boot.img and /system/lib/modules first
Source:
Take http://www.huaweidevice.com/worldwi...=toDownloadFile&flay=software&softid=NDY3NTU= and apply attached diff
at last..xaaxxaa!!but why with modules too???whats their use?
pikachukaki said:
at last..xaaxxaa!!but why with modules too???whats their use?
Click to expand...
Click to collapse
'cause I add a new module - cifs (used by CifsMounter if you want to mount Windows shares) - and because the modules that are originally in /system/lib/modules need to be replaced so that they can load with this kernel (I don't know what those modules do, but I'd rather play it safe)
qwerty12 said:
'cause I add a new module - cifs (used by CifsMounter if you want to mount Windows shares) - and because the modules that are originally in /system/lib/modules need to be replaced so that they can load with this kernel (I don't know what those modules do, but I'd rather play it safe)
Click to expand...
Click to collapse
Boot normally change io to sio and smartassv2...1500mhz lets check..good work..i envy you and i want your guide on compiling...xaaxax im off to bed!!
fps is locked!!xaaxax
pikachukaki said:
Boot normally change io to sio and smartassv2...1500mhz lets check..good work..i envy you and i want your guide on compiling...xaaxax im off to bed!!
fps is locked!!xaaxax
Click to expand...
Click to collapse
I'll write it up sometime - but bear in mind I'm not an expert at this
Regarding FPS: do the install-recovery.sh trick
Only thing I modify in initramfs is the ro.secure setting so that ADB can be ran as root
qwerty12 said:
I'll write it up sometime - but bear in mind I'm not an expert at this
Regarding FPS: do the install-recovery.sh trick
Only thing I modify in initramfs is the ro.secure setting so that ADB can be ran as root
Click to expand...
Click to collapse
You did a great job i couldnt even compile the kernel without changes!!you did great!!
the difference is obvious !!
Sent from my U8800Pro using xda premium
Pika When U add This Kernet To ur ROM?
As expected from qwerty12!
Great job!
I'll also request a guide on how to build the kernel like pika asked.
Hope you continue to improve the kernel! A thanks is simply not enough to thank you for your work, but thanks again
husen4u said:
Pika When U add This Kernet To ur ROM?
Click to expand...
Click to collapse
I wont!just d/w it and flash it!simple!
Sent from my U8800Pro using xda premium
Now what you suggest oc ics or kalo gb?
Sent from my U8800pro using xda app-developers app
husen4u said:
Now what you suggest oc ics or kalo gb?
Sent from my U8800pro using xda app-developers app
Click to expand...
Click to collapse
From now on i wont ever go back to GB ever again! if our luck changes and someone release cm9 i will forget what gb is!! there are some small bugs but the rom is usable for everyday!!
Moihack said:
As expected from qwerty12!
Great job!
Click to expand...
Click to collapse
Thank you
I'll also request a guide on how to build the kernel like pika asked.
Click to expand...
Click to collapse
Certainly, sir.
Hope you continue to improve the kernel! A thanks is simply not enough to thank you for your work, but thanks again
Click to expand...
Click to collapse
Unfortunately I won't be working on this anymore unless Huawei get back to my request for the source to the the dhd.ko module (which they may not have to comply with because the license for the module states "Unless you and Broadcom execute a separate written software license agreement governing use of this software" so the U8800pro version may not be under GPL). I made (well, found on the Internet) more optimizations but the Wi-Fi refuses to turn on because the dhd.ko module refuses to load. Only way I can get something working is to build the source that Huawei give or attempt to force other versions of the bcm source to load, but it's unlikely that would work.
--
Anyway, a small guide.
I used an x86_64 laptop running (X)ubuntu 12.04.1 to follow these steps. This page was a great resource.
Prerequisites:
A computer running GNU/Linux (a Mac should work in theory - the same toolchain we use is built for it, too, but I have no idea how OS X works)
git installed (apt-get install --no-install-recommends git-core is enough under Ubuntu)
sudo apt-get install flex bison gperf build-essential libncurses5-dev zlib1g-dev ia32-libs lib32z1-dev lib32ncurses5-dev gcc-multilib g++-multilib abootimg
Getting ADB working
One of the best things to do is getting ADB set up, as you then have easy communication with the device. It's not essential but you'll just end up wasting time transferring files through other, longer means.
Grab the Linux platform tools ZIP from here: http://www.hariadi.org/android/manually-download-of-android-sdk-tools-and-sdk-platform-tools/. Extract the adb binary from the zip file, preferably to somewhere in your $PATH. chmod 755 it. chown, if necessary.
Next, open http://aur.archlinux.org/packages/an/android-udev/android-udev.tar.gz and, doing all this as root (sudo in Terminal etc.), place 51-android.rules in /lib/udev/rules.d/ (not the best place - but it works), chmod 644 it and chown root:root it.
Next, execute /usr/sbin/groupadd adbusers, followed by gpasswd -a USERNAME adbusers, USERNAME being the user you normally log on with.
Restart (while you can force Linux to see the new group through the, well, newgrp command udev will not "see" the new rule, despite how much you try with udevadm).
That should be ADB set up (give it a test, remembering to enable USB debugging mode on the phone first!).
On to preparing your workarea.
--
Create a new folder in your home folder and cd to it. This folder will house the prebuilt folder of toolchains and other stuff, and the kernel source in a folder of its own.
In this folder, execute git clone --depth 1 https://android.googlesource.com/platform/prebuilt.git and move onto the next step, since the download takes a while. That command grabs the prebuilt toolchain from Google using Git, but doesn't obtain a deep history for each file to make the download quicker.
Open http://www.huaweidevice.com/worldwi...=toDownloadFile&flay=software&softid=NDY3NTU= and save the source to your Downloads directory. After git has finished running, still in the folder with the "prebuilt" folder, execute tar jxf ~/Downloads/HUAWEI_U8800pro<tab - as in actually press tab> and you should have a kernel folder alongside the prebuilt one.
Building the kernel
cd to this new kernel folder.
First things first: make sure that Bluetooth is properly enabled by editing the Makefile. Find the line #ifeq ($(ENABLE_BTLA_VER30),true) and comment out every line in that section except for KBUILD_CFLAGS += -DHUAWEI_BT_BTLA_VER30 so you end up with this:
Code:
#/* < DTS2012020604357 zhangyun 20120206 begin */
# Add Huawei Marco for different BT chip
#ifeq ($(ENABLE_BTLA_VER30),true)
KBUILD_CFLAGS += -DHUAWEI_BT_BTLA_VER30
#endif
#ifeq ($(ENABLE_BLUEZ_VER30),true)
#KBUILD_CFLAGS += -DHUAWEI_BT_BLUEZ_VER30
#endif
#/* DTS2012020604357 zhangyun 20120206 end > */
Commenting out the offending code leaves you with a kernel that builds but a Bluetooth module that won't start up - the same also applies if you try to build with the other define.
You can also make things easier for yourself by replacing the following
Code:
ARCH ?= $(SUBARCH)
CROSS_COMPILE ?= $(CONFIG_CROSS_COMPILE:"%"=%)
with
Code:
ARCH ?= arm
CROSS_COMPILE ?= ../prebuilt/linux-x86/toolchain/arm-eabi-4.4.3/bin/arm-eabi-
else you will have to put "ARCH=arm CROSS_COMPILE=../prebuilt/linux-x86/toolchain/arm-eabi-4.4.3/bin/arm-eabi-" after "make" each time. Remember this as I'll be assuming that you went for the option to edit the Makefile. I also assume that the prebuilt folder is above the kernel one. Adjust CROSS_COMPILE if necessary.
The ARCH variable is self-explanatory, but the CROSS_COMPILE variable (and the toolchain that it's pointing to) need to be set because the standard GNU development tools that apt installs don't produce output that an ARM processor can understand. So you cross-compile: the tools are for the X86 architecture but produce ARM output. 4.4.3 is chosen because the stock kernel is compiled with GCC 4.4.3 (if you run "adb shell cat /proc/version" you'll see). The arm-eabi-4.4.3 folder is chosen over arm-linux-androideabi-4.4.x because it specifies that magic "3" (I know, bad way to decide but it works), and over i686-android-linux-4.4.3 because we don't want to produce code for the PC.
Get the current configuration in use by the stock kernel (as that's a good point to start from - a known working configuration): http://wiki.cyanogenmod.com/wiki/Building_Kernel_from_source#Configure_the_Build
I'd also recommend placing a copy of .config as arch/arm/configs/<your funky name here> so that if .config gets deleted (make clean etc.) you can run make <the name you gave to the file in arch/arm/configs> and have .config come back again.
(cp arch/arm/configs/<the name you gave to the file> .config if you didn't modify the Makefile to specify the ARM arch.)
Run make oldconfig (not always necessary - generally it's invoked if you've applied a patch that introduces a new config option and the option then needs to go into your .config. Run make menuconfig afterwards and customize away.
When you're done, run make -jX - X as in the number of cores you have + 1. So, in my case, with a quad-core processor and HyperThreading enabled on all of them, "make -j9" works for me. If the compile went OK, you'll be left with a message saying that arch/arm/boot/zImage is ready. If not, run "make" without the -jX argument and make should stop where the error occurs. Have fun fixing the error!
Assuming that you have a new, shiny zImage, it's now time to put it into your boot.img.
Updating your boot.img:
Google have tools for this purpose but I've never used them so I don't know how they work. abootimg works fine for this, however.
Pull the current boot.img off your phone: adb pull /.cust_backup/image/boot.img.. I'd recommend creating a backup somewhere.
Create a new directory to store the boot.img in on your computer and run abootimg -x boot.img (if you had fun enabling every option in the kernel, you'll see why I'm telling you to use the -x option first rather than directly use the -u option). Now run abootimg -u boot.img -k <path to your newly built zImage>.
If this succeeds, yay! If not and you're told it's too big for the boot image, then don't worry. Take the size it's saying that the zImage is and convert that number into hex. Edit bootimg.cfg and change the value of the bootsize setting into the number you just converted into hex. We'll now repack again, but this time running abootimg -u boot.img -f bootimg.cfg -k <path to your newly built zImage>. This should work.
Sending the boot.img to the phone
If your ADB is already running as root, you can do the following to upload the new bootimg:
Code:
adb shell mount -o remount,rw /.cust_backup
adb push boot.img /.cust_backup/image/
adb reboot
If not, just reboot into pink screen mode and copy and paste.
Check System Settings and the version number should've changed. Congratulations!
Extras
Installing the modules:
OK, so you decided to build parts of the kernel as a module and you want to actually, y'know, have the modules present on the device. After building the kernel, execute:
make INSTALL_MOD_STRIP=1 modules_install INSTALL_MOD_PATH=<any folder name here>
If you look in that folder, you'll find the modules neatly wrapped up in folders, along with other text files. These text files are useless on a stock ROM because there's no modprobe - you need BusyBox for that. And since we don't want to have them seperated in folders (this is how the stock kernel does it), the files would be wrong, anyway. If you want to use modprobe and have BusyBox installed, you can run depmod on the phone after transferring the modules.
To get the modules into one folder make the directory "modules" in a folder higher-up to where the modules are stored, and then run for i in `find . | grep ko`; do mv "$i" ../modules/; done to move them into that folder.
At this point, I'd just recommend using my OC_Kernel.zip and replacing the modules in that. Or you can adb push them over to the /system/lib/modules folder (after issuing an "adb remount" - assuming that ADB is running as root in the first place).
Making ADB run as root:
As root on your computer, (we want to preserve permissions) use abootimg to split the boot image and extract the contents of the initrd:
abootimg -x boot.img && mkdir newramdisk && cd newramdisk && zcat ../initrd.img | cpio -i --no-absolute-filenames (--no-absolute-filenames is important! I trashed a Ubuntu install by leaving it out - the initrd contains ARM binaries of core Linux programs and if the initrd.img contains an absolute path of "/" then these files will get placed in /)
Make any changes you desire to the initrd. To have adb run as root, just edit /default.prop and set ro.secure to 0. Make sure that the editor you used didn't leave any backup files.
When you're done, run find . -print | cpio -o -H newc | gzip -n -9 > ../initrd.img and this will put the modified initrd folder back into initrd.img.
After that run cd .. ; abootimg -u boot.img -r initrd.img to actually put the initrd.img back into the boot.img.
If you run into a space error, you can do one of three things:
if you only made a single change (like enabling ADB), check to see that there is no backup file (default.prop~) littered about
you can remove the lengthy comments and copyright notices from the files to make space
you can use the trick we used earlier with abootimg to increase the size number in bootimg.cfg for the initrd
Overclocking:
Just look at the acpuclock C file (and possibly relevant cpufreq changes - but I can't remember) in my "OC kernel" diff. Make sure that the option in the kernel config is selected to limit the speeds to the U8800pro's native 1GHz, otherwise the phone will boot at 2GHz!
Rebuilding the Wi-Fi module:
I hope to be able to write this one since it's apparently needed in some cases, but it depends on if Huawei come through
any idea about this error?
drivers/mfd/pmic8058.c:327: error: rtc_cell_resources causes a section type conflict
drivers/mfd/pmic8058.c:327: error: rtc_cell_resources causes a section type conflict
drivers/mfd/pmic8058.c:241: error: othc0_cell_resources causes a section type conflict
drivers/mfd/pmic8058.c:241: error: othc0_cell_resources causes a section type conflict
drivers/mfd/pmic8058.c:250: error: othc1_cell_resources causes a section type conflict
drivers/mfd/pmic8058.c:250: error: othc1_cell_resources causes a section type conflict
drivers/mfd/pmic8058.c:261: error: othc2_cell_resources causes a section type conflict
drivers/mfd/pmic8058.c:261: error: othc2_cell_resources causes a section type conflict
drivers/mfd/pmic8058.c:183: error: misc_cell_resources causes a section type conflict
drivers/mfd/pmic8058.c:183: error: misc_cell_resources causes a section type conflict
drivers/mfd/pmic8058.c:210: error: thermal_alarm_cell_resources causes a section type conflict
drivers/mfd/pmic8058.c:210: error: thermal_alarm_cell_resources causes a section type conflict
drivers/mfd/pmic8058.c:270: error: batt_alarm_cell_resources causes a section type conflict
drivers/mfd/pmic8058.c:270: error: batt_alarm_cell_resources causes a section type conflict
drivers/mfd/pmic8058.c:152: error: pm8058_charger_resources causes a section type conflict
drivers/mfd/pmic8058.c:152: error: pm8058_charger_resources causes a section type conflict
matteof93 said:
any idea about this error?
drivers/mfd/pmic8058.c:327: error: rtc_cell_resources causes a section type conflict
drivers/mfd/pmic8058.c:327: error: rtc_cell_resources causes a section type conflict
drivers/mfd/pmic8058.c:241: error: othc0_cell_resources causes a section type conflict
drivers/mfd/pmic8058.c:241: error: othc0_cell_resources causes a section type conflict
drivers/mfd/pmic8058.c:250: error: othc1_cell_resources causes a section type conflict
drivers/mfd/pmic8058.c:250: error: othc1_cell_resources causes a section type conflict
drivers/mfd/pmic8058.c:261: error: othc2_cell_resources causes a section type conflict
drivers/mfd/pmic8058.c:261: error: othc2_cell_resources causes a section type conflict
drivers/mfd/pmic8058.c:183: error: misc_cell_resources causes a section type conflict
drivers/mfd/pmic8058.c:183: error: misc_cell_resources causes a section type conflict
drivers/mfd/pmic8058.c:210: error: thermal_alarm_cell_resources causes a section type conflict
drivers/mfd/pmic8058.c:210: error: thermal_alarm_cell_resources causes a section type conflict
drivers/mfd/pmic8058.c:270: error: batt_alarm_cell_resources causes a section type conflict
drivers/mfd/pmic8058.c:270: error: batt_alarm_cell_resources causes a section type conflict
drivers/mfd/pmic8058.c:152: error: pm8058_charger_resources causes a section type conflict
drivers/mfd/pmic8058.c:152: error: pm8058_charger_resources causes a section type conflict
Click to expand...
Click to collapse
Honestly, I have no idea. What toolchain are you using and where was your .config obtained from? Even when the Bluetooth thing was giving me errors, I never once saw that
same toolchain you have used. i have tried with ubuntu 12.04 x64 and ubuntu 10.04 x86 but same problem.....i have obtained my config from my phone using adb command
matteof93 said:
same toolchain you have used. i have tried with ubuntu 12.04 x64 and ubuntu 10.04 x86 but same problem.....i have obtained my config from my phone using adb command
Click to expand...
Click to collapse
I don't know why the same toolchain works on my laptop but not yours :\
Someone with a similar problem (same?) solved it by using an older toolchain: http://forum.xda-developers.com/showpost.php?p=27294383&postcount=7157
thanks thanks thanks.....i saw that post this morning but i did not noticed the post with the solution
UPDATE: NOW KERNEL COMPILED CORRECTLY....this means that tomorrow i know what to do
ZRAM (+ swap) support. ZRAM is optimized for Android (taken from Siyah kernel). I'll write up the instructions on enabling this later
qwerty your owning us some instructions!!xaaxxa
pikachukaki said:
qwerty your owning us some instructions!!xaaxxa
Click to expand...
Click to collapse
Done, check the first post
I also won't be working on this. My email (which does clearly state what I want, even if it's long-winded):
Dear Sir/Madam,
I recently built a kernel for my U8800pro from your sources and it
works fine, except that the Wi-Fi will not start because the dhd.ko
module that comes with the B928 firmware refuses to load into my
modified kernel. After looking around, the bcm4329 source is what I
need to build (usually distributed outside of the kernel); however, it
seems that the U8800pro uses a customized version. After looking at
the strings of the dhd.ko on the B928 firmware, I have seen many
strings that are present in that dhd.ko binary do not appear in:
* bcm_4.218.248.6_7x25_wifi_driver.tar from the Huawei Device website,
despite it having the same version number
* the bcm4329 source in the Qualcomm CodeAurora Git repository
* the bcm4329 source on the NyVIDIA Tegra Git repository
Furthermore, the strings also do not appear in the ICS kernel nor the
Gingerbread one. I can only conclude that Huawei have their own
specialized version of the bcm4329 4.218.248.6 source for the U8800pro
that is distributed outside the kernel. I understand that Qualcomm
allow the option to let the vendor arrange to have the code
distributed under a different license provided that the vendor makes
an agreement beforehand with Qualcomm. Otherwise it becomes GPLed by
default. If Huawei chose to make an agreement, then I have no right to
ask. However, I believe it is still licensed under the GPL for two
reasons:
* Running modinfo on the dhd.ko from the B928 firmware says this:
"license: GPL v2
* Both bcm_4.218.248.6_7x25_wifi_driver.tar.gz and
[S7][SoftWare]S7_Broadcom_BCM4329_4.218.205.0_Open_Source are under
the GPL
I would like to request the source code, please, of the bcm4329
4.218.248.6 source that is modified for the U8800pro if the code is
under the GPL
Best regards
Click to expand...
Click to collapse
was met with the following generic response:
Dear Customer,
Thank you for contacting Huawei device.
This is our website link http://www.huaweidevice.com/worldwide/searchResult.
do?method=execute&searchString=U8800pro where you can download the secure
code for U8800pro to you.
Once again thank you for contacting Huawei device.
Best Regards.
Huawei Device Customer Care Team.
Click to expand...
Click to collapse
Since my U8800pro is not my main phone anymore, I do not have the energy to fight. Nor do I want to work on Huawei's kernel, where you have to be careful about what you change or the Wi-Fi module won't load (and Huawei won't give you the source - which they should do since I'm sure it's under GPL). matteof93 will most likely produce something better or when everyone starts producing their own kernels and make enough improvements to be hit with the same issue as I, they'll start to get more emails and listen
@qwerty at the last command it said that device is busy...also is there any way that you can make it for init.d so it will be easier??thx!!

[GUIDE][TUT]Building a kernel from source[EASY WAY]

Hi guys!
I wrote this guide because after a few month of kernel development i found useful tools and tricks than helped me a lot and speeded up my work and i want to share with you this knowledge.
Setup computer and download sources​
Code:
Minumum reqirement:
* C knowledge
* Ubuntu 12.04 or higher, 32 bit or 64 bit (13.10 if you want use Kdevelop + linux kernel plugin)
* Internet connection, possibly fast and unlimited
* the boot.img of the ROM you want to support with your kernel (AOSP, SENSE etc etc...)
* [URL="http://forum.xda-developers.com/showthread.php?t=2519416"]zImage switcher[/URL]
NOTE:
Some toolchains dont work on 32 bit. Using 64 bit is recommended.
Install required package:
Linux 12.04;
Code:
sudo apt-get install -y build-essential kernel-package libncurses5-dev bzip2 bin86 libqt3-headers libqt3-mt-dev wget libncurses5 git-core nautilus-open-terminal
linux 13.10(and above):
Code:
sudo apt-get install -y build-essential kernel-package libncurses5-dev bzip2 bin86 qt4-dev-tools wget libncurses5 git-core nautilus-open-terminal
and restart your PC.
Download Source:
Go to /home/, create a new folder called "kernel", and enter in that folder.
right click somewhere in "kernel" folder and select "open terminal here" (CooL AH?)
and run
Code:
git clone https://github.com/pawitp/android_kernel_samsung_i9082.git -b cm-11.0
Download the toolchain
There are a lot of toolchain, stock, linaro optimized, based on gcc 4.7, based on gcc 4.8 the choice is yours! in this tutorial we use google gcc 4.8 toolchain.
NOTE:
this toolchain below will not work with 32 bit. Use the arm-eabi-4.4.3, from the ndk toolchains, and if you need any help on its path, or anything, reply in this thread.
Go to /home/, create a new folder called "toolchains", and enter in that folder.
right click -> open terminal here
Code:
git clone https://android.googlesource.com/platform/prebuilts/gcc/linux-x86/arm/arm-eabi-4.8
Build the kernel​
Build the kernel:
in this part we will work in "/home//kernel/android_kernel_samsung_i9082" folder, i'll call it
go to "/arch/arm/configs" and copy "cyanogenmod_i9082_defconfig" to
rename cyanogenmod_i9082_defconfig to ".config"
open a terminal window in
type:
Code:
make ARCH=arm CROSS_COMPILE=/home/toolchains/arm-eabi-4.8/bin/arm-eabi- > compileLog
and the compilation will start.
Some explanation:
"ARCH=arm" tells to compiler what arch the kernel is made for
"CROSS_COMPILE=xxxxxx" tells to "make" the compiler to use
"> compileLog" saves all the messages in a file called compileLog, it's easier to read than terminal window
Click to expand...
Click to collapse
Pack the kernel to boot.img:
Unpack zImage switcher somewhere, i'll call that folder .(for 32 bit, download both 64 bit and 32 bit and copy the files "mkbootfs" "mkbootimg" from tools folder of 32 bit one and replace these files with the files in tools folder of 64 bit one)
copy the stock boot.img and your zImage in the folder , you can find it in /arch/arm/boot.
run the script
Code:
./repack.sh
now in there's a new file called newBoot.img, that's your kernel!
to find the modules (*.ko files) open a teminal windows to and type
Code:
find ./ -name "*.ko" -exec cp {} <absolute/path/destination/folder> \;
now you have the boot.img and the modules, download a custom kernel and use the flashable zip to make your flashable zip, just replace the modules and the boot.img!
Add features​Add features to kernel:
"Woah! i'd like to add smartass v2 governor and sio i/o scheduler to my kernel"
First you need to find a git repository that contains smartass v2 governor and sio i/o scheduler, then the commit that added the governor and sio i/o scheduler.
for example https://github.com/akiratoriyama/an...mmit/6a43329a08ec0282e951049ae15a497b121aa8ef
Open a terminal window in
type:
Code:
git remote add akiratoriyama https://github.com/akiratoriyama/android_kernel_samsung_i9082.git -b experimental
git fetch akiratoriyama
git cherry-pick 6a43329a08ec0282e951049ae15a497b121aa8ef
NOTE:
I have used akiratoriyama's github as reference. If you want to add any other features,like f2fs or frandom module, you can ask the dev to help you or you can simply cherry-pick the code. Remember to thank everyone you borrowed the code from and mention them in your thread, whenever you release your kernel.
in termial window type:
Code:
make ARCH=arm xconfig
will open a new window where you can configure your kernel's features
press ctrl+f (find) and serach for "smartass2" and "sio" and tick the checkbox. save clicking the floppy disk in upper left corner.
the modified configuration file will be saved in ".config"
now we can build the kernel again, but first type
Code:
make ARCH=arm clean CROSS_COMPILE=/home/toolchains/prebuilts_gcc_linux-x86_arm_arm-linux-androideabi-4.8/bin/arm-linux-androideabi-
this will remove all the compiled files of previous build.
View git commits history​you can easly view all the commits in your repo:
open a terminal window in and type
Code:
gitk
will open a GUI where you can see all the commits, what files were modified for each commit, the author of the commit.
you can also revert commits.
There are other GUI for git, i also like "gitg"
Hacking the kernel
suggested by @pirlano​for easy work on kernel sources, add features & co. you can use kdevelop + linux kernel plugin, here is a guide
http://www.gnurou.org/code/kdevelop-kernel
and a video guide:
http://video.linux.com/videos/kernel-browsing-and-hacking-using-kdevelop
NOTE: for linux kernel plugin ubuntu 13.10 is required
CREDITS:
@rmbq, this is his guide. I just modified and compiled it especially for our device. Thanks,rmbq.
this guide only applies to kk based kernels. if you want to build a stock kernel,just download sources of 4.2 and start building!!!
If you have any doubts or questions,dont hesitate to reply in this thread.
Thanks for using my github as reference but I'd like to recommend my last 2 commits for adding smartassH3 to be included in this guide as they were clean and more proper IMO. This+k2wl's guide will help newbies to compile a kernel.
akiratoriyama said:
Thanks for using my github as reference but I'd like to recommend my last 2 commits for adding smartassH3 to be included in this guide as they were clean and more proper IMO. This+k2wl's guide will help newbies to compile a kernel.
Click to expand...
Click to collapse
But I just used those commits as reference. If users think that these commits are not proper, they can revert them and use your smartassh3 commit.
Sent from my GT-I9082 using Tapatalk Pro.

Categories

Resources