Post Reply

Building kernel SM-T525

OP vanyas

8th April 2014, 10:54 PM   |  #1  
OP Member
Flag Vladivostok
Thanks Meter: 9
 
31 posts
Join Date:Joined: Dec 2011
More
Instruction to build a kernel from Samsung Sources:

1. Download and unpack source from http://opensource.samsung.com/recept...hValue=sm-t525

2. Download and upack android ndk from https://developer.android.com/tools/sdk/ndk/index.html

3. Set enviroment varibles (use gcc 4.6, not 4.8):
Quote:

export CROSS_COMPILE="~/android/android-ndk-r9d/toolchains/arm-linux-androideabi-4.6/prebuilt/linux-x86_64/bin/arm-linux-androideabi-"
export ARCH="arm"

4. If you want to add loadable modules support, apply patch modules_support.patch from attach
Quote:

patch -p1 < modules_support.patch

5. Create kernel config
Quote:

make VARIANT_DEFCONFIG=msm8974_sec_picassoeur_defconfig msm8974_sec_defconfig SELINUX_DEFCONFIG=selinux_defconfig

6. Buld kernel
Quote:

make -j3

7. Buld device tree image
Quote:

./tools/dtbTool -o dt.img -s 2048 -p ./scripts/dtc/ ./arch/arm/boot/

8. Buld boot.img (default ramdisk image in attach)
Quote:

./tools/mkbootimg --kernel ./arch/arm/boot/zImage --ramdisk ramdisk.cpio.gz --cmdline 'console=null androidboot.hardware=qcom user_debug=31 msm_rtb.filter=0x37 ehci-hcd.park=3' --base 0x00000000 --pagesize 2048 --ramdisk_offset 0x02000000 --tags_offset 0x01E00000 --dt dt.img -o boot.img

9. Create .tar.md5 to flash with Odin
Quote:

tar -H ustar -c boot.img > boot.tar
md5sum -t boot.tar >> boot.tar
mv boot.tar boot.tar.md5

10. To fix Wi-Fi edit build.prop on your device, change ro.securestorage.support fron true to false
Quote:

ro.securestorage.support=false

GitHub: https://github.com/vanyasvl/android_...ung_picassoeur
Last edited by vanyas; 10th April 2014 at 02:32 AM.
The Following 3 Users Say Thank You to vanyas For This Useful Post: [ View ]
9th April 2014, 12:10 AM   |  #2  
thornev's Avatar
Senior Member
Flag Hudson Valley, NY
Thanks Meter: 93
 
415 posts
Join Date:Joined: Feb 2012
I'm not a builder, but when wifi doesn't work that usually means a mismatch between kernel and rom.

Sent from my SM-T320 using Tapatalk
9th April 2014, 12:19 AM   |  #3  
Senior Member
Thanks Meter: 2,564
 
1,774 posts
Join Date:Joined: Mar 2011
Donate to Me
Quote:

Hello. I'm trying to build stock Samsung kernel for Tab Pro 10.1 Sm-T525 and I have a problem:<br />
Wi-fi isn't working on builded kernel. All kernel configs are default from Samsung, bluetooth and Lte works ok.<br />
<br />
I need help with debug wifi problem.<br />
"ip a" command shows wlan0 network device, but wifi can't be enabled from configuration<br />
<br />
My steps to build kernel:<br />

Quote:

Download source from http://opensource.samsung.com/recept...hValue=sm-t525<br />
unpack it to ~/android/kernel<br />
<br />
cd ~/android/kernel<br />
export CROSS_COMPILE="/home/vanyas/android/android-ndk-r9d_x64/toolchains/arm-linux-androideabi-4.6/prebuilt/linux-x86_64/bin/arm-linux-androideabi-"<br />
export ARCH="arm"<br />
<br />
make VARIANT_DEFCONFIG=msm8974_sec_picassoeur_defconfig msm8974_sec_defconfig SELINUX_DEFCONFIG=selinux_defconfig<br />
make -j3<br />
<br />
./tools/dtbTool -o dt.img -s 2048 -p ./scripts/dtc/ ./arch/arm/boot/<br />
<br />
unpack original boot.img with split_boot to boot folder<br />
<br />
./tools/mkbootimg --kernel ./arch/arm/boot/zImage --ramdisk boot/boot.img-ramdisk.cpio.gz --cmdline 'console=null androidboot.hardware=qcom user_debug=31 msm_rtb.filter=0x37 ehci-hcd.park=3' --base 0x00000000 --pagesize 2048 --ramdisk_offset 0x02000000 --tags_offset 0x01E00000 --dt dt.img -o boot.img<br />
<br />
tar -H ustar -c boot.img > boot.tar<br />
md5sum -t boot.tar >> boot.tar<br />
mv boot.tar boot.tar.md5

For the sm-t320, the kernel is built with version checks on the modules. This is what I did to allow the wlan module to load:

https://github.com/crpalmer/android_...787af9acd3394c

You'd obviously need to specify the right version string (it should be in the output of dmesg if this is why your wlan isn't working).

Also, if you plan on sharing the kernel, you should zip the .tar.md5 file as I had problems with it failing to flash after downloading when I released just a .tar.md5.
9th April 2014, 12:31 AM   |  #4  
OP Member
Flag Vladivostok
Thanks Meter: 9
 
31 posts
Join Date:Joined: Dec 2011
More
Quote:
Originally Posted by crpalmer

For the sm-t320, the kernel is built with version checks on the modules. This is what I did to allow the wlan module to load:

https://github.com/crpalmer/android_...787af9acd3394c

You'd obviously need to specify the right version string (it should be in the output of dmesg if this is why your wlan isn't working).

Also, if you plan on sharing the kernel, you should zip the .tar.md5 file as I had problems with it failing to flash after downloading when I released just a .tar.md5.

Thanks, but it is not a module load problem. SM-T525 kernel builds without modules support and wifi driver (bcm4339) compilled into the kernel.
Last edited by vanyas; 9th April 2014 at 12:53 AM.
9th April 2014, 01:01 AM   |  #5  
Senior Member
Thanks Meter: 2,564
 
1,774 posts
Join Date:Joined: Mar 2011
Donate to Me
Quote:
Originally Posted by vanyas

Thanks, but it is not a module load problem. SM-T525 kernel builds without modules support and wifi driver (bcm4339) compilled into the kernel.

That's interesting. The sm-t320 is a prima chipset which is built as a module.

Do you see anything in the logcat or the dmesg related to the wlan, bcm4339, wifi, etc?
9th April 2014, 07:01 AM   |  #6  
OP Member
Flag Vladivostok
Thanks Meter: 9
 
31 posts
Join Date:Joined: Dec 2011
More
There are patches for SM-T525 kernel source that resolve problem with "modules support" compilation
Quote:

--- kernel_orig/arch/arm/mm/proc-syms.c 2014-04-09 12:10:04.846114000 +1100
+++ kernel/arch/arm/mm/proc-syms.c 2014-04-09 11:54:33.894114000 +1100
@@ -18,7 +18,6 @@
#ifndef MULTI_CPU
EXPORT_SYMBOL(cpu_dcache_clean_area);
EXPORT_SYMBOL(cpu_set_pte_ext);
-EXPORT_SYMBOL(cpu_tima_set_pte_ext);
#else
EXPORT_SYMBOL(processor);
#endif
--- kernel_orig/arch/arm/mach-msm/sec-switch.c 2014-01-23 15:34:20.000000000 +1100
+++ kernel/arch/arm/mach-msm/sec-switch.c 2014-04-09 11:29:26.322114000 +1100
@@ -2565,7 +2565,7 @@
pr_info("%s: Ignore Cable setting, Not LPM mode\n", __func__);
}
}
-EXPORT_SYMBOL(fsa9485_set_mhl_cable)
+EXPORT_SYMBOL(fsa9485_set_mhl_cable);

boon fsa9485_muic_is_mhl_attached(void)
{
--- kernel_orig/Makefile 2014-01-23 15:34:19.000000000 +1100
+++ kernel/Makefile 2014-04-09 20:55:48.278114000 +1100
@@ -351,7 +351,7 @@

CHECKFLAGS := -D__linux__ -Dlinux -D__STDC__ -Dunix -D__unix__ \
-Wbitwise -Wno-return-void $(CF)
-CFLAGS_MODULE =
+CFLAGS_MODULE = -fno-pic
AFLAGS_MODULE =
LDFLAGS_MODULE =
CFLAGS_KERNEL =

Last edited by vanyas; 9th April 2014 at 11:08 AM.
The Following User Says Thank You to vanyas For This Useful Post: [ View ]
9th April 2014, 11:54 AM   |  #7  
OP Member
Flag Vladivostok
Thanks Meter: 9
 
31 posts
Join Date:Joined: Dec 2011
More
Yes! I did it!
To fix wifi: ro.securestorage.support=false in build.prop
The Following User Says Thank You to vanyas For This Useful Post: [ View ]
10th April 2014, 05:28 AM   |  #8  
scrosler's Avatar
Recognized Developer
Flag Fargo
Thanks Meter: 52,450
 
23,916 posts
Join Date:Joined: Feb 2007
Donate to Me
Quote:
Originally Posted by thornev

I'm not a builder, but when wifi doesn't work that usually means a mismatch between kernel and rom.

Sent from my SM-T320 using Tapatalk

I am a builder and what he said is correct.

Samsung did some crazy stuff with Knox.
The Following User Says Thank You to scrosler For This Useful Post: [ View ]
12th April 2014, 12:57 PM   |  #9  
Silkmeister1's Avatar
Senior Member
Flag New York City
Thanks Meter: 54
 
112 posts
Join Date:Joined: Jun 2013
More
Quote:
Originally Posted by scrosler

I am a builder and what he said is correct.

Samsung did some crazy stuff with Knox.

can you make a thread showing us some the difficulties you encountered working around Knox?
Silkmeister

Post Reply Subscribe to Thread
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


Top Threads in Galaxy Tab Pro 12.2, 10.1, 8.4 Android Development by ThreadRank