Welcome to XDA

Search to go directly to your device's forum

Register an account

Unlock full posting privileges

Ask a question

No registration required
Post Reply

Prompt [KERNEL]Build Galaxy Tab 2 JB kernel from source

OP ketut.kumajaya

29th August 2012, 08:09 AM   |  #1  
OP Recognized Developer
Flag Bekasi
Thanks Meter: 9,403
 
3,542 posts
Join Date:Joined: Apr 2011
Donate to Me
More
Building kernel

1. Download Sourcery G++ Lite 2010q1-202 for ARM GNU/Linux from https://sourcery.mentor.com/GNUToolc...e1293?lite=arm, direct link https://sourcery.mentor.com/GNUToolc...ux-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



Leave this 3.0.8 kernel info just for historical purpose:
Quote:

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.

Attached Thumbnails
Click image for larger version

Name:	Screenshot_2012-08-29-17-54-45-432637062.jpg
Views:	6519
Size:	25.8 KB
ID:	1289815  
Attached Files
File Type: patch linaro.patch - [Click for QR Code] (4.5 KB, 72 views)
File Type: patch 01-configs.patch - [Click for QR Code] (303.9 KB, 63 views)
File Type: patch 02-debug-info.patch - [Click for QR Code] (14.7 KB, 45 views)
File Type: zip 03-graphics.patch.zip - [Click for QR Code] (432.6 KB, 106 views)
File Type: patch 04-governor.patch - [Click for QR Code] (154.2 KB, 62 views)
File Type: patch 05-scheduler.patch - [Click for QR Code] (231.5 KB, 49 views)
File Type: patch 06-overclock.patch - [Click for QR Code] (14.0 KB, 81 views)
File Type: patch 07-exfat.patch - [Click for QR Code] (416 Bytes, 62 views)
Last edited by ketut.kumajaya; 10th February 2013 at 05:09 AM. Reason: Instruction and patch updated!
The Following 12 Users Say Thank You to ketut.kumajaya For This Useful Post: [ View ]
29th August 2012, 09:39 AM   |  #2  
heihei_ivan's Avatar
Senior Member
Flag Hong Kong
Thanks Meter: 56
 
123 posts
Join Date:Joined: May 2011
More
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
29th August 2012, 12:40 PM   |  #3  
OP Recognized Developer
Flag Bekasi
Thanks Meter: 9,403
 
3,542 posts
Join Date:Joined: Apr 2011
Donate to Me
More
Quote:
Originally Posted by heihei_ivan

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

Yes.
29th August 2012, 05:45 PM   |  #4  
OP Recognized Developer
Flag Bekasi
Thanks Meter: 9,403
 
3,542 posts
Join Date:Joined: Apr 2011
Donate to Me
More
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
30th August 2012, 05:37 AM   |  #5  
OP Recognized Developer
Flag Bekasi
Thanks Meter: 9,403
 
3,542 posts
Join Date:Joined: Apr 2011
Donate to Me
More
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.
30th August 2012, 11:52 AM   |  #6  
OP Recognized Developer
Flag Bekasi
Thanks Meter: 9,403
 
3,542 posts
Join Date:Joined: Apr 2011
Donate to Me
More
/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..
30th August 2012, 06:34 PM   |  #7  
Member
Thanks Meter: 144
 
58 posts
Join Date:Joined: Mar 2008
Quote:
Originally Posted by ketut.kumajaya

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

already done yesterday

Quote:
Originally Posted by Samsung response

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

The Following 2 Users Say Thank You to Johnsel For This Useful Post: [ View ]
30th August 2012, 07:57 PM   |  #8  
OP Recognized Developer
Flag Bekasi
Thanks Meter: 9,403
 
3,542 posts
Join Date:Joined: Apr 2011
Donate to Me
More
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.
30th August 2012, 08:27 PM   |  #9  
Member
Flag Verona
Thanks Meter: 16
 
54 posts
Join Date:Joined: Apr 2012
More
Quote:
Originally Posted by ketut.kumajaya

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.

so you gonna release the kernel?
31st August 2012, 02:58 AM   |  #10  
OP Recognized Developer
Flag Bekasi
Thanks Meter: 9,403
 
3,542 posts
Join Date:Joined: Apr 2011
Donate to Me
More
Quote:
Originally Posted by gabriel1997

so you gonna release the kernel?

When it's ready. I will share 2 or 3 boot image with different setup.

The Following 2 Users Say Thank You to ketut.kumajaya For This Useful Post: [ View ]
Post Reply Subscribe to Thread
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes