Can't repack boot image - Nexus 6P Q&A, Help & Troubleshooting

Hello,
I am trying to edit the boot.img (modified to not force encrypt the userdata) of my device.
I extracted the boot image with umkbootimage and then I extracted the initramfs with the following command:
Code:
gunzip -c ../initramfs.cpio.gz | cpio -i
Then i repacked the ramfs with the command (without changing nothing):
Code:
find . | cpio -o -H newc | gzip > ../new-ramdisk.cpio.gz
Finally, I repacked the boot image with mkbootimg and the following arguments:
Code:
mkbootimg --kernel zImage --ramdisk new-ramdisk.cpio.gz --base 0x0 --ramdisk_offset 0x002000000 --tags_offset 0x01e00000 --cmdline 'androidboot.hardware=angler androidboot.console=ttyHSL0 msm_rtb.filter=0x37 ehci-hcd.park=3 lpm_levels.sleep_disabled=1 boot_cpus=0-3' --pagesize 4096 -o new_boot.img
The new boot image won't boot up. When I use the original initramfs to create the boot image, everything works great.
Another issue is that after the repacking the size of the initramfs changed.
Someone have any idea what should I do?

@batman1010 you need that

Related

[Q] Compile from sources

OS Ubuntu 10.04 LTS x64
I downloaded photonic sources from schlund github place, ARM EABI Toolchain, get config from device(with schlund FW) and try to make, but have a error in makefile in "expr $(VERSION) \* 65536 + $(PATCHLEVEL) \* 256 + $(SUBLEVEL)); \". If i calculate version and write number to expr make done. I have zImage. Now i try to write new kernel to device. Get file boot.img from clockworkmod backup, "unpackbootimg -i boot.img", "mkbootimg --kernel zImage --ramdisk boot.img-ramdisk.gz --cmdline "no_console_suspend=1 console=null" --base 00200000 --pagesize 2048 -o ./tmp/boot.img" => have new boot.img. Through ADB push boot.img to sdcard then:
# cat /dev/zero > /dev/mtd/mtd2
write: No space left on device [this is ok, you can ignore]
# flash_image boot /sdcard/boot.img
Reboot device, but it write error in console(then i restore recovery and restore)
How to correctly build kernel and put it to the device?
Sorry for my bad english...
You not need bloksize argument for mkbootimg. And you have wrong argument for base (00200000 instead of 0x00200000)! Try:
- mkbootimg --kernel zImage --ramdisk boot.img-ramdisk.gz --cmdline 'no_console_suspend=1 console=null' --base 0x00200000 -o ./tmp/boot.img"
First, mount your sd card in recovery, then:
- adb push boot.img /sdcard/
than:
- adb shell erase_image boot
than:
- adb shell flash_image boot /sdcard/boot.img
It working also without mounting sdcard becouse boot.img is small and you are able to put it in memory, for example push it to /
- adb push boot.img /
- adb shell erase_image boot
- adb shell flash_image boot /boot.img
Can i "flash_image" In the booted android or just recovery?
will try to evening....
Just want to play with kernel...
YES!!!!!!!!!!!
It's work!!!!!!!!!!!!!!!!!!!!!!!!!
Thanx munjeni!!!!!!!!!!

Build own kernel and stuck on LG logo

Hi,
if i try to build my own kernel for d802, i have a little problem. it should be for cm-11.0 and i tried the stock cm-11.0 kernel to test it.
i use:
./dtbTool -s 2048 -o dt.img -p cm11/scripts/dtc/ cm11/arch/arm/boot/
to get my dt.img
and:
./mkbootimg --kernel cm11/arch/arm/boot/zImage --ramdisk ramdisk.gz --cmdline "console=ttyHSL0,115200,n8 androidboot.hardware=g2 user_debug=31 msm_rtb.filter=0x0" --base 0x00000000 --offset 0x05000000 --tags-addr 0x04800000 --pagesize 2048 --dt dt.img -o boot.img
to build the boot.img (ramdisk extracted from cm11).
i put it into a loki-fied .zip to install it and the installation works, but if i try to boot it stuck on lg logo. can anyone help me? is there a problem with my lines above?
AuxXxilium said:
Hi,
if i try to build my own kernel for d802, i have a little problem. it should be for cm-11.0 and i tried the stock cm-11.0 kernel to test it.
i use:
./dtbTool -s 2048 -o dt.img -p cm11/scripts/dtc/ cm11/arch/arm/boot/
to get my dt.img
and:
./mkbootimg --kernel cm11/arch/arm/boot/zImage --ramdisk ramdisk.gz --cmdline "console=ttyHSL0,115200,n8 androidboot.hardware=g2 user_debug=31 msm_rtb.filter=0x0" --base 0x00000000 --offset 0x05000000 --tags-addr 0x04800000 --pagesize 2048 --dt dt.img -o boot.img
to build the boot.img (ramdisk extracted from cm11).
i put it into a loki-fied .zip to install it and the installation works, but if i try to boot it stuck on lg logo. can anyone help me? is there a problem with my lines above?
Click to expand...
Click to collapse
hey .. that looks correct to me. what rom are you trying to boot your boot.img with? i know if u using the latest CM11 branch it adds alot of commits that require new blobs .. unless that rom has those new blobs it won't boot.
houstonn said:
hey .. that looks correct to me. what rom are you trying to boot your boot.img with? i know if u using the latest CM11 branch it adds alot of commits that require new blobs .. unless that rom has those new blobs it won't boot.
Click to expand...
Click to collapse
i tried on a your rom but it didn't boot. i'll try it on cm11 to confirm it. thx for your help.

