[Q] boot.img creation dt.img problem - Xiaomi Mi 4C

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?

Related

[DEV] Kernel board

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

How to know the base of a android device

./mkbootimg --base 0x48000000 --cmdline 'console=-ttyHSL3 androidboot.hardware=holiday' --kernel recovery.img-kernel.gz --ramdisk ramdisk_recovery-edited.gz -o new_recovery.img
How to know the base of a android device

only for eXperienced Users - need help please !

hi there
i need some help
if someone could pack these for me it will be great.
couse i can not do it by my self.
boot.img-kernel and ramdisk-new.gz
here is the unpacked boot.img
http://www.mediafire.com/?njygqtmnypx7t8l
someone, anybody please pack them if you could with these values
BOARD_KERNEL_CMDLINE no command line just kernel and page
---------------------------------------------------
BOARD_KERNEL_BASE ------> ffff8000 <------
BOARD_PAGE_SIZE ------> 3270696 <------
---------------------------------------------------
i could not pack these values 3270696
it says page size error
my command line
./mkbootimg --kernel boot.img-kernel --ramdisk ramdisk-new.gz --base 0xffff8000 --pagesize 3270696 -o boot_new.img

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.

[HELP] 4.2.2 correct address

Hi!
What is the correct line to generate a kernel for 4.2.2?
mkbootimg --kernel zImage --ramdisk ramdisk.gz --base 0x80600000 --pagesize 2048 --ramdiskaddr 0x81С08100 --cmdline cmdline.txt -o boot-new_4_2_2.img - bootloop
mkbootimg --kernel zImage --ramdisk ramdisk.gz --base 0x80600000 --pagesize 2048 --ramdiskaddr 0x80C08100 --cmdline cmdline.txt -o boot-new_4_2_2.img - bootloop
or
mkbootimg --kernel zImage --ramdisk ramdisk.gz --base 0x80600000 --pagesize 2048 --ramdiskaddr 0x80C08000 --cmdline cmdline.txt -o boot-new_4_2_2.img
http://blog.djodjo.org/?p=536
This should help you see the offset address from the ramdisk. Or point you in the right direction.
Sent from my C525c using XDA Premium 4 mobile app

Categories

Resources