Hi !
I search to unpack and repack my HTC DESIRE Z Boot image :
Code:
[email protected]:/tmp/ROM# unpack-bootimg.pl boot.img
kernel written to boot.img-kernel.gz
ramdisk written to boot.img-ramdisk.cpio.gz
536 blocs
extracted ramdisk contents to directory boot.img-ramdisk/
[email protected]:/tmp/ROM# cd boot.img-ramdisk
[email protected]:/tmp/ROM/boot.img-ramdisk# vim default.prop
[email protected]:/tmp/ROM/boot.img-ramdisk# cd ..
[email protected]:/tmp/ROM# repack-bootimg.pl boot.img-kernel.gz boot.img-ramdisk/ test.img
536 blocs
repacked boot image written at boot.img-ramdisk/-repack.img
[email protected]:/tmp/ROM# fastboot boot test.img
downloading 'boot.img'... OKAY
booting... OKAY
[email protected]:/tmp/ROM#
it's still on HTC Logo.
If I boot the orginal boot.img, the phone boot normaly.
Why ?
Thanks.
Related
i can't boot with fastboot if i specify separate kernel and ramdisk image:
fastboot -c "no_console_suspend=1 console=null" boot boot.img-kernel boot.img-ramdisk.gz
but works well if i use all in one boot.img:
fastboot -c "no_console_suspend=1 console=null" boot boot.img
I'm trying to make insecure boot.img for U9200 for my firmware version (V100R001C185B104). Unpacking original boot.img and ramdisk goes OK. After making changes to defult.prop I do the following:
mkbootfs ./ramdisk | gzip > ramdisk-new.gz
mkbootimg --kernel boot.img-kernel --ramdisk ramdisk-new.gz --base 0x80000000 --cmdline "console=ttyGS2,115200n8 mem=1G vmalloc=768M omap_wdt.timer_margin=30 mmcparts=mmcblk015(splash)" --board omap4 -o tools/flash/boot.img
New boot.img is successfuly created but doesn't boot (fastboot boot boot.img). What am I doing wrong?
I've got parameters using bootimg.exe and I think they are OK. There's nothing about them on the net
EDIT:
I made it using other mkbootimg.exe. This one accept more input parameters. This time I use bootimg.exe for upacking bootimg and unpacking and packing ramdisk. I did:
>bootimg.exe --unpack-bootimg
>bootimg.exe --unpack-ramdisk
Do changes at default.prop.
>bootimg.exe --repack-ramdisk
>mkdir flash\
>mkbootimg --kernel kernel --ramdisk ramdisk.cpio.gz --cmdline "console=ttyGS2,115200n8 mem=1G vmalloc=768M omap_wdt.timer_margin=30 mmcparts=mmcblk015(splash)" --board omap4 --base 0x80000000 --pagesize 2048 -o flash\boot.img
Reboot to bootloader:
>adb reboot bootloader
Test if you have good drivers installed:
>fastboot devices
If OK, test your new boot.img without flashing it:
>fastboot boot boot.img
If device boots and you want to have this image permanant flash it with:
>fastboot flash boot.img.
I've attached the tools that worked for me. I'm coplete noob in Android cooking, this is my first steps. There are lot about editing boot.img on the internet but nothing about my device so I decided to start a new topic if someone is also interested in.
also cracking my U9500. Have you done with your problems?
i use bootimg.exe to unpack & repack the img file, using same parameters and nothing modified to the extracted files,
but,
the new & old boot.img(should be same) are not same using binary compare.
according to a file that describes how boot.img is structured, i found that some key parameters are different in these two img file.
I don't know why ....
so if you have succeeded, PLZ tell me ..
contact me qq 6777711 if you're Chinese. or mail me: 6777711 AT qq.com
Nice one. I'll take a look at this aswell.
The tool I use is KITCHEN for unpacking boot.img
Yesterday i encountered a problem while unpacking boot.img file
Code:
Press Enter to continue
Kernel found at offset 131072 in boot.img
Setting offset=131072 in mkbootimg.c, line 76
Setting offset=131072 in mkbootimg.c, line 109
Setting offset=131072 in extract-kernel.pl, line 23
Setting offset=131072 in extract-ramdisk.pl, line 23
Extracting kernel ...
Extracting ramdisk ...
Error: No ramdisk folder found!
Contents of bootimg_050313_133308:
total 3340
-rw-r--r-- 1 user None 3419532 May 3 13:33 zImage
Press Enter to continue
Got an error. Showing No ramdisk folder found. Is there any other way to unpack such boot.img??
Tried a lot searching on Google about this but didnt find any solution.
Someone who play with kernels everyday help me out please
Anyone??
Does anyone know about lzma compression? I guess such boot.img are compressed using lzma algorithm. How to unpack and re-pack such boot.img?
Plz someone help
Sent from my LT18i using xda app-developers app
Have you tried another method?
XperienceD said:
Have you tried another method?
Click to expand...
Click to collapse
Yep i did. Now able to unpack and re-pack lzma compressed boot.img files
For extracting boot.img-ramdisk.gz (LZMA compressed only) should type
Code:
lzma -dc ../boot.img-ramdisk.gz | cpio -i
All the Credit goes the original Dev.:good:
Reference used : http://forum.xda-developers.com/showthread.php?t=1659584&highlight=lzma
rohan170890 said:
Yep i did. Now able to unpack and re-pack lzma compressed boot.img files
For extracting boot.img-ramdisk.gz (LZMA compressed only) should type
Code:
lzma -dc ../boot.img-ramdisk.gz | cpio -i
All the Credit goes the original Dev.:good:
Reference used : http://forum.xda-developers.com/showthread.php?t=1659584&highlight=lzma
Click to expand...
Click to collapse
helo bro .. i am facing the same prblm like ramdisk folder not found while unpacking boot.img ... will u plzz help me to unpack it
here is the boot.img file http://www.mediafire.com/download/781fb7713efj719/boot.img
Hi,
I just tired to compile and repack the LL-Kernel for Z1c into a boot.img.
But I can't get it to start. I only see red LED blinken when I try to boot.
I used following sources:
http://developer.sonymobile.com/dow...rchives/open-source-archive-for-14-5-a-0-242/
And did it like it is mentioned in README_Xperia, which was all working fine and without errors.
Code:
### get defconfig
ARCH=arm CROSS_COMPILE=./arm-eabi-4.6/bin/arm-eabi- make rhine_amami_row_defconfig
### compile kernel
ARCH=arm CROSS_COMPILE=./arm-eabi-4.6/bin/arm-eabi- make
echo "checking for compiled kernel..."
if [ -f arch/arm/boot/zImage ]
then
echo "generating device tree..."
./dtbTool -o dt.img -s 2048 -p ./scripts/dtc/ ./arch/arm/boot/
echo "DONE"
fi
### D5503
./mkbootimg --cmdline "androidboot.hardware=qcom user_debug=31 msm_rtb.filter=0x3b7 ehci-hcd.park=3 androidboot.bootdevice=msm_sdcc.1 vmalloc=300M dwc3.maximum_speed=high dwc3_msm.prop_chg_detect=Y" --base 0x00000000 --kernel arch/arm/boot/zImage --ramdisk ramdisk.cpio.gz --ramdisk_offset 0x02000000 -o boot.img --dt dt.img --tags_offset 0x01E00000
The ramdisk.img I got from http://forum.xda-developers.com/son...5-0-242-generic-1279-6978-pre-rooted-t3083764
And I extracted the boot.elf with "Andrid Kitchen", which was working almost:
Code:
7-Zip [64] 9.20 Copyright (c) 1999-2010 Igor Pavlov 2010-11-18
p7zip Version 9.20 (locale=de_DE.UTF-8,Utf16=on,HugeFiles=on,4 CPUs)
Processing archive: kernel.elf
Extracting 0
Extracting 1
Extracting 2
Everything is Ok
Files: 3
Size: 11304622
Compressed: 11308906
mv: call of stat for »3“ not possible: File or Directory not found
mv: call of stat for »cmdline.txt“ not possible: File or Directory not found
After that there was a ramdisk.img in output folder which I used for mkbootimg.
After getting boot.img I tried to flash/load it via fastboot, which was not working. Can't figuere aout why.
Bootloader is unlocked.
Code:
fastboot boot boot.img
downloading 'boot.img'...
OKAY [ 0.349s]
booting...
FAILED (status read failed (No such device))
finished. total time: 5.437s
Code:
fastboot flash boot boot.img
sending 'boot' (11044 KB)...
OKAY [ 0.349s]
writing 'boot'...
FAILED (remote: Command not allowed)
finished. total time: 0.352s
And because of that I tried to flash it via TWRP/CWM/... with following updater-script:
Code:
show_progress(0,0);
ui_print(" flashing boot.img...");
package_extract_file("boot.img", "/dev/block/platform/msm_sdcc.1/by-name/boot");
ui_print(" finished");
show_progress(10.000000, 1);
So maybe anyone can point me to mistake I make?
EDIT:
Problem solved and Kernel is working. I must have relocked my bootloader in the past and couldn't remember it^^
So now I was able to flash the boot.img via fastboot.
SOLVED: I was using the G980F boot.img instead of G985F image. THANKS everyone
The device won't reboot if I unpack and repack the boot.img on S20
Did someone else here succeed in flashing a new boot.img ? THANKS
Code:
[email protected]:~/GS20_kernel_build$ unpackbootimg -i boot.img
BOARD_KERNEL_CMDLINE androidboot.hardware=exynos990
BOARD_KERNEL_BASE 10000000
BOARD_PAGE_SIZE 2048
[email protected]:~/GS20_kernel_build$ mkbootimg --kernel boot.img-zImage --ramdisk boot.img-ramdisk.gz -o boot_repacked.img
[email protected]:~/GS20_kernel_build$ heimdall flash --BOOT ./boot_repacked.img
[...]
Downloading device's PIT file...
PIT file download successful.
Uploading BOOT
100%
BOOT upload successful
Ending session...
Rebooting device...
modem__ said:
The device won't reboot if I unpack and repack the boot.img on S20
Did someone else here succeed in flashing a new boot.img ? THANKS
Code:
[email protected]:~/GS20_kernel_build$ unpackbootimg -i boot.img
BOARD_KERNEL_CMDLINE androidboot.hardware=exynos990
BOARD_KERNEL_BASE 10000000
BOARD_PAGE_SIZE 2048
[email protected]:~/GS20_kernel_build$ mkbootimg --kernel boot.img-zImage --ramdisk boot.img-ramdisk.gz -o boot_repacked.img
[email protected]:~/GS20_kernel_build$ heimdall flash --BOOT ./boot_repacked.img
[...]
Downloading device's PIT file...
PIT file download successful.
Uploading BOOT
100%
BOOT upload successful
Ending session...
Rebooting device...
Click to expand...
Click to collapse
You need to make a tar file containing the img and flash it with odin. You need a Windows computer for that. Linux won't do sadly
If you don't feel like making a flashable zip file you can just use dd to install it from within TWRP (via terminal on console or ADB) if you have that installed:
dd if=boot_repacked.img of=/dev/block/by-name/boot
No Windows/Odin required.
sjevtic said:
If you don't feel like making a flashable zip file you can just use dd to install it from within TWRP (via terminal on console or ADB) if you have that installed:
dd if=boot_repacked.img of=/dev/block/by-name/boot
No Windows/Odin required.
Click to expand...
Click to collapse
dd always scares me lol.
You sure this works with S20? Even Fastboot fllashing doesn't work so I doubt this will
JanBoyGamer23 said:
dd always scares me lol.
You sure this works with S20? Even Fastboot fllashing doesn't work so I doubt this will
Click to expand...
Click to collapse
My phone wouldn't boot last night after I tried flashing my own boot image and this was how I put the previous one back. It booted right up.