[Q] SM-G900S repack tool

Any body has repack tool for galaxy s5(SM-G900S) kernel?
I do have unpack tool, but repack tool I have is not working.
When I use unmkbootimg made by kuisma below messages shown.
Code:
unmkbootimg version 1.2 - Mikael Q Kuisma <[email protected]>
Kernel size 8360752
Kernel address 0x8000
Ramdisk size 1764107
Ramdisk address 0x2000000
Secondary size 0
Secondary address 0xf00000
Kernel tags address 0x1e00000
Flash page size 2048
Board name is ""
Command line "console=null androidboot.hardware=qcom user_debug=31 msm_rtb.filter=0x37 ehci-hcd.park=3"
*** WARNING ****
This image is built using NON-standard mkbootimg!
OFF_KERNEL_ADDR is 0xFE208100
OFF_RAMDISK_ADDR is 0x00200100
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=null androidboot.hardware=qcom user_debug=31 msm_rtb.filter=0x37 ehci-hcd.park=3' -o new_boot.img
---------------
But I don't know where to get mkbootimg.c source mentioned in message.
I've tried to mkbootimg with --base 0x8000 --ramdiskaddr 0x2000000 and --base -x1dfff00 but both didn't work.
Anybody has a solutoin? Help me plz.
SMG900F repack problem
Hi
Any update with that issue. I experience similar problem.
Thanks

Mkbootimg Repacking - Proper command?

I have unpacked some boot.img files and wanted to repack them after editing the ramdisk. Does anyone know the proper command to repack for the LG G2?
I am currently using:
./bins/mkbootimg --kernel $kernel --ramdisk $ramdisk \
--cmdline "console=ttyHSL0,115200,n8 androidboot.hardware=g2 user_debug=31 msm_rtb.filter=0x0 mdss_mdp.panel=1:dsi:0:qcom,mdss_dsi_g2_lgd_cmd" \
--base 0x00000000 --pagesize 2048 --tags-addr 0x4800000 --offset 0x5000000 \
--dt ./bins/dt_g2.img --output new_boot.img
(From a script I modified)
It builds the correct addresses but the phone goes into a bootloop. Before I got the addresses right, I got fastboot. If tried the above command (which I modified). I've also tried using the command the unpack tool said to use. In addition, if tried the command in the script used to build the bootimg when omnirom is compiling. I've tried varying combos.
Yes, I am using the custom mkbootimg. I fished it out of the kernel objects directory after a successful recovery compile.
Thanks!

Packing Boot.img Zenfone 3 ZE520KL

I've success compiling with gcc aarch64 4.9 for my zen3 and after it i'm packing with mkbootimg with command
mkbootimg --kernel Image --ramdisk boot-img.ramdisk.gz --cmdline "console=ttyHSL0,115200,n8 androidboot.console=ttyHSL0 androidboot.hardware=qcom msm_rtb.filter=0x237 ehci-hcd.park=3 lpm_levels.sleep_disabled=1 androidboot.bootdevice=7824900.sdhci earlycon=msm_hsl_uart,0x78af000" --base 0x80000000 --pagesize 2048 --kernel_offset 0x00008000 --ramdisk_offset 0x01000000 --second_offset 0x00f00000 -o new.img , but i've problem when flashing, boot.img not work , device is booting, but bootlop . Whether i'm wrong something ? i'm customing kernel for adding mode monitor . Anyone know how to fix it ? Thanks

Categories

Resources