[DEV] Kernel board - Galaxy S Plus I9001 Android Development

Hi,
Does someone knows which codename for the board the SGS+ use?
I know its for SGS2 in the kernel source: arch/arm/s5pv310.
What is it for SGS+?
It is for OC´ing
Netchip

stock kernel
Hi Netchip,
I don't know the codename.
Can somebody confirm following about the stock kernel:
-kernel base address 0x00400000
-pagesize 4096
As soon as I unpack and repack the boot.img (without modifications), the device doesn't boot anymore. Binary comparison between the repacked and original boot.img shows, that the last 30% of the file has changed.
I use the command
> mkbootimg --kernel zImage --ramdisk ramdisk --base 0x00400000 --pagesize 4096 -o repackedBoot.img
The same way workes on HTC and SE devices. Could it be somehow different for S+?
Any idea?
Thanks,
Adrian

Related

What base/pagesize parameters to use for mkbootimg?

I want to mod my stock boot.img for init.d support, but I'm not sure what "base" and "pagesize" parameters to use with mkbootimg. Can anyone help me out?
See here lines 37 and 38
imnuts said:
See here lines 37 and 38
Click to expand...
Click to collapse
Thanks! So, these settings are specific to the kernel. I see that for CM kernel, I would use:
BOARD_KERNEL_PAGESIZE := 4096
BOARD_KERNEL_BASE := 0x40000000
I was also trying to modify the stock boot.img for my device (p3110) and I came across a tool called "unmkbootimg" found here:
http://forum.xda-developers.com/showthread.php?t=1877807
When I use this new tool to extract the stock boot.img, I get this:
mkbootimg --kernel kernel.gz --ramdisk initramfs.cpio.gz --base 0x80000000 --cmdline 'console=ttyO2,115200n8 mem=1024M androidboot.console=ttyO2 vram=20M omapfb.vram=0:16M androidboot.carrier=wifi' -o new_boot.img
When I use the tool to extract the CM10 boot.img, I get this:
mkbootimg --kernel kernel.gz --ramdisk initramfs.cpio.gz --base 0x40000000 --pagesize 4096 -o new_boot.img
cool.

HOW TO... build kernel-unpack-pack-tar .. boot.img

lesson-01: HOW t Build kernel ..​
i'm using ubuntu 12 32bit .. toolchain linaro ..
- Download source tree .. from git or official web site there is now .. for 4.1.2 and 4.2.2 ..
- Download cross compiler **toolchain** ..
- edit makefile in the kernel tree ..
Code:
ARCH = arm
CROSS-COMPILE = /directery to your compiler **toolchain** /arm-eabi- or **see in bin folder**
- open terminal .and cd to kernel tree .. **cd /home/**yourname**/Deskt...... **
-type :
Code:
make clean
make mrproper
make bcm28155_capri_ss_s2vep_rev05_defconfig
** or you can extract config.gz from phone "cat /proc/config.gz > /sdcard/config.gz" extract file from config.gz rename it like this "blablabla_defconfig" put it in /kerneltree...../arch/arm/configs **
make menuconfig **if you want to add driver or feautre like NTFS support**
make -jX
Click to expand...
Click to collapse
multitask make ..X=2.....10 depance as your computer cpu power
and you will get zImage in "/kerneltree..../arch/arm/boot "
now you have t o make boot.img .. and there is big diffrent between them .. boot.img contain ramdisk and kernel .... pagesize .. base .. to the next lesson.
lesson-02: how to unpack boot.img and get ramdisk​
zImage **kernel** is like globel driver and configuration for the device .Ramdisk launch the rom and you can make rooted kernel with it ** you have to unpack ramdisk.gz to add modification and repack it **
you can extract from orginal firmware .. or extract it from phone :
** cat /dev/block/mmcblk0p5 > /sdcard/boot.img **
now how to unpack boot.img
cd to the tools folder ..
Code:
sudo cp mkbootimg /bin/
sudo chmod 755 /bin/mkbootimg
perl split_bootimg.pl boot.img
** boot.img of the rom you will use because off the ramdisk **
will show :
Page size: 4096 (0x00001000) ***we will need this***
Code:
Kernel size: 3132176 (0x002fcb10)
Ramdisk size: 3484496 (0x00352b50)
Second size: 0 (0x00000000)
Board name:
Command line:
Writing boot.img-kernel ... complete.
Writing boot.img-ramdisk.gz ... complete.
** now you can edit your ramdisk --superuser-init..it is like basic files for rom .. becaution **
Lesson-03: packing boot.img .. taring to flash via odin.​
now the packing .. we need : cmdline + pagesize + base without them it wont boot ..
how extract cmdline : ** cat /proc/cmdline > /sdcard/cmdline.txt **
you can find base in the cmdline file : [email protected]0xA2000000
for our device i9105p : base = 0xA2000000 pagesize = 4096
now packing :
Code:
./mkbootimg --pagesize 4096 --base 0xa2000000 --kernel zImage --ramdisk ramdisk.gz -o newboot.img
now we have the new boot.img you can use it with flash.zip CWM
or tar the img to flash it via odin.
Code:
$ tar -H ustar -c boot.img > kernel.tar
$ md5sum -t kernel.tar >> kernel.tar
$ mv kernel.tar kernel.tar.md5
:good:
reserved

