Building kernel SM-T525 - Galaxy Tab Pro 12.2, 10.1, 8.4 Android Development

Instruction to build a kernel from Samsung Sources:
1. Download and unpack source from http://opensource.samsung.com/reception/receptionSub.do?method=sub&sub=F&searchValue=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):
export CROSS_COMPILE="~/android/android-ndk-r9d/toolchains/arm-linux-androideabi-4.6/prebuilt/linux-x86_64/bin/arm-linux-androideabi-"
export ARCH="arm"
Click to expand...
Click to collapse
4. If you want to add loadable modules support, apply patch modules_support.patch from attach
patch -p1 < modules_support.patch
Click to expand...
Click to collapse
5. Create kernel config
make VARIANT_DEFCONFIG=msm8974_sec_picassoeur_defconfig msm8974_sec_defconfig SELINUX_DEFCONFIG=selinux_defconfig
Click to expand...
Click to collapse
6. Buld kernel
make -j3
Click to expand...
Click to collapse
7. Buld device tree image
./tools/dtbTool -o dt.img -s 2048 -p ./scripts/dtc/ ./arch/arm/boot/
Click to expand...
Click to collapse
8. Buld boot.img (default ramdisk image in attach)
./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
Click to expand...
Click to collapse
9. Create .tar.md5 to flash with Odin
tar -H ustar -c boot.img > boot.tar
md5sum -t boot.tar >> boot.tar
mv boot.tar boot.tar.md5
Click to expand...
Click to collapse
10. To fix Wi-Fi edit build.prop on your device, change ro.securestorage.support fron true to false
ro.securestorage.support=false
Click to expand...
Click to collapse
GitHub: https://github.com/vanyasvl/android_kernel_samsung_picassoeur

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

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 />
Download source from http://opensource.samsung.com/reception/receptionSub.do?method=sub&sub=F&searchValue=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
Click to expand...
Click to collapse
Click to expand...
Click to collapse
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...mmit/76275b29746dfeab37efeab6c2787af9acd3394c
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.

crpalmer said:
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...mmit/76275b29746dfeab37efeab6c2787af9acd3394c
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.
Click to expand...
Click to collapse
Thanks, but it is not a module load problem. SM-T525 kernel builds without modules support and wifi driver (bcm4339) compilled into the kernel.

vanyas said:
Thanks, but it is not a module load problem. SM-T525 kernel builds without modules support and wifi driver (bcm4339) compilled into the kernel.
Click to expand...
Click to collapse
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?

There are patches for SM-T525 kernel source that resolve problem with "modules support" compilation
--- 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 =
Click to expand...
Click to collapse

Yes! I did it!
To fix wifi: ro.securestorage.support=false in build.prop

thornev said:
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
Click to expand...
Click to collapse
I am a builder and what he said is correct.
Samsung did some crazy stuff with Knox.

scrosler said:
I am a builder and what he said is correct.
Samsung did some crazy stuff with Knox.
Click to expand...
Click to collapse
can you make a thread showing us some the difficulties you encountered working around Knox?
Silkmeister

@Silkmeister1, @Scott, @vanyas, @crpalmer:
I do have a WiFi/BT issue with my (second hand) device. Wifi/BT is not to be enabled in Android. My first suspect was a broken connection, but couldn't found something obvious.
I tried to update Stock Rom and found and issue with ODIN. Stock Rom was not installable, returns with size error in hidden image. (??? what is in there ???). Installed latest LOS and checked the boot messages.
Do you think this can be a software issue? Is there anything missing (stuff in hidden partition) ?
Code:
failed to power up wifi chip, retry again (4 left) **
[ 4.035535] ## wifi_remove
[ 4.035538] wifi_set_power = 0
[ 4.035541] ------------------------------------------------
[ 4.035542] ------------------------------------------------
[ 4.035544] brcm_wlan_power Enter: power off
[ 4.035548] WL_REG_ON off-step : [1]
[ 4.035554] WL_REG_ON off-step-2 : [0]
[ 4.139482] wifi_set_carddetect = 0
[ 4.139485] brcm_wifi_status:359 status 0
[ 4.139487] mmc0: Slot status change detected (1 -> 0)
[ 4.139870] wifi_set_power = 1
[ 4.139873] ------------------------------------------------
[ 4.139874] ------------------------------------------------
[ 4.139876] brcm_wlan_power Enter: power on
[ 4.139880] WL_REG_ON on-step : [0]
[ 4.139887] WL_REG_ON on-step-2 : [1]
[ 4.349477] wifi_set_carddetect = 1
[ 4.349480] brcm_wifi_status:359 status 1
…
Complete bootlog can be seen here in the attachment:
https://forum.xda-developers.com/showpost.php?p=72624259&postcount=213
Any help is welcome!

Related

[Q] Why won't my Allwinner A10 Kernel Boot?

Hello All,
So here's the situation: I am trying to use my cheap virtually unbrickable tablet to learn more about kernel development and eventually ROM building.
I have extracted the manufacturers (WoPad) LiveSuit image and used split_bootimg.pl to break up the boot image.
I extracted the config file from the kernel image using extract-ikconfig and it created a config file. I didn't see the config in /proc.
So, I have the factory ramdisk and the factory kernel config.
I have downloaded several kernel sources (lichee-3.0.8, ChritianTroy's 3.0.36, and another one from linux-sunxi 3.0.72). I can successfully compile all of them without errors and they all generate zImages, uImages, etc using the factory config as well as the sun4i_crane configs they come with.
When I repack the boot.img with the newly created kernel and install it on nandc it wont' boot past the android icon (u-boot). I was hoping someone could shed light where I'm messing up. When I compare my boot.img to the factory one, they both have the same offset where the kernel starts (0x00000800). I have also ensured I'm replacing the kernel modules when I'm changing kernel versions.
Here is the line I'm using to repack the boot.img
Code:
mkbootimg --base 0x40000000 --pagesize 2048 --kernel zImage --ramdisk ramdisk-repack.cpio.gz --board sun4i --cmdline \"console=ttyS0,115200 rw init=/init loglevel=8\" -o boot.img
OR
mkbootimg --base 0x40000000 --pagesize 2048 --kernel bImage --ramdisk ramdisk-repack.cpio.gz --board sun4i --cmdline \"console=ttyS0,115200 rw init=/init loglevel=8\" -o boot.img
OR
mkbootimg --base 0x40000000 --pagesize 2048 --kernel uImage --ramdisk ramdisk-repack.cpio.gz --board sun4i --cmdline \"console=ttyS0,115200 rw init=/init loglevel=8\" -o boot.img
Any help will be appreciated. Also, I'm building on Ubuntu 13.04 with Google GCC 4.6 from the ndk. I have built kernels for other devices without issues. This one has me stumped.
Thanks
Here is an output from UART
Code:
CPU: SUNXI Family
Board: A10-EVB
DRAM: 512 MiB
NAND: 3800 MiB
*** Warning - bad CRC, using default environment
In: serial
Out: serial
Err: serial
--------fastboot partitions--------
-total partitions:9-
-name- -start- -size-
bootloader : 100000 1000000
env : 1100000 200000
boot : 1300000 2000000
system : 3300000 10000000
data : 13300000 40000000
misc : 53300000 100000
recovery : 53400000 2000000
cache : 55400000 8000000
UDISK : 5d400000 90400000
-----------------------------------
Hit any key to stop autoboot: 0
NAND read: device 0 offset 0x1300000, size 0x2000000
33554432 bytes read: OK
Starting kernel ...
Since I posted my question, I have managed to work my way through some errors but I'm stuck again. Now I'm having issues getting past init. It is stuck in a loop because of this:
Code:
<4>ft5x_ts: Unknown symbol _GLOBAL_OFFSET_TABLE_ (err 0)
[ 8.740000] ft5x_ts: Unknown symbol _GLOBAL_OFFSET_TABLE_ (err 0)
<6>init: command 'insmod' r=-1
[ 8.780000] init: command 'insmod' r=-1
<4>hv2605: Unknown symbol _GLOBAL_OFFSET_TABLE_ (err 0)
[ 8.840000] hv2605: Unknown symbol _GLOBAL_OFFSET_TABLE_ (err 0)
<6>init: command 'insmod' r=-1
[ 8.850000] init: command 'insmod' r=-1
<4>ump: Unknown symbol _GLOBAL_OFFSET_TABLE_ (err 0)
[ 9.000000] ump: Unknown symbol _GLOBAL_OFFSET_TABLE_ (err 0)
<6>init: command 'insmod' r=-1
Again, if any kernel devs out there are reading this your assistance is appreciated.
I was able to solve this on my own too. Ended up being the tool chain I was using. I used 4.4.3 and all is well. Only bug I'm having is a WiFi driver issue now.
Sent from my YP-G70 using xda premium
rjwil1086 said:
I was able to solve this on my own too. Ended up being the tool chain I was using. I used 4.4.3 and all is well. Only bug I'm having is a WiFi driver issue now.
Sent from my YP-G70 using xda premium
Click to expand...
Click to collapse
dude i know its a bit late but can you walk me through your entire kernel compilation procedure starting by sharing the source and the tricks of booting the newly created kernel ?

Fastboot boot image : dtb not found

HI there
I am having a problem to re-pack my boot image to boot in my new Pantech A880S....
It is working fine if I just fastboot boot <original image>
but once I extract the ZImage and Ramdisk and then re-pack it (eventhough I didn't change anything)
and when I re-try fastboot boot <re-packed image> it comes up with error: dtb not found
I tried this same issue either on linux abootimg to re-pack image or using Win32 port exe to re-pack it
e.g. http://forum.xda-developers.com/showpost.php?p=45157543&postcount=144
Is there anyone know why? I never seen this before on other devices with such error..
anyone know about kernel and dtb , how to extract them and pack them correctly?
Splitting image to "/split_img/" . . .
BOARD_KERNEL_CMDLINE console=ttyHSL0,115200,n8 androidboot.hardware=qcom user_debug=31 maxcpus=2 msm_rtb.filter=0x3F ehci-hcd.park=3 loglevel=0
BOARD_KERNEL_BASE 00000000
BOARD_PAGE_SIZE 2048
BOARD_RAMDISK_ADDR 02000000
Unpacking ramdisk to "/ramdisk/" . . .
Compression used: gzip
4704 blocks
Done!
Everything looks ok, but when I using fastboot to boot it (my device has been unloacked bootloader)
>fastboot boot image-new.img
downloading 'boot.img'...
OKAY [ 0.301s]
booting...
FAILED (remote: dtb not found)
finished. total time: 0.316s
Edit:
I tried to looking other similar kernel source from LG G2 (MSM8974)
/arch/arm/mach-msm/akefile.boot
I seems LG also using DTB in its kernel... so I am wondering current abootimg can handle it or not?
# MSM8974
zreladdr-$(CONFIG_ARCH_MSM8974) := 0x00008000
ifeq ($(CONFIG_MACH_LGE),n)
dtb-$(CONFIG_ARCH_MSM8974) += msm8974-v1-cdp.dtb
dtb-$(CONFIG_ARCH_MSM8974) += msm8974-v1-fluid.dtb
dtb-$(CONFIG_ARCH_MSM8974) += msm8974-v1-liquid.dtb
dtb-$(CONFIG_ARCH_MSM8974) += msm8974-v1-mtp.dtb
dtb-$(CONFIG_ARCH_MSM8974) += msm8974-v1-rumi.dtb
dtb-$(CONFIG_ARCH_MSM8974) += msm8974-v1-sim.dtb
dtb-$(CONFIG_ARCH_MSM8974) += msm8974-v2-cdp.dtb
dtb-$(CONFIG_ARCH_MSM8974) += msm8974-v2-fluid.dtb
dtb-$(CONFIG_ARCH_MSM8974) += msm8974-v2-liquid.dtb
dtb-$(CONFIG_ARCH_MSM8974) += msm8974-v2-mtp.dtb
dtb-$(CONFIG_ARCH_MSM8974) += apq8074-v2-liquid.dtb
dtb-$(CONFIG_ARCH_MSM8974) += apq8074-v2-dragonboard.dtb
else
dtb-$(CONFIG_ARCH_MSM8974_G2_KR) += msm8974-g2-kr.dtb
dtb-$(CONFIG_ARCH_MSM8974_G2_KR) += msm8974-v2-g2-kr.dtb
dtb-$(CONFIG_ARCH_MSM8974_G2_ATT) += msm8974-g2-att.dtb
dtb-$(CONFIG_ARCH_MSM8974_G2_ATT) += msm8974-v2-g2-att.dtb
dtb-$(CONFIG_ARCH_MSM8974_G2_VZW) += msm8974-g2-vzw.dtb
dtb-$(CONFIG_ARCH_MSM8974_G2_VZW) += msm8974-v2-g2-vzw.dtb
dtb-$(CONFIG_ARCH_MSM8974_G2_SPR) += msm8974-g2-spr.dtb
dtb-$(CONFIG_ARCH_MSM8974_G2_SPR) += msm8974-v2-g2-spr.dtb
dtb-$(CONFIG_ARCH_MSM8974_G2_TMO_US)+= msm8974-g2-tmo_us.dtb
dtb-$(CONFIG_ARCH_MSM8974_G2_TMO_US)+= msm8974-v2-g2-tmo_us.dtb
dtb-$(CONFIG_ARCH_MSM8974_G2_DCM) += msm8974-g2-dcm.dtb
dtb-$(CONFIG_ARCH_MSM8974_G2_DCM) += msm8974-v2-g2-dcm.dtb
dtb-$(CONFIG_ARCH_MSM8974_G2_KDDI) += msm8974-g2-kddi.dtb
dtb-$(CONFIG_ARCH_MSM8974_G2_KDDI) += msm8974-v2-g2-kddi.dtb
dtb-$(CONFIG_ARCH_MSM8974_G2_OPEN_COM) += msm8974-g2-open_com.dtb
dtb-$(CONFIG_ARCH_MSM8974_G2_OPEN_COM) += msm8974-v2-g2-open_com.dtb
dtb-$(CONFIG_ARCH_MSM8974_G2_OPEN_AME) += msm8974-g2-open_ame.dtb
dtb-$(CONFIG_ARCH_MSM8974_G2_OPEN_AME) += msm8974-v2-g2-open_ame.dtb
dtb-$(CONFIG_ARCH_MSM8974_G2_OPT_AU) += msm8974-g2-opt_au.dtb
dtb-$(CONFIG_ARCH_MSM8974_G2_OPT_AU) += msm8974-v2-g2-opt_au.dtb
dtb-$(CONFIG_ARCH_MSM8974_G2_CA) += msm8974-g2-ca.dtb
dtb-$(CONFIG_ARCH_MSM8974_G2_CA) += msm8974-v2-g2-ca.dtb
endif
I modified the split tool to support dtb, please test it……
Modify permissions before you use it
chmod a+x split_bootimg_dtb.pl
View attachment split_bootimg_dtb.zip
thank benjaminwan
https://github.com/xiaolu/mkbootimg_tools
benjaminwan said:
I modified the split tool to support dtb, please test it……
Modify permissions before you use it
chmod a+x split_bootimg_dtb.pl
View attachment 2229037
Click to expand...
Click to collapse
I'm testing, hoping to succeed @benjaminwan :fingers-crossed:
benjaminwan said:
I modified the split tool to support dtb, please test it……
Modify permissions before you use it
chmod a+x split_bootimg_dtb.pl
View attachment 2229037
Click to expand...
Click to collapse
Great work! I'm going to see if I can adapt this back into unpackbootimg. :good:
https://github.com/CyanogenMod/android_system_core/tree/cm-10.2/mkbootimg
Edit: Easier than I thought just using what was already in unpackbootimg.c and bootimg.h
Soon to be added to my Android Image Kitchen: http://v.ht/AIK-
reachedxyz said:
thanks you pro
Click to expand...
Click to collapse
help me. phone my brick
Chenglu said:
https://github.com/xiaolu/mkbootimg_tools
Click to expand...
Click to collapse
Thanks, thats work for me :angel:
Hello Guys,
I'm trying to boot the HTD Desire 510 recovery CWM on my new Wiko Ridge 4G.
I also got the DTB issue, but I'm not sure on how to fix it.
Can anyone throw me some tips on this?
I've chosen the Desire CWM because it have the same chipset.
Cheers
help me
please give me some tutorial to modif the split tool.
Hi Benjamin,
I am using Lenovo a6000 plus and getting the same error while I try to fastboot using command <fastboot boot "c:\Users\rakesh\lenovo-recovery-file\recovery.img">
What should I do?
I am not even able to enter recovery mode. My mobile got switched off during android upgradation. I think I lost some system file.
My phone lenovo a6000 plus error remote dtb not found how to fix the problem
Booting problem
Please tell Step by Step. Need help does not boot into any recovery.
hi iam also having same problem for my lenovo a6000 when itry to boot into recovery iam getting this error failed {remote:dtb not found} please help m any one.
How to apply da zip file to fix dtb not found during flashboot boot recovery.img command@benjaminwan

[Q] pmid10c boot image help

I am looking to compile a new kernel for this device. I have pulled off the boot.img file from /dev/block/nandc and used split_bootimg.pl to pull apart the kernel and the boot ramdisk. I have used extract-ikconfig to get the kernel config and built my new 3.4 kernel (with modules). So far so good...
I have tried to build the new boot.img file with no avail. My concern is with the original kernel as the new one should be build the same (I think). It looks like it is not compressed as I run the command
file boot.img-kernel
It returns
boot.img-kernel: data
So it is not a Linux kernel ARM boot executable zImage
Is this correct? Can Android boot with this or is the split_bootimg.pl tool not creating the file correctly (it does pull the ramdisk as I have uncompressed it fine! and the file does contain the kernel config)
Ok So assuming I can create a proper boot.img with my built zImage and the old ramdisk, what do I need to do with the modules? Do I update the boot.img on the tablet and copy the modules over to the existing /system/lib/modules? (this appears to not work)
I did not find an exact guide on android kernel and the modules....
Domenic
link to the old (working) boot.img hxxps://docs.google.com/file/d/0B0c1jpaziDZ-NU5Sd18wbUVjN1E/edit?usp=sharing
some progress
domenictroilo said:
I am looking to compile a new kernel for this device. I have pulled off the boot.img file from /dev/block/nandc and used split_bootimg.pl to pull apart the kernel and the boot ramdisk. I have used extract-ikconfig to get the kernel config and built my new 3.4 kernel (with modules). So far so good...
I have tried to build the new boot.img file with no avail. My concern is with the original kernel as the new one should be build the same (I think). It looks like it is not compressed as I run the command
file boot.img-kernel
It returns
boot.img-kernel: data
So it is not a Linux kernel ARM boot executable zImage
Is this correct? Can Android boot with this or is the split_bootimg.pl tool not creating the file correctly (it does pull the ramdisk as I have uncompressed it fine! and the file does contain the kernel config)
Ok So assuming I can create a proper boot.img with my built zImage and the old ramdisk, what do I need to do with the modules? Do I update the boot.img on the tablet and copy the modules over to the existing /system/lib/modules? (this appears to not work)
I did not find an exact guide on android kernel and the modules....
Domenic
link to the old (working) boot.img hxxps://docs.google.com/file/d/0B0c1jpaziDZ-NU5Sd18wbUVjN1E/edit?usp=sharing
Click to expand...
Click to collapse
Ok so the mkimage command can be used to pull the uImage out of the Kernel Part of the file like this:
mkimage -A arm -O linux -T kernel -C none -a 0x40008000 -e 0x40008000 -n "Linux 3.0.8" -d uImage boot.img-kernel2
The only question is where in the boot process can I find the "Load Address" and "Entry Point" values that are required to create my uImage. I would think that these are going to be needed as options when I build my new kernel, and I will need to change the boot process or add a boot.scr file with my options. I have mounted the /dev/block/nanda partition (uBoot partition) but am not certain on where I would find the current environment values.
I did find this little snippet on the net that referes to the base address for this device xxx.tabletroms.com/forums/all-other-android-tablets-general-discussion/5791-full-specs-whatever-else-polaroid-pmid10c-tablet-2.htmlx
mkbootimg --kernel boot.img-kernel --ramdisk boot.img-ramdisk.cpio.gz --cmdline 'console=ttyS0,115200 rw init=/init loglevel=8' --board sun4i --base 0x40000000 -o boot.img
But he never discusses where he found the -base address. Is this the same as the Load Address and Entry Point?
Domenic
domenictroilo said:
Ok so the mkimage command can be used to pull the uImage out of the Kernel Part of the file like this:
mkimage -A arm -O linux -T kernel -C none -a 0x40008000 -e 0x40008000 -n "Linux 3.0.8" -d uImage boot.img-kernel2
The only question is where in the boot process can I find the "Load Address" and "Entry Point" values that are required to create my uImage. I would think that these are going to be needed as options when I build my new kernel, and I will need to change the boot process or add a boot.scr file with my options. I have mounted the /dev/block/nanda partition (uBoot partition) but am not certain on where I would find the current environment values.
I did find this little snippet on the net that referes to the base address for this device xxx.tabletroms.com/forums/all-other-android-tablets-general-discussion/5791-full-specs-whatever-else-polaroid-pmid10c-tablet-2.htmlx
mkbootimg --kernel boot.img-kernel --ramdisk boot.img-ramdisk.cpio.gz --cmdline 'console=ttyS0,115200 rw init=/init loglevel=8' --board sun4i --base 0x40000000 -o boot.img
But he never discusses where he found the -base address. Is this the same as the Load Address and Entry Point?
Domenic
Click to expand...
Click to collapse
So the base address is found in script.bin (converted to text file with bin2fex tool). This is the information found in it:
[dram_para]
dram_baseaddr = 0x40000000
Still how do I find the "Load Address" and "Entry Point" for the current kernel...
unmkbootimg
domenictroilo said:
So the base address is found in script.bin (converted to text file with bin2fex tool). This is the information found in it:
[dram_para]
dram_baseaddr = 0x40000000
Still how do I find the "Load Address" and "Entry Point" for the current kernel...
Click to expand...
Click to collapse
Well more reading leads me to use unmkbootimg but on my linux 32bit system all I get is:
# strace ./unmkbootimg
execve("./unmkbootimg", ["./unmkbootimg"], [/* 20 vars */]) = 0
--- SIGILL (Illegal instruction) @ 0 (0) ---
+++ killed by SIGILL +++
Illegal instruction
Too bad I can see the souce code to find out what this program is doing or compile it for myself.....
split_bootimg.pl should give you the parameters i listed on tabletroms.
What source are you using? Polaroid never coughed any up and i last harassed them in February.
bigsupersquid said:
split_bootimg.pl should give you the parameters i listed on tabletroms.
What source are you using? Polaroid never coughed any up and i last harassed them in February.
Click to expand...
Click to collapse
Here is the split:
letourneau:~/tmp# ../split_bootimg.pl /root/boot.img
Page size: 2048 (0x00000800)
Kernel size: 8112836 (0x007bcac4)
Ramdisk size: 210343 (0x000335a7)
Second size: 0 (0x00000000)
Board name:
Command line: console=ttyS0,115200 rw init=/init loglevel=8
Writing boot.img-kernel ... complete.
Writing boot.img-ramdisk.gz ... complete.
I am using the linux--sunxi kernel for now with an additional patch for dmard06.ko (which I do not expect to work!) I emailed them for the kernel source but just received a form email saying they will get back to me..... oh well I will as again.
Just playing around for now to see if a newer kernel will tweek up the speed on this device as it is very laggy.
Domenic
I may be using an older version of split_bootimg.pl?
On another note, I was able to execute unmkbootimg on a different linux server. I was attempting to run it on a PIII 800 so it needs something > a pentium (I guess).
./unmkbootimg boot.img
unmkbootimg version 1.2 - Mikael Q Kuisma <[email protected]>
Kernel size 8112836
Kernel address 0x40008000
Ramdisk size 210343
Ramdisk address 0x41000000
Secondary size 0
Secondary address 0x40f00000
Kernel tags address 0x40000100
Flash page size 2048
Board name is ""
Command line "console=ttyS0,115200 rw init=/init loglevel=8"
This image is built using standard mkbootimg
Extracting kernel to file zImage ...
Extracting root filesystem to file initramfs.cpio.gz ...
All done.
---------------
To recompile this image, use:
mkbootimg --kernel zImage --ramdisk initramfs.cpio.gz --base 0x40000000 --cmdline 'console=ttyS0,115200 rw init=/init loglevel=8' -o new_boot.img
---------------
Domenic
think the parameters you're searching for are specific for building the new kernel without proper source code to extract them from?
maybe you could get them from dmesg while the tablet is running?
else think there might be a way to grep the variable names in the existing kernel binary or headers?
i also would like a fresh kernel.
maybe useful stuff here:
https://vilimpoc.org/research/sh3dev/kernel-hacking.html
http://forum.xda-developers.com/showpost.php?p=46668556&postcount=31
thanks jjchico
i haven't checked this out yet, but may be useful.
Well I have build a new kernel and copied the modules over, but I does not boot. It appears that it never mounts the ramdisk as it never gets to the second splash screen, but I am flying blind as there is no serial port to debug with. I suspect that I do not quite understand the boot process for this tablet.... here is what is on the nanda vfat partition: (good information here http://rhombus-tech.net/allwinner_a10/a10_boot_process/)
since this is in my linux.ini
cat linux.ini
[segment]
img_name = c:\linux\u-boot.bin
img_size = 0x80000
img_base = 0x4A000000
[script_info]
script_base = 0x43000000
script_size = 0x10000
[logo_info]
logo_name = c:\linux\linux.bmp
logo_show = 1
Not quite certain how to setup img_base on my compile I guess.
I have tried the linix.ini from the link above but the tablet booted to livesuite image... that is a fail.
Not being a kernel developer.... I am wondering if the option to setup SUNXI_NAND_COMPAT_DEV is creating /dev/block/nandX or /dev/nandX as this will definatly impact the init.sun4i.rc file as it is mounting /dev/block/nandX This could be my first issue.... but then does /init first display the initlogo.rle or start processing init.sun4i.rc. Well if the first thing it does in load initlogo.rle then I am not even getting this far....below is the description of SUNXI_NAND_COMPAT_DEV
Symbol: SUNXI_NAND_COMPAT_DEV [=y] │
│ Type : boolean │
│ Prompt: Create old nand device names (nanda-nandz) │
│ Defined at drivers/block/Kconfig:564 │
│ Depends on: BLK_DEV [=y] && SUNXI_NAND [=y] │
│ Location: │
│ -> Device Drivers │
│ -> Block devices (BLK_DEV [=y]) │
│ -> SUNXI Nandflash Driver (SUNXI_NAND [=y]) │
well a little more reading leads me to this page on the CarbonRom http://www.slatedroid.com/topic/64378-rom-carbonrom-422/ turns out that if you want to run a 3.4 kernel you MUST update u-boot (http://www.mediafire...4ro667xcfkd2dv7).... so I have flashed the CarbonRom and it does boot with the u-boot update. Not to worry the new u-boot will still boot the old kernel. The only issue I have with the CarbonRom kernel is the missing dmard06 driver so no touch screen..... I may get a new kernel working yet!
domenictroilo said:
well a little more reading leads me to this page on the CarbonRom http://www.slatedroid.com/topic/64378-rom-carbonrom-422/ turns out that if you want to run a 3.4 kernel you MUST update u-boot (http://www.mediafire...4ro667xcfkd2dv7).... so I have flashed the CarbonRom and it does boot with the u-boot update. Not to worry the new u-boot will still boot the old kernel. The only issue I have with the CarbonRom kernel is the missing dmard06 driver so no touch screen..... I may get a new kernel working yet!
Click to expand...
Click to collapse
https://github.com/fsebentley/linux_allwinner_drivers_input_touchscreen_mods
https://groups.google.com/forum/#!topic/linux-sunxi/D0n8dyaVA34
?
bigsupersquid said:
https://github.com/fsebentley/linux_allwinner_drivers_input_touchscreen_mods
https://groups.google.com/forum/#!topic/linux-sunxi/D0n8dyaVA34
?
Click to expand...
Click to collapse
the patch compiles,you need to comment out #include <linux/earlysuspend.h> as it is not supported on the newer kernel and not required by the driver anyway. I just need to get the kernel to actually load lol..... I have at least gotten past the boot screen now, but it hangs.... I will try a different arm tool chain and see what happens next.....
So close but yet so far..... well I have the new kernel installed and booted with adb shell available but it turns out the new mma7660.ko is not compatable with my device I get this error from dmesg over and over and over....
<4>[ 3254.934675] incomplete xfer (0x20)
<3>[ 3254.938093] Assertion failed! drivers/hwmon/mma7660.c,196,mma7660_read_xyz,result>=0
Will rename the driver and see if I can get past init further in the boot....
Edit
Well more issues with drivers the dmard06 is not compatible either, I had more success with the Carbon Kernel I will see if I can find the source git, should be around....
dmesg | busybox grep dmard
<4>[ 5.408528] dmard06: init
<3>[ 5.447835] dmard06gsensor_fetch_sysconfig_para: after: gsensor_twi_addr is 0x4c, dirty_addr_buf: 0x4c. dirty_addr_buf[1]: 0xfffe
<4>[ 5.488546] dmard06_init: after fetch_sysconfig_para: normal_i2c: 0x4c. normal_i2c[1]: 0xfffe
<6>[ 5.508612] gsensor_detect: Detected chip dmard06 at adapter 1, address 0x4c
<4>[ 5.601533] dmard06 gsensor I2C err = 0!
<4>[ 5.613430] dmard06 probe failed
<4>[ 5.624926] dmard06: probe of 1-004c failed with error -1
This all makes some sense as Polaroid has not get gotten me the kernel and the drivers they load (their kernel have very unique names:
Module Size Used by Not tainted
8192cu 575431 0
rtl8150 8910 0
mcs7830 6557 0
qf9700 8513 0
asix 22500 0
usbnet 23745 3 mcs7830,qf9700,asix
dmard06_gl 8202 2
mma7660 6541 0
mali 130177 14
ump 42178 19 mali
gt811_ts_828 19947 0
sun4i_csi0 27946 0
nt99250 14254 1
gc0308 12848 1
videobuf_dma_contig 5659 1 sun4i_csi0
videobuf_core 18067 2 sun4i_csi0,videobuf_dma_contig
Well more issues with drivers the dmard06 is not compatible either, I had more success with the Carbon Kernel I will see if I can find the kernel source git, should be around....
dmesg | busybox grep dmard
<4>[ 5.408528] dmard06: init
<3>[ 5.447835] dmard06gsensor_fetch_sysconfig_para: after: gsensor_twi_addr is 0x4c, dirty_addr_buf: 0x4c. dirty_addr_buf[1]: 0xfffe
<4>[ 5.488546] dmard06_init: after fetch_sysconfig_para: normal_i2c: 0x4c. normal_i2c[1]: 0xfffe
<6>[ 5.508612] gsensor_detect: Detected chip dmard06 at adapter 1, address 0x4c
<4>[ 5.601533] dmard06 gsensor I2C err = 0!
<4>[ 5.613430] dmard06 probe failed
<4>[ 5.624926] dmard06: probe of 1-004c failed with error -1
This all makes some sense as Polaroid has not provided me the kernel they used and the drivers they load have unique names see below from the original stock rom:
Module Size Used by Not tainted
8192cu 575431 0
rtl8150 8910 0
mcs7830 6557 0
qf9700 8513 0
asix 22500 0
usbnet 23745 3 mcs7830,qf9700,asix
dmard06_gl 8202 2
mma7660 6541 0
mali 130177 14
ump 42178 19 mali
gt811_ts_828 19947 0
sun4i_csi0 27946 0
nt99250 14254 1
gc0308 12848 1
videobuf_dma_contig 5659 1 sun4i_csi0
videobuf_core 18067 2 sun4i_csi0,videobuf_dma_contig
I suspect after all the trouble I had with LG source that there are device-specific bits in the drivers.
Polaroid will most likely have to cough up source to get it all working.
Have you considered trying punchmod to use the old drivers? I dunno if that'd work considering the stock kernel is a lower version... but it might be worth a try.
bigsupersquid said:
I suspect after all the trouble I had with LG source that there are device-specific bits in the drivers.
Polaroid will most likely have to cough up source to get it all working.
Have you considered trying punchmod to use the old drivers? I dunno if that'd work considering the stock kernel is a lower version... but it might be worth a try.
Click to expand...
Click to collapse
I have changed the vermagic on the old modules and tried with the newer kernel but no go.... the latest 3.0 sunxi kernel is at 3.0.96 so I will build this one and see if I can get the special 3.0.8 polaroid modules to load.
I have a ticket open with Polaroid lol I guess we will see if the cough up a kernel or not.... I would not put money on it...
domenictroilo said:
I have changed the vermagic on the old modules and tried with the newer kernel but no go.... the latest 3.0 sunxi kernel is at 3.0.96 so I will build this one and see if I can get the special 3.0.8 polaroid modules to load.
I have a ticket open with Polaroid lol I guess we will see if the cough up a kernel or not.... I would not put money on it...
Click to expand...
Click to collapse
I've had an open ticket since November from talking on the phone after email did nothing.
nothing but autoresponder.
bigsupersquid said:
I've had an open ticket since November from talking on the phone after email did nothing.
nothing but autoresponder.
Click to expand...
Click to collapse
Do you believe that something like this http://gpl-violations.org/faq/violation-faq.html could force them to provide the source code? I could try to get the group at "FreakTab" to make the same requests for the kernel sources. Maybe with enough requests the gpl-violations group could take it on?
(K I am getting off topic here sorry anyone out there......)
I have attempted to build the 3.0.96 kernel but it did not boot.... back to hacking at the .config to see what I have missed (I need to move my build environment off this old p3 800 lol)

[Q][SOLVED] How to solve " make_f2fs " problem on mac custom rom builds?

I'm using Mac OS X Yosemite(10.10.5) on my Dell Inspiron N5110 Notebook(Hackintosh)
And recently, i tried to build CM 12.1 for memul(HTC One Mini 2).
I got several problems which only occurs on Mac OS.
I googled errors that i got. Unfortunately, many unexperienced developers couldn't solve some of the errors but they got same problems as me.
By the way, I'm not that experienced as well.
So i decided to dig in to the problems/errors in order to solve them and get a installable zip file for my device.
And now i hope, i can shed light onto your problems as well. So you can solve the errors and get a installable zip build on Mac OS X too.
Problem & Errors
##########################
PROBLEM : We can't use make_f2fs command on Macs
UNDERSTANDING IT : The command is not supported on Mac OS, but works under linux.
You will probably get errors like shown below.
1 - No rule to make target ' out/host/darwin-x86/bin/make_f2fs', needed by
Error example;
No rule to make target `/Volumes/CM/out/host/darwin-x86/bin/make_f2fs', needed by `/Volumes/CM/out/target/product/deviceName/obj/PACKAGING/systemimage_intermediates/system.img'. Stop.
Click to expand...
Click to collapse
####################################################
2- line XX: make_f2fs: command not found
Error example;
/Volumes/CM/out/host/darwin-x86/bin/mkf2fsuserimg.sh: line 31: make_f2fs: command not found
Traceback (most recent call last):
File "./build/tools/releasetools/add_img_to_target_files", line 376, in <module>
main(sys.argv[1:])
File "./build/tools/releasetools/add_img_to_target_files", line 370, in main
AddImagesToTargetFiles(args[0])
File "./build/tools/releasetools/add_img_to_target_files", line 339, in AddImagesToTargetFiles
AddUserdata(output_zip)
File "./build/tools/releasetools/add_img_to_target_files", line 185, in AddUserdata
assert succ, "build userdata.img image failed"
AssertionError: build userdata.img image failed
make: *** [/Volumes/CM/out/target/product/memul/obj/PACKAGING/target_files_intermediates/cm_memul-target_files-95fd807476.zip] Error 1
make: *** Deleting file `/Volumes/CM/out/target/product/memul/obj/PACKAGING/target_files_intermediates/cm_memul-target_files-95fd807476.zip'
Click to expand...
Click to collapse
##########################
How To Fix
##########################
1- We should change some codes in device tree in order to solve "No rule to make target ' out/host/darwin-x86/bin/make_f2fs', needed by "
Step 1 : Go to your device tree folder (e.g. CM12_source/device/htc/memul/)
Step 2: Open BoardConfig.mk file in editor
Step 3: Find the line which includes f2fs
The line should be looking like that :
TARGET_USERIMAGES_USE_F2FS := true
Click to expand...
Click to collapse
Step 4: Change the line to;
ifeq ($(HOST_OS),linux)
TARGET_USERIMAGES_USE_F2FS := true
else
TARGET_USERIMAGES_USE_F2FS := false
endif
Click to expand...
Click to collapse
So, when we use that device-tree on linux the builds won't be affected of f2fs changes on device-tree.
But, for mac f2fs stuff will be disabled.(And that will solve the first problem)
##########################
2- You will get the second error when the building process almost finished.
It will try to do something with f2fs but obviously command doesn't exist.
NOTE THIS SOLUTION IS TEMPORARY, YOU SHOULD APPLY THIS FIX AGAIN WHEN YOU START BUILDING FROM SCRATCH
Step 1 : Go to that folder in your source directory "CM12_SourceFolder/out/host/darwin-x86/bin/"
Step 2 : You will see "mkf2fsuserimg.sh" file in that directory. Open it in editor.
Step 3 : mkf2fsuserimg.sh file contains something like below
#!/bin/bash
#
# To call this script, make sure make_f2fs is somewhere in PATH
function usage() {
cat<<EOT
Usage:
${0##*/} OUTPUT_FILE SIZE
EOT
}
echo "in mkf2fsuserimg.sh PATH=$PATH"
if [ $# -lt 2 ]; then
usage
exit 1
fi
OUTPUT_FILE=$1
SIZE=$2
shift; shift
if [ -z $SIZE ]; then
echo "Need size of filesystem"
exit 2
fi
MAKE_F2FS_CMD="make_f2fs -l $SIZE $OUTPUT_FILE"
echo $MAKE_F2FS_CMD
$MAKE_F2FS_CMD
if [ $? -ne 0 ]; then
exit 4
fi
Click to expand...
Click to collapse
Step 4 : Add Comment tag( #*) all of the lines in it except usage() function
Note : Adding Comment tag means putting hashtag before the lines, so we will make the required lines ineffective when the building process run the file
So the file should be looking like this (all of the usage function is still there and uncommented, be careful) :
#!/bin/bash
#
# To call this script, make sure make_f2fs is somewhere in PATH
function usage() {
cat<<EOT
Usage:
${0##*/} OUTPUT_FILE SIZE
EOT
}
#echo "in mkf2fsuserimg.sh PATH=$PATH"
#if [ $# -lt 2 ]; then
# usage
# exit 1
#fi
#OUTPUT_FILE=$1
#SIZE=$2
#shift; shift
#if [ -z $SIZE ]; then
# echo "Need size of filesystem"
# exit 2
#fi
#MAKE_F2FS_CMD="make_f2fs -l $SIZE $OUTPUT_FILE"
#echo $MAKE_F2FS_CMD
#$MAKE_F2FS_CMD
#if [ $? -ne 0 ]; then
# exit 4
#fi
Click to expand...
Click to collapse
Step 5 : And done, start the building process again with make command. The problems/errors should be solved.
NOTES FOR OTHER DEVELOPERS :
1 - I left usage function uncommented maybe something else calls it, i'm not sure.
2- Maybe /"Volumes/CM/out/host/darwin-x86/bin/mkf2fsuserimg.sh" fix can be made permanent for all builds by editing "cm12_source/system/extras/f2fs_utils/mkf2fsuserimg.sh" file. But i'm not sure.
Hp sy sprt di cloen dng seseorang data sy di hp semua di salin alamt wab sy pun di salin dng program mereka,, gimana memulihkan nya kembali
Hp sy sprt di cloen dng seseorang data sy di hp semua di salin alamt wab sy pun di salin dng program mereka ,, gimana cara nya kembali

Packing boot image for Desire 610 A3UL

I am following this tutorial on my desire 610: http://http://whiteboard.ping.se/Android/Debian
All has gone well so far, the system works in chroot, etc etc etc, thats not the problem. My problem is that i cant seem to pack a boot image that works for the phone. I know the problem is with my boot image, because if the init script had been initalised, I had a line at the start which would start a log file, and the system would bootloop. Instead it takes me to the fastboot menu when i power on.
I have used the tool to unpack the boot image, found at http://whiteboard.ping.se/Android/Unmkbootimg , and its output was this:
Code:
unmkbootimg version 1.2 - Mikael Q Kuisma <[email protected]>
Kernel size 6004624
Kernel address 0x8000
Ramdisk size 1017204
Ramdisk address 0x2008000
Secondary size 0
Secondary address 0xf00000
Kernel tags address 0x1e00000
Flash page size 2048
Board name is ""
Command line "console=ttyHSL0,115200,n8 androidboot.hardware=qcom user_debug=31 ehci-hcd.park=3"
*** WARNING ****
This image is built using NON-standard mkbootimg!
OFF_KERNEL_ADDR is 0xFE208100
OFF_RAMDISK_ADDR is 0x00208100
OFF_SECOND_ADDR is 0xFF100100
Please modify mkbootimg.c using the above values to build your image.
****************
Extracting kernel to file zImage ...
Extracting root filesystem to file initramfs.cpio.gz ...
All done.
---------------
To recompile this image, use:
mkbootimg --kernel zImage --ramdisk initramfs.cpio.gz --base 0x1dfff00 --cmdline 'console=ttyHSL0,115200,n8 androidboot.hardware=qcom user_debug=31 ehci-hcd.park=3' -o new_boot.img
---------------
I have tried doing as it says and compiling mkbootimg with those settings, however it still does not work. Could anyone possibly see what im doing wrong? And if not, does anyone have a copy of mkbootimg that works for the Desire 610?
Thanks in advance
falseascension said:
I am following this tutorial on my desire 610: http://http://whiteboard.ping.se/Android/Debian
All has gone well so far, the system works in chroot, etc etc etc, thats not the problem. My problem is that i cant seem to pack a boot image that works for the phone. I know the problem is with my boot image, because if the init script had been initalised, I had a line at the start which would start a log file, and the system would bootloop. Instead it takes me to the fastboot menu when i power on.
I have used the tool to unpack the boot image, found at http://whiteboard.ping.se/Android/Unmkbootimg , and its output was this:
Code:
unmkbootimg version 1.2 - Mikael Q Kuisma <[email protected]>
Kernel size 6004624
Kernel address 0x8000
Ramdisk size 1017204
Ramdisk address 0x2008000
Secondary size 0
Secondary address 0xf00000
Kernel tags address 0x1e00000
Flash page size 2048
Board name is ""
Command line "console=ttyHSL0,115200,n8 androidboot.hardware=qcom user_debug=31 ehci-hcd.park=3"
*** WARNING ****
This image is built using NON-standard mkbootimg!
OFF_KERNEL_ADDR is 0xFE208100
OFF_RAMDISK_ADDR is 0x00208100
OFF_SECOND_ADDR is 0xFF100100
Please modify mkbootimg.c using the above values to build your image.
****************
Extracting kernel to file zImage ...
Extracting root filesystem to file initramfs.cpio.gz ...
All done.
---------------
To recompile this image, use:
mkbootimg --kernel zImage --ramdisk initramfs.cpio.gz --base 0x1dfff00 --cmdline 'console=ttyHSL0,115200,n8 androidboot.hardware=qcom user_debug=31 ehci-hcd.park=3' -o new_boot.img
---------------
I have tried doing as it says and compiling mkbootimg with those settings, however it still does not work. Could anyone possibly see what im doing wrong? And if not, does anyone have a copy of mkbootimg that works for the Desire 610?
Thanks in advance
Click to expand...
Click to collapse
I just use Blobtools and linux's standard abootimg. I'll find some links and do a quick Howto when I get home tonight.
MiniBlu
MiniBlu said:
I just use Blobtools and linux's standard abootimg. I'll find some links and do a quick Howto when I get home tonight.
MiniBlu
Click to expand...
Click to collapse
Cheers! looking forward to getting this thing actually working
Aha! Using abootimg made it work. Wish i knew about that earlier...
There's still a few errors though, need to fix that. Thanks for your help, you literally saved probably hours and hours more work if I hadnt known about this. Much appreciated

Categories

Resources