[GUIDE] Rebuilding Android Kernel (Incl. Mali Overclock)

Moderators: odroid, mdrjr

[GUIDE] Rebuilding Android Kernel (Incl. Mali Overclock)

Unread postby mdrjr » Mon Feb 25, 2013 11:39 am

For this guide you'll need:

A regular PC running Ubuntu (or any other Linux distro).
sudo apt-get install build-essential libqt4-dev xz
those are dependencies for this guide.

Kernel sources for Android: http://dn.odroid.com/Android_Alpha_4.0. ... 412.tar.gz
(this is just a example of a kernel source, you can ALWAYS grab the newest BSP that will come with the newest Android Kernel possible)

Toolchain: http://www.mdrjr.net/odroid/tools/arm-2010q1.tar.xz

Android SDK with adb working!!!!

1. Unpack and configure toolchain:
tar -Jxvf arm-2010q1.tar.xz
cd arm-2010q1/bin
export CROSS_COMPILE=`pwd`/arm-none-linux-gnueabi-

2. Unpack the kernel sources.
tar zxvf kernel_4412.tar.gz
cd kernel_4412

3. Configure it for your board/storage type:
ls arch/arm/configs/odroid*android*
Code: Select all
odroidq2_android_defconfig       odroidu2_android_sdmmc_defconfig  odroidx2_android_emmc_defconfig        odroidx_android_emmc_defconfig
odroidq_android_defconfig        odroidu_android_emmc_defconfig    odroidx2_android_sdmmc_defconfig       odroidx_android_sdmmc_defconfig
odroidu2_android_emmc_defconfig  odroidu_android_sdmmc_defconfig   odroidx_android_42Inch_demo_defconfig


I'll set as example for this, odroidx2 using eMMC. You can choose anything else!

make ARCH=arm odroidx2_android_emmc_defconfig


4. Build the kernel and modules!
make -j4 ARCH=arm zImage modules

This should takes a few minutes.....

5. Copying modules:
adb remount
for module in `find . -iname *.ko`; do adb push $module /system/lib/modules ; done

6. Copying the kernel:
adb push arch/arm/boot/zImage /system/lib/modules

7. Flashing the kernel from Android itself:
adb shell
cd /system/lib/modules
busybox dd conv=notrunc seek=2455 bs=512 if=zImage of=/dev/block/mmcblk0
sync
exit
adb reboot


Note: For XU you have to switch seek=2455 to seek=1263

8. Enjoy your new Android kernel ;)
mdrjr
Site Admin
 
Posts: 8168
Joined: Fri Feb 22, 2013 11:34 pm
Location: Brazil
languages_spoken: english, portuguese
ODROIDs: -

Re: [GUIDE] Rebuilding Android Kernel (Incl. Mali Overclock)

Unread postby mdrjr » Mon Feb 25, 2013 11:40 am

Mali overclock!

To be added between steps 3 and 4.

1. edit the .config file
2. Search for MALI_OVERCLOCK
Code: Select all
# CONFIG_MALI_OVERCLOCK_533 is not set
# CONFIG_MALI_OVERCLOCK_640 is not set
# CONFIG_MALI_OVERCLOCK_733 is not set
# CONFIG_MALI_OVERCLOCK_800 is not set

3. Change one of those that you may want. to something like:
CONFIG_MALI_OVERCLOCK_640=y


By default Mali runs at 440Mhz, but you can try higher frequencies. I've let up to 800Mhz because that's the max that -U2 can do.. so.. results may not be the same for everyone ;)
mdrjr
Site Admin
 
Posts: 8168
Joined: Fri Feb 22, 2013 11:34 pm
Location: Brazil
languages_spoken: english, portuguese
ODROIDs: -

Re: [GUIDE] Rebuilding Android Kernel (Incl. Mali Overclock)

Unread postby sert00 » Mon Feb 25, 2013 4:00 pm

in the first command when i try to install it say that xz packet isn't finded.then i tried the same command without xz in the end,all good and download 27mb (mint 14 64bit)
Last edited by sert00 on Mon Feb 25, 2013 6:48 pm, edited 1 time in total.
2x Odroid-U2
Odroid-XU-E
Odroid-U3
Lcd touch panel 10.1"
2x Emmc 16gb
Emmc 8gb
Emmc 64gb
IO-board
IO-shield
Expansion board
Wifi dongle 2\3
Gigabit LAN
Sata3 HDDock
USB3.0 OTG Adapter
Smart Power
2x UART Module
BT dongle
User avatar
sert00
 
Posts: 721
Joined: Sun Feb 24, 2013 12:26 am
languages_spoken: english,italian
ODROIDs: 2*U2/XU-E/U3

Re: [GUIDE] Rebuilding Android Kernel (Incl. Mali Overclock)

Unread postby mdrjr » Mon Feb 25, 2013 6:21 pm

I guess that you downloaded while I was uploading...
mdrjr
Site Admin
 
Posts: 8168
Joined: Fri Feb 22, 2013 11:34 pm
Location: Brazil
languages_spoken: english, portuguese
ODROIDs: -

Re: [GUIDE] Rebuilding Android Kernel (Incl. Mali Overclock)

Unread postby sert00 » Mon Feb 25, 2013 6:47 pm

i referred to this command
sudo apt-get install build-essential libqt4-dev xz
with the xz it say package xz not found
then i did
sudo apt-get install build-essential libqt4-dev

i have an error in the building referring to drivers...can you point me in the right direction?i choosed the android_u2_emmc.defconfig and changed only the frequency of gpu in this manner because i want to see the gain in benchmarks:
from
# CONFIG_MALI_OVERCLOCK_533 is not set
# CONFIG_MALI_OVERCLOCK_640 is not set
# CONFIG_MALI_OVERCLOCK_733 is not set
# CONFIG_MALI_OVERCLOCK_800 is not set

to:(last line without the #)

# CONFIG_MALI_OVERCLOCK_533 is not set
# CONFIG_MALI_OVERCLOCK_640 is not set
# CONFIG_MALI_OVERCLOCK_733 is not set
CONFIG_MALI_OVERCLOCK_800=y

http://pastebin.com/niMLGdi9 it's the output
I don't sync the jb stock sources,but the cyanogen one,from here with git clone git@github.com:CyanogenMod/hardkernel-kernel-4412.git

an help it could be greatly appreciated,and it's not the right place,feel free to say me and i'll switch to issues section.i posted here to reply to yours post mdrjr!
2x Odroid-U2
Odroid-XU-E
Odroid-U3
Lcd touch panel 10.1"
2x Emmc 16gb
Emmc 8gb
Emmc 64gb
IO-board
IO-shield
Expansion board
Wifi dongle 2\3
Gigabit LAN
Sata3 HDDock
USB3.0 OTG Adapter
Smart Power
2x UART Module
BT dongle
User avatar
sert00
 
Posts: 721
Joined: Sun Feb 24, 2013 12:26 am
languages_spoken: english,italian
ODROIDs: 2*U2/XU-E/U3

Re: [GUIDE] Rebuilding Android Kernel (Incl. Mali Overclock)

Unread postby mdrjr » Mon Feb 25, 2013 9:42 pm

I don't know CM way to build the kernel, but I think that you must use their toolchain.

I've tried to build their kernel and still have this error.. Not sure why, didn't even tested.

Our default kernel does build
mdrjr
Site Admin
 
Posts: 8168
Joined: Fri Feb 22, 2013 11:34 pm
Location: Brazil
languages_spoken: english, portuguese
ODROIDs: -

Re: [GUIDE] Rebuilding Android Kernel (Incl. Mali Overclock)

Unread postby sert00 » Tue Feb 26, 2013 3:39 am

ok thank you very much mauro!i'll try to switch toolchain..if not works,i'll do jb standard one!
2x Odroid-U2
Odroid-XU-E
Odroid-U3
Lcd touch panel 10.1"
2x Emmc 16gb
Emmc 8gb
Emmc 64gb
IO-board
IO-shield
Expansion board
Wifi dongle 2\3
Gigabit LAN
Sata3 HDDock
USB3.0 OTG Adapter
Smart Power
2x UART Module
BT dongle
User avatar
sert00
 
Posts: 721
Joined: Sun Feb 24, 2013 12:26 am
languages_spoken: english,italian
ODROIDs: 2*U2/XU-E/U3

Re: [GUIDE] Rebuilding Android Kernel (Incl. Mali Overclock)

Unread postby waldorf » Wed Feb 27, 2013 9:30 pm

we would also need to know how to update the kernel on a SD card as many of us do not have eMMC (and no debug board unfortunately). can you explain? many thanks in advance ! :)
waldorf
 
Posts: 6
Joined: Wed Feb 27, 2013 9:20 pm
languages_spoken: english
ODROIDs: U2

Re: [GUIDE] Rebuilding Android Kernel (Incl. Mali Overclock)

Unread postby waldorf » Thu Feb 28, 2013 10:02 pm

hmm, are you sure the dd command is exactly the same for the eMMC and uSD card?
waldorf
 
Posts: 6
Joined: Wed Feb 27, 2013 9:20 pm
languages_spoken: english
ODROIDs: U2

Re: [GUIDE] Rebuilding Android Kernel (Incl. Mali Overclock)

Unread postby mdrjr » Thu Feb 28, 2013 10:04 pm

waldorf wrote:hmm, are you sure the dd command is exactly the same for the eMMC and uSD card?


Yes
mdrjr
Site Admin
 
Posts: 8168
Joined: Fri Feb 22, 2013 11:34 pm
Location: Brazil
languages_spoken: english, portuguese
ODROIDs: -

Re: [GUIDE] Rebuilding Android Kernel (Incl. Mali Overclock)

Unread postby ingans » Sat Mar 02, 2013 4:23 am

At step 4 i have this error

Code: Select all
TOSHIBA-NB200:~/kernel_4412$ make -j4 ARCH=arm zImage modules
scripts/kconfig/conf --silentoldconfig Kconfig
  CHK     include/linux/version.h
  CHK     include/generated/utsrelease.h
  CC      scripts/mod/empty.o
  HOSTCC  scripts/mod/mk_elfconfig
gcc: error: no se reconoce la opción de línea de órdenes ‘-mlittle-endian’
gcc: error: no se reconoce la opción de línea de órdenes ‘-marm’
gcc: error: no se reconoce la opción de línea de órdenes ‘-mfpu=neon’
gcc: error: no se reconoce la opción de línea de órdenes ‘-mfloat-abi=softfp’
gcc: error: no se reconoce la opción de línea de órdenes ‘-mapcs’
gcc: error: no se reconoce la opción de línea de órdenes ‘-mno-sched-prolog’
gcc: error: no se reconoce el argumento en la opción ‘-mabi=aapcs-linux’
gcc: nota: los argumentos válidos para ‘-mabi=’ son: ms sysv
gcc: error: no se reconoce la opción de línea de órdenes ‘-mno-thumb-interwork’
gcc: error: no se reconoce la opción de línea de órdenes ‘-mfpu=neon’
make[2]: *** [scripts/mod/empty.o] Error 1
make[2]: *** Se espera a que terminen otras tareas....
make[1]: *** [scripts/mod] Error 2
make: *** [scripts] Error 2
make: *** Se espera a que terminen otras tareas....


You can help me? My device is a U2
Thanks
ingans
 
Posts: 10
Joined: Mon Feb 25, 2013 8:15 am
languages_spoken: Spanish
ODROIDs: U2

Re: [GUIDE] Rebuilding Android Kernel (Incl. Mali Overclock)

Unread postby mdrjr » Sat Mar 02, 2013 4:34 am

You missed the export CROSS_COMPILE step.
mdrjr
Site Admin
 
Posts: 8168
Joined: Fri Feb 22, 2013 11:34 pm
Location: Brazil
languages_spoken: english, portuguese
ODROIDs: -

Re: [GUIDE] Rebuilding Android Kernel (Incl. Mali Overclock)

Unread postby ingans » Sat Mar 02, 2013 4:53 am

mdrjr wrote:You missed the export CROSS_COMPILE step.


Dont missed this step, you can see here

Code: Select all
TOSHIBA-NB200:~/arm-2010q1/bin$ export CROSS_COMPILE=`pwd`/arm-none-linux-gnueabi-


but there was no reaction
ingans
 
Posts: 10
Joined: Mon Feb 25, 2013 8:15 am
languages_spoken: Spanish
ODROIDs: U2

Re: [GUIDE] Rebuilding Android Kernel (Incl. Mali Overclock)

Unread postby mdrjr » Sat Mar 02, 2013 9:51 am

echo $CROSS_COMPILE and paste here.
mdrjr
Site Admin
 
Posts: 8168
Joined: Fri Feb 22, 2013 11:34 pm
Location: Brazil
languages_spoken: english, portuguese
ODROIDs: -

Re: [GUIDE] Rebuilding Android Kernel (Incl. Mali Overclock)

Unread postby ingans » Sat Mar 02, 2013 4:52 pm

mdrjr wrote:echo $CROSS_COMPILE and paste here.


Nothing, not response
ingans
 
Posts: 10
Joined: Mon Feb 25, 2013 8:15 am
languages_spoken: Spanish
ODROIDs: U2

Re: [GUIDE] Rebuilding Android Kernel (Incl. Mali Overclock)

Unread postby mdrjr » Sun Mar 03, 2013 12:55 am

ingans wrote:
mdrjr wrote:echo $CROSS_COMPILE and paste here.


Nothing, not response



Something is wrong on your side...

Code: Select all
mdrjr@sushi:~/bin/arm-2010q1/bin$ export CROSS_COMPILE=`pwd`/arm-none-linux-gnueabi-
mdrjr@sushi:~/bin/arm-2010q1/bin$ echo $CROSS_COMPILE
/home/mdrjr/bin/arm-2010q1/bin/arm-none-linux-gnueabi-
mdrjr@sushi:~/bin/arm-2010q1/bin$
mdrjr
Site Admin
 
Posts: 8168
Joined: Fri Feb 22, 2013 11:34 pm
Location: Brazil
languages_spoken: english, portuguese
ODROIDs: -

Re: [GUIDE] Rebuilding Android Kernel (Incl. Mali Overclock)

Unread postby ingans » Sun Mar 03, 2013 3:43 am

Now works!!

Code: Select all
oscar@oscar-TOSHIBA-NB200:~/arm-2010q1/bin$ echo $CROSS_COMPILE
/home/oscar/arm-2010q1/bin/arm-none-linux-gnueabi-
oscar@oscar-TOSHIBA-NB200:~/arm-2010q1/bin$


What would the next step?

Sorry buy im a authentic noob in Ubuntu and Linux :?
ingans
 
Posts: 10
Joined: Mon Feb 25, 2013 8:15 am
languages_spoken: Spanish
ODROIDs: U2

Re: [GUIDE] Rebuilding Android Kernel (Incl. Mali Overclock)

Unread postby boss1019 » Sun Mar 03, 2013 3:54 am

Can someone try to make a flashable file or set of files for different speeds. Also will this work on ics and jellybean or just jellybean or just ics.
boss1019
 
Posts: 11
Joined: Thu Feb 28, 2013 1:39 pm
languages_spoken: english
ODROIDs: Odroid X2

Re: [GUIDE] Rebuilding Android Kernel (Incl. Mali Overclock)

Unread postby mdrjr » Sun Mar 03, 2013 6:20 am

ingans wrote:Now works!!

Code: Select all
oscar@oscar-TOSHIBA-NB200:~/arm-2010q1/bin$ echo $CROSS_COMPILE
/home/oscar/arm-2010q1/bin/arm-none-linux-gnueabi-
oscar@oscar-TOSHIBA-NB200:~/arm-2010q1/bin$


What would the next step?

Sorry buy im a authentic noob in Ubuntu and Linux :?


Follow the guide from step 2.. now..
mdrjr
Site Admin
 
Posts: 8168
Joined: Fri Feb 22, 2013 11:34 pm
Location: Brazil
languages_spoken: english, portuguese
ODROIDs: -

Re: [GUIDE] Rebuilding Android Kernel (Incl. Mali Overclock)

Unread postby mdrjr » Sun Mar 03, 2013 6:20 am

boss1019 wrote:Can someone try to make a flashable file or set of files for different speeds. Also will this work on ics and jellybean or just jellybean or just ics.



Works for both!
mdrjr
Site Admin
 
Posts: 8168
Joined: Fri Feb 22, 2013 11:34 pm
Location: Brazil
languages_spoken: english, portuguese
ODROIDs: -

Next

Return to Android

Who is online

Users browsing this forum: No registered users and 2 guests