[Completed] run nx403a kernel failed

I build the kernel from the source,and packed the zImage into boot.img.
But it did not work, after a burn the boot.img into the phone nx403a.
I will descript the build process and packet proccess ,later.
I build the source ,get the zImage,
and I use "mkbootimg --kernel zImage --ramdisk initramfs.cpio.gz --base 0x80200000 --cmdline 'console=null androidboot.hardware=qcom user_debug=31 msm_rtb.filter=0x3F ehci-hcd.park=3 maxcpus=4' -o new_boot.img"
to get the new_boot.img .
But it also doesn't work after I burn it use "dd if=new_boot.img of=\\?\Device\Harddisk2\Partition7".
Hi,
Sir please understand that this forum is not a "helpdesk" providing technical assistance but more to point you in the correct direction with your problem. Perhaps you can't find posts on how to root your phone, install custom recovery or maybe you have questions about how to navigate and use features on the site.
I suggest reading a couple of the relevant kernel tutorials found here....
xda-developers  Chef Central  Android
Good luck

Unpack and repack boot.img (Help needed, stuck at booting)

I've been trying for like hours to unpack and repack a boot.img.
I never made this before, I was reading much (actually too much) on the internet on how getting this done.
So... I downloaded some tools for unpacking and repacking the boot.img and followed this tutorial:
http://whiteboard.ping.se/Android/Unmkbootimg
and I suceeded. But when I repack it (WITHOUT modifying ANYTHING), and try to flash the "new" boot.img to the phone, the phone turns on and then shows up on the upper left corner of the screen "KERNEL IS NOT SEANDROID ENFORCING" and stays there. It goes no further. I simply unpacked it and then repacked it (to see if I made the whole process right, before screwing anything up).
I saw something curious: The original boot.img is 14.3MB and the new boot.img only 14.0MB. Is there anything that got lost in the process? Remember that I set all the "adresses" to the files right.
Unpacking command:
Code:
[email protected]:~/Área de Trabalho/UNPACKTOOLS$ ./umkbootimg boot.img
unmkbootimg version 1.2 - Mikael Q Kuisma <[email protected]>
Kernel size 11073112
Kernel address 0x8000
Ramdisk size 2525114
Ramdisk address 0x1000000
Secondary size 0
Secondary address 0xf00000
Kernel tags address 0x100
Flash page size 2048
Board name is ""
Command line "console=ttyS1,115200n8"
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 0x0 --cmdline 'console=ttyS1,115200n8' -o new_boot.img
---------------
[email protected]:~/Área de Trabalho/UNPACKTOOLS$
And repacking:
Code:
[email protected]:~/Área de Trabalho/UNPACKTOOLS$ ./mkbootimg --kernel zImage --ramdisk initramfs.cpio --base 0x0 --cmdline 'console=ttyS1,115200n8' -o new_boot.img --pagesize 2048 --ramdiskaddr 0x1000000
[email protected]:~/Área de Trabalho/UNPACKTOOLS$
I also tried without those adresses. Without luck.
The phone is a (Samsung J1) "J120H" with Android 5.1.1.
And the boot image I obtained by downloading the stock rom and unpacking ONLY the "boot.img". Remember: When I flash this file alone, IT WORKS. When I unpack and repack it, it stops working.
Here are the tools which came and my boot.img (unmodified from stock rom): https://volafile.io/get/overPkOTw66W/ToolsWithBootImg.zip
If anyone can direct me in the right way, I would be very happy.
Or maybe even modify the boot.img for me, set "secure=0" and repack it. Because my main goal is to root the device.
Thanks.
Anyone?
Sent from my SM-G925F using XDA-Developers mobile app
Nobody knows how to unpack a boot.img?
Sent from my SM-G925F using XDA-Developers mobile app
Not exactly answer to your problem. I tried same thing - just unpacking and repacking It stuck at boot saying 'fastboot reason fall through normal boot mode'
This SO: has similar post : http://stackoverflow.com/questions/27889621/error-with-repacking-boot-img-android
I suspect the base address is wrong in all three cases.
May be if you are searching for solution we can search together
[[email protected] kitkat]$ ./unmkbootimg boot.img
Kernel size 6022016
Kernel address 0x8000
Ramdisk size 716888
Ramdisk address 0x1000000
Secondary size 0
Secondary address 0xf00000
Kernel tags address 0x100
Flash page size 2048
Board name is ""
Command line "console=ttyHSL0,115200,n8 androidboot.console=ttyHSL0 androidboot.hardware=qcom user_debug=31 msm_rtb.filter=0x37 utags.blkdev=/dev/block/platform/msm_sdcc.1/by-name/utags vmalloc=400M"
Extracting kernel.gz ...
Extracting initramfs.cpio.gz ...
All done.
---------------
To recompile this image, use:
mkbooting --kernel kernel.gz --ramdisk initramfs.cpio.gz --base 0x0 --cmdline 'console=ttyHSL0,115200,n8 androidboot.console=ttyHSL0 androidboot.hardware=qcom user_debug=31 msm_rtb.filter=0x37 utags.blkdev=/dev/block/platform/msm_sdcc.1/by-name/utags vmalloc=400M' -o new_boot.img
---------------
Click to expand...
Click to collapse
glaks said:
Not exactly answer to your problem. I tried same thing - just unpacking and repacking It stuck at boot saying 'fastboot reason fall through normal boot mode'
This SO: has similar post : http://stackoverflow.com/questions/27889621/error-with-repacking-boot-img-android
I suspect the base address is wrong in all three cases.
May be if you are searching for solution we can search together
Click to expand...
Click to collapse
If you discover why, please let me know
Sent from my SM-G925F using XDA-Developers mobile app
Fusseldieb said:
If you discover why, please let me know
Sent from my SM-G925F using XDA-Developers mobile app
Click to expand...
Click to collapse
Changing --base 0x0 to --base 0x10008000 does the trick. You may need to play around with your device PHYS_OFFSET. For more read this https://lyncd.com/2011/03/android-kernel-mkbootimg-base/
http://k.japko.eu/boot-img-manipulation.html
Fusseldieb said:
I've been trying for like hours to unpack and repack a boot.img.
I never made this before, I was reading much (actually too much) on the internet on how getting this done.
So... I downloaded some tools for unpacking and repacking the boot.img and followed this tutorial:
http://whiteboard.ping.se/Android/Unmkbootimg
and I suceeded. But when I repack it (WITHOUT modifying ANYTHING), and try to flash the "new" boot.img to the phone, the phone turns on and then shows up on the upper left corner of the screen "KERNEL IS NOT SEANDROID ENFORCING" and stays there. It goes no further. I simply unpacked it and then repacked it (to see if I made the whole process right, before screwing anything up).
I saw something curious: The original boot.img is 14.3MB and the new boot.img only 14.0MB. Is there anything that got lost in the process? Remember that I set all the "adresses" to the files right.
Unpacking command:
Code:
[email protected]:~/Área de Trabalho/UNPACKTOOLS$ ./umkbootimg boot.img
unmkbootimg version 1.2 - Mikael Q Kuisma <[email protected]>
Kernel size 11073112
Kernel address 0x8000
Ramdisk size 2525114
Ramdisk address 0x1000000
Secondary size 0
Secondary address 0xf00000
Kernel tags address 0x100
Flash page size 2048
Board name is ""
Command line "console=ttyS1,115200n8"
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 0x0 --cmdline 'console=ttyS1,115200n8' -o new_boot.img
---------------
[email protected]:~/Área de Trabalho/UNPACKTOOLS$
And repacking:
Code:
[email protected]:~/Área de Trabalho/UNPACKTOOLS$ ./mkbootimg --kernel zImage --ramdisk initramfs.cpio --base 0x0 --cmdline 'console=ttyS1,115200n8' -o new_boot.img --pagesize 2048 --ramdiskaddr 0x1000000
[email protected]:~/Área de Trabalho/UNPACKTOOLS$
I also tried without those adresses. Without luck.
The phone is a (Samsung J1) "J120H" with Android 5.1.1.
And the boot image I obtained by downloading the stock rom and unpacking ONLY the "boot.img". Remember: When I flash this file alone, IT WORKS. When I unpack and repack it, it stops working.
Here are the tools which came and my boot.img (unmodified from stock rom): https://volafile.io/get/overPkOTw66W/ToolsWithBootImg.zip
If anyone can direct me in the right way, I would be very happy.
Or maybe even modify the boot.img for me, set "secure=0" and repack it. Because my main goal is to root the device.
Thanks.
Click to expand...
Click to collapse
Try using Carliv Kitchen Image

[Q] boot.img creation dt.img problem

Recently I tried to build kernel from source. All went pretty good, kernel works but only with old pre-build dt.img which comes with the boot.img which I use as a base.
To collect dt.img i used compiled from source
gitlab.com/Thecrazyskull/oneplus2/raw/652861ab053df83c61e4c8d4807a52598703a5e6/dtbTool/dtbtool.c
Code:
./dtbTool -s 4096 -o boot/dt.img -p kernel-out/scripts/dtc/ kernel-out/arch/arm64/boot/dts/
or mkqcdtbootimg(allow to specify dtb dir) from sony xperia
To make image I use github.com/luckasfb/mkbootimg-worked-mtk
Code:
./mkbootimg --kernel Image --ramdisk boot.img-ramdisk.gz --cmdline "console=ttyHSL0,115200,n8 androidboot.console=ttyHSL0 androidboot.hardware=qcom user_debug=31 msm_rtb.filter=0x37 ehci-hcd.park=3 lpm_levels.sleep_disabled=1 boot_cpus=0-5 ramoops_memreserve=2M androidboot.selinux=permissive" --base 0 --pagesize 4096 --dt dt.img --ramdisk_offset 01000000 --tags_offset 00000100 -o newboot.img
So, the question, what am I doing wrong?
Use the dtbTool found here https://source.codeaurora.org/quic/kernel/skales/tree/
git clone git://codeaurora.org/quic/kernel/skales
Click to expand...
Click to collapse
I use it in my kernel build helper and it works.
Cozzmy13 said:
Use the dtbTool found here https://source.codeaurora.org/quic/kernel/skales/tree/
I use it in my kernel build helper and it works.
Click to expand...
Click to collapse
Thanks a lot! It worked! Problem solved.
can I use this tool for qualcomm and exynos (samsung) devices?

Categories

Resources