[KERNEL]Build Galaxy Tab 2 JB kernel from source

Search This thread

ketut.kumajaya

Recognized Developer
Apr 28, 2011
4,935
14,138
Bekasi
Building kernel

1. Download Sourcery G++ Lite 2010q1-202 for ARM GNU/Linux from https://sourcery.mentor.com/GNUToolchain/release1293?lite=arm, direct link https://sourcery.mentor.com/GNUTool...-none-linux-gnueabi-i686-pc-linux-gnu.tar.bz2 and save it in $HOME/android directory, extract it to /opt/toolchains/

Code:
$ sudo mkdir -p /opt/toolchains/
$ cd /opt/toolchains/
$ sudo tar -xjvf $HOME/android/arm-2010q1-202-arm-none-linux-gnueabi-i686-pc-linux-gnu.tar.bz2

2. Add /opt/toolchains/arm-2010q1/bin as your search PATH. Logout and back login to your desktop to activate your new search PATH

Code:
$ echo $'\nPATH=\"/opt/toolchains/arm-2010q1/bin:$PATH\"' >> $HOME/.profile

3. Download 3.0.31 kernel source for JB P3110 from http://opensource.samsung.com/ and save it in $HOME/android/espresso directory and extract it

Code:
$ mkdir -p $HOME/android/espresso/kernel
$ cd $HOME/android/espresso/
$ unzip P3110_JB_Opensource.zip Kernel.tar.gz
$ cd kernel
$ tar -xvzf ../Kernel.tar.gz
$ make mrproper

4. Apply all my patch and then load kernel config file

Code:
$ patch -p1 < ../01-configs.patch
$ patch -p1 < ../02-debug-info.patch
$ patch -p1 < ../03-graphics.patch
$ patch -p1 < ../04-governor.patch
$ patch -p1 < ../05-scheduler.patch
$ patch -p1 < ../06-overclock.patch
$ patch -p1 < ../07-exfat.patch
$ make ARCH=arm android_espresso_omap4430_r04_blackhawk_defconfig

5. If you want to change kernel config, download libncurses5-dev

Code:
$ sudo apt-get install libncurses5-dev
$ make ARCH=arm menuconfig

6. Build the kernel

Code:
$ make -j4 ARCH=arm

7. Save kernel and modules

Code:
$ mkdir ../espresso-kernel
$ cp arch/arm/boot/zImage ../espresso-kernel
$ find . -type f -name *.ko -exec cp {} ../espresso-kernel \;

Building PowerVR SGX 540 kernel modules

1. Download the sources

Code:
$ sudo apt-get install git-core
$ git clone git://git.omapzoom.org/repo/graphics/omaplfb.git -b omaplfb-1.9 --depth 1
$ git clone git://git.omapzoom.org/device/ti/proprietary-open.git -b d-jb-mr1-release --depth 1

2. Build pvrsrvkm kernel module

Code:
$ tar -xvzf proprietary-open/omap4/sgx_src/eurasia_km.tgz
$ rm -rf eurasia_km/eurasiacon/binary*
$ export KERNELDIR=$HOME/android/espresso/kernel
$ cd eurasia_km/eurasiacon/build/linux2/omap4430_android/
$ make ARCH=arm CROSS_COMPILE=arm-none-linux-gnueabi- TARGET_PRODUCT="blaze_tablet" BUILD=release TARGET_SGX=540 PLATFORM_VERSION=4.0
$ cp ../../../binary2_540_120_omap4430_android_release/target/pvrsrvkm_sgx540_120.ko ../../../../../espresso-kernel/

3. Build omaplfb kernel module Not needed, omaplfb now integrated into kernel by 03-graphics.patch

Code:
cd ../../../../../omaplfb/omaplfb_linux
export TARGET=omap4460
export PVRKMDIR=$HOME/android/espresso/
make clean
make
cp omaplfb_sgx540_120.ko ../../espresso-kernel/
cd ../../

4. Strip all kernel modules if needed

Code:
$ arm-none-linux-gnueabi-strip --strip-unneeded espresso-kernel/*.ko

Credits:
Linux, Google, Samsung, omapzoom.org, gokhanmoral, codeworkx, cmenard

attachment.php


Leave this 3.0.8 kernel info just for historical purpose:
I try to build Galaxy Tab 2 kernel from source for stock 4.0.4 firmware but no luck so far.
  1. Source from http://opensource.samsung.com/ without modification, using the latest Sourcery G++ Lite: boot failed!
  2. Souce from Samsung without modification, using Sourcery G++ Lite 2010q1-202: kernel boot but no hardware accelerated video, camera and video not working!
  3. Source from codeworkx without modification: kernel boot but incompatible pvr driver, stuck on Samsung logo!
  4. Source from codeworkx without modification, vendor blob updated: kernel boot but unstable graphics, gallery, camera and video not working!
  5. Source from codeworkx, pvr driver revert back to Samsung source: kernel boot but no hardware accelerated video, camera and video not working!
  6. Source from codeworkx, pvr driver revert back to tuna ICS source, using tuna ICS vendor blob: kernel boot but no hardware accelerated video, camera and video not working! Better 3D graphics performance.

UPDATE:
Soft decoding video player (MoboPlayer) work.

UPDATE 2:
Found the problems! libion.so and libtiutils.so not compatible to the old kernel source. Thanks for codeworkx, tracing his work on CM9 point me out to the proprietary libraries.

attachment.php
 

Attachments

  • Screenshot_2012-08-29-17-54-45-432637062.jpg
    Screenshot_2012-08-29-17-54-45-432637062.jpg
    25.8 KB · Views: 7,636
  • linaro.patch
    4.5 KB · Views: 95
  • 01-configs.patch
    303.9 KB · Views: 82
  • 02-debug-info.patch
    14.7 KB · Views: 65
  • 03-graphics.patch.zip
    432.6 KB · Views: 164
  • 04-governor.patch
    154.2 KB · Views: 84
  • 05-scheduler.patch
    231.5 KB · Views: 76
  • 06-overclock.patch
    14 KB · Views: 120
  • 07-exfat.patch
    416 bytes · Views: 85
Last edited:

heihei_ivan

Senior Member
May 19, 2011
131
59
Hong Kong
When you compile a kernel, some drivers should have also been compiled and their locations should have been displayed on the console. You should copy those drivers to a proper location, I copied those .ko files to /lib/modules of the ramdisk when compiling a P3110 kernel.

Sent from my GT-P3110
 

ketut.kumajaya

Recognized Developer
Apr 28, 2011
4,935
14,138
Bekasi
Conclusion:
Using Galaxy Nexus PowerVR kernel driver and blob build 1.8@785978, we got better 3D performance on stock 4.0.4 firmware but lost hardware accelerated video (base on Antutu result: 3D = ~1030, fps 40-50). Video failed to play, camera failed to open. So, the best kernel for user experience (slower 3D but smooth 2D) is 3.0.8 from 4.0.4 firmware for now.

Now I'm sure, Samsung has been making changes in the 3.0.8 kernel for ICS 4.0.4 but have not released it to the public. Please help me to write a petition for Samsung since my English not good enough :crying:
 

ketut.kumajaya

Recognized Developer
Apr 28, 2011
4,935
14,138
Bekasi
Last night I tried to rebuild the kernel from source (again) and this time set the kernel version exactly same as stock 4.0.4 kernel (3.0.8-583493-user). Using kernel source from Samsung, codeworkx's patch applied except tuna pvr driver patch. Keep the stock kernel 3.0.8-583493-user modules in /lib/modules and then rebuild the boot image. Damn Samsung, hardware accelerated video still does not work! 3D performance slower than tuna ICS pvr driver but 2D experience as smooth as stock 4.0.4 firmware.
 

ketut.kumajaya

Recognized Developer
Apr 28, 2011
4,935
14,138
Bekasi
/system/vendor/firmware/ducati-m3.bin not loaded properly by the kernel. No rpmsg-omx0 and rpmsg-omx1 inside /dev .

Code:
I/OMXCodec( 2293): [OMX.TI.DUCATI1.VIDEO.DECODER] AVC profile = 100 (High), level = 32
E/OMXCodec( 2293): set buffer size variable to : 1572864
I/OMXCodec( 2293): [OMX.TI.DUCATI1.VIDEO.DECODER] video dimensions are 1280 x 720
I/OMXCodec( 2293): [OMX.TI.DUCATI1.VIDEO.DECODER] Crop rect is 1280 x 720 @ (0, 0)
I/OMXCodec( 2293): !! Change the I/P buffer size to 1572864 !!
D/DOMX    ( 2293): ERROR: userspace cachable mapping of ION buffers returned error
E/OMXNodeInstance( 2293): OMX_AllocateBuffer failed with error -2147479552 (0x80001000)
E/OMXCodec( 2293): allocate_buffer_with_backup failed
D/DOMX    ( 2293): ERROR: failed check:(eError == OMX_ErrorNone) || (eError == OMX_ErrorNoMore) - returning error: 0x80001011 - Error returned from OMX API in ducati
D/DOMX    ( 2293): ERROR: Error From ComponentDeInit..
 

Johnsel

Senior Member
Mar 18, 2008
58
144
Now I'm sure, Samsung has been making changes in the 3.0.8 kernel for ICS 4.0.4 but have not released it to the public. Please help me to write a petition for Samsung since my English not good enough :crying:

already done yesterday ;)

Samsung response said:
SAMSUNG OSRC COMMENTS DELIVERY NOTIFICATION]

♦ classification : Mobile Phone ♦
♦ model name : GT-P5100 ♦

Dear Customer,

Thank you for your interest in our product.

We are now in the process of reviewing your inquiry.

We will let you know a reply to this issue soon.

Sincerely yours,

----- Original Message -----

Hello Sir/Madam,

You have kindly supplied the kernel/software sources for the P31xx/P51xx series, but with the latest software update to 4.0.4 we cannot use this source to compile kernels for our devices.
Please supply me/us (|reply will, if you give permission therefor, be published on the XDA forums to help other developers with the same issue)| with instructions how to compile for 4.0.4/updated sources.

Thanks in advance for your reply,

John Simons

Samsung Open Source Release Center
http://opensource.samsung.com
 

ketut.kumajaya

Recognized Developer
Apr 28, 2011
4,935
14,138
Bekasi
Solved!

Found the problems! libion.so and libtiutils.so not compatible to the old kernel source. Thanks for codeworkx, tracing his work on CM9 point me out to the proprietary libraries.
 

Monfro

Senior Member
Jul 4, 2009
1,262
1,094
Mantova (Italy)
Nexus 9
Google Pixel C
R: [KERNEL]Build Galaxy Tab 2 JB kernel from source


You really did an excellent job with TW kernel.
Is it possible for you to compile an updated kernel for CM10.1?
Stock CM10.1 kernel does not support overclock.
cmenard AOKP kernel works well with CM10.1, and it supports both CPU and GPU OC, but it is based on the old source, with 690mb available, compiled for 4.1.2

It would be awesome if you could update one of those 2 kernels.
 

ketut.kumajaya

Recognized Developer
Apr 28, 2011
4,935
14,138
Bekasi
First page updated, including the patch!
- omaplfb now integrated into kernel
- overclock code updated, lock CPU @ 1.008GHz on boot
 
  • Like
Reactions: Monfro

pecana

Senior Member
Jan 7, 2011
59
3
Hey guys are there some existing cisf module to mount cifs and nfs partition on the Galaxy Tab 2 3110?
I would like to mount my share (not for copy) but for directly playing movies. I did with some old pads but i don't know if this module are available for the Tab 2
 

ketut.kumajaya

Recognized Developer
Apr 28, 2011
4,935
14,138
Bekasi
You really did an excellent job with TW kernel.
Is it possible for you to compile an updated kernel for CM10.1?
Stock CM10.1 kernel does not support overclock.
cmenard AOKP kernel works well with CM10.1, and it supports both CPU and GPU OC, but it is based on the old source, with 690mb available, compiled for 4.1.2

It would be awesome if you could update one of those 2 kernels.
May be after my not started yet dual boot system finish :D

Hey guys are there some existing cisf module to mount cifs and nfs partition on the Galaxy Tab 2 3110?
I would like to mount my share (not for copy) but for directly playing movies. I did with some old pads but i don't know if this module are available for the Tab 2
KK-Boot has it.
 
  • Like
Reactions: Monfro

Top Liked Posts

  • There are no posts matching your filters.
  • 12
    Building kernel

    1. Download Sourcery G++ Lite 2010q1-202 for ARM GNU/Linux from https://sourcery.mentor.com/GNUToolchain/release1293?lite=arm, direct link https://sourcery.mentor.com/GNUTool...-none-linux-gnueabi-i686-pc-linux-gnu.tar.bz2 and save it in $HOME/android directory, extract it to /opt/toolchains/

    Code:
    $ sudo mkdir -p /opt/toolchains/
    $ cd /opt/toolchains/
    $ sudo tar -xjvf $HOME/android/arm-2010q1-202-arm-none-linux-gnueabi-i686-pc-linux-gnu.tar.bz2

    2. Add /opt/toolchains/arm-2010q1/bin as your search PATH. Logout and back login to your desktop to activate your new search PATH

    Code:
    $ echo $'\nPATH=\"/opt/toolchains/arm-2010q1/bin:$PATH\"' >> $HOME/.profile

    3. Download 3.0.31 kernel source for JB P3110 from http://opensource.samsung.com/ and save it in $HOME/android/espresso directory and extract it

    Code:
    $ mkdir -p $HOME/android/espresso/kernel
    $ cd $HOME/android/espresso/
    $ unzip P3110_JB_Opensource.zip Kernel.tar.gz
    $ cd kernel
    $ tar -xvzf ../Kernel.tar.gz
    $ make mrproper

    4. Apply all my patch and then load kernel config file

    Code:
    $ patch -p1 < ../01-configs.patch
    $ patch -p1 < ../02-debug-info.patch
    $ patch -p1 < ../03-graphics.patch
    $ patch -p1 < ../04-governor.patch
    $ patch -p1 < ../05-scheduler.patch
    $ patch -p1 < ../06-overclock.patch
    $ patch -p1 < ../07-exfat.patch
    $ make ARCH=arm android_espresso_omap4430_r04_blackhawk_defconfig

    5. If you want to change kernel config, download libncurses5-dev

    Code:
    $ sudo apt-get install libncurses5-dev
    $ make ARCH=arm menuconfig

    6. Build the kernel

    Code:
    $ make -j4 ARCH=arm

    7. Save kernel and modules

    Code:
    $ mkdir ../espresso-kernel
    $ cp arch/arm/boot/zImage ../espresso-kernel
    $ find . -type f -name *.ko -exec cp {} ../espresso-kernel \;

    Building PowerVR SGX 540 kernel modules

    1. Download the sources

    Code:
    $ sudo apt-get install git-core
    $ git clone git://git.omapzoom.org/repo/graphics/omaplfb.git -b omaplfb-1.9 --depth 1
    $ git clone git://git.omapzoom.org/device/ti/proprietary-open.git -b d-jb-mr1-release --depth 1

    2. Build pvrsrvkm kernel module

    Code:
    $ tar -xvzf proprietary-open/omap4/sgx_src/eurasia_km.tgz
    $ rm -rf eurasia_km/eurasiacon/binary*
    $ export KERNELDIR=$HOME/android/espresso/kernel
    $ cd eurasia_km/eurasiacon/build/linux2/omap4430_android/
    $ make ARCH=arm CROSS_COMPILE=arm-none-linux-gnueabi- TARGET_PRODUCT="blaze_tablet" BUILD=release TARGET_SGX=540 PLATFORM_VERSION=4.0
    $ cp ../../../binary2_540_120_omap4430_android_release/target/pvrsrvkm_sgx540_120.ko ../../../../../espresso-kernel/

    3. Build omaplfb kernel module Not needed, omaplfb now integrated into kernel by 03-graphics.patch

    Code:
    cd ../../../../../omaplfb/omaplfb_linux
    export TARGET=omap4460
    export PVRKMDIR=$HOME/android/espresso/
    make clean
    make
    cp omaplfb_sgx540_120.ko ../../espresso-kernel/
    cd ../../

    4. Strip all kernel modules if needed

    Code:
    $ arm-none-linux-gnueabi-strip --strip-unneeded espresso-kernel/*.ko

    Credits:
    Linux, Google, Samsung, omapzoom.org, gokhanmoral, codeworkx, cmenard

    attachment.php


    Leave this 3.0.8 kernel info just for historical purpose:
    I try to build Galaxy Tab 2 kernel from source for stock 4.0.4 firmware but no luck so far.
    1. Source from http://opensource.samsung.com/ without modification, using the latest Sourcery G++ Lite: boot failed!
    2. Souce from Samsung without modification, using Sourcery G++ Lite 2010q1-202: kernel boot but no hardware accelerated video, camera and video not working!
    3. Source from codeworkx without modification: kernel boot but incompatible pvr driver, stuck on Samsung logo!
    4. Source from codeworkx without modification, vendor blob updated: kernel boot but unstable graphics, gallery, camera and video not working!
    5. Source from codeworkx, pvr driver revert back to Samsung source: kernel boot but no hardware accelerated video, camera and video not working!
    6. Source from codeworkx, pvr driver revert back to tuna ICS source, using tuna ICS vendor blob: kernel boot but no hardware accelerated video, camera and video not working! Better 3D graphics performance.

    UPDATE:
    Soft decoding video player (MoboPlayer) work.

    UPDATE 2:
    Found the problems! libion.so and libtiutils.so not compatible to the old kernel source. Thanks for codeworkx, tracing his work on CM9 point me out to the proprietary libraries.

    attachment.php
    4
    @Android-Andi I've done what Galaxy Nexus developer just did two years ago ;)

    To remind anyone who still around here, how unofficial 3.0.31 kernels started. Who initially ported cmenard's 3.0.8 overclock feature to 3.0.31. Why sometimes we need a different blobs for a different ROM. Thanks to the great codeworkx, cmenard, Texas Instruments :good: A great journey!
    2
    Now I'm sure, Samsung has been making changes in the 3.0.8 kernel for ICS 4.0.4 but have not released it to the public. Please help me to write a petition for Samsung since my English not good enough :crying:

    already done yesterday ;)

    Samsung response said:
    SAMSUNG OSRC COMMENTS DELIVERY NOTIFICATION]

    ♦ classification : Mobile Phone ♦
    ♦ model name : GT-P5100 ♦

    Dear Customer,

    Thank you for your interest in our product.

    We are now in the process of reviewing your inquiry.

    We will let you know a reply to this issue soon.

    Sincerely yours,

    ----- Original Message -----

    Hello Sir/Madam,

    You have kindly supplied the kernel/software sources for the P31xx/P51xx series, but with the latest software update to 4.0.4 we cannot use this source to compile kernels for our devices.
    Please supply me/us (|reply will, if you give permission therefor, be published on the XDA forums to help other developers with the same issue)| with instructions how to compile for 4.0.4/updated sources.

    Thanks in advance for your reply,

    John Simons

    Samsung Open Source Release Center
    http://opensource.samsung.com
    2
    so you gonna release the kernel?
    When it's ready. I will share 2 or 3 boot image with different setup.
    2
    4.0.4 sources available at OSRC.