[Q] [RECOVERY] How to unpack P6200 official recovery.img - Samsung Galaxy Tab Plus

hi, I want build a costom recovery.img to boot ubuntu armhf.
I have to edit ramdisk image from recovery.img.
but i can not unpack recovery.img.
my recovery.img from P6200OZHLPM_P6200ZCLPM_HOME.tar
i use split_bootimg.pl
output:
[email protected]:~$ ./split_bootimg.pl recovery.img
Android Magic not found in recovery.img. Giving up.
i use unpack-bootimg.pl
[email protected]:~$ ./unpack-bootimg.pl recovery.img
Could not find any embedded ramdisk images. Are you sure this is a full boot image?
how to costom recovery.img like p6200-clockworkmod-6.0.1.9.img?
could you help me? thanks.

Related

[Q] command to flash kernel for Kindle Fire?

What's the command to flash a kernel for the Kindle Fire? I've tried several fastboot commands to flash the kernel or boot.img, but it always ends up being stuck in Fastboot Mode. The commands I've tried (IIRC):
Code:
fastboot -i 0x1949 boot boot.img
fastboot -i 0x1949 flash boot boot.img
fastboot -i 0x1949 boot zImage ramdisk.gz
fastboot -i 0x1949 boot zImage
These commands appear to indicate success (by displaying "OKAY"), but they leave the device stuck at Fastboot. I've even tried setting Normal mode and rebooting:
Code:
fastboot -i 0x1949 oem idme bootmode 4000
I also tried setting the base address, which apparently overwrote my recovery.img because I couldn't get into TWRP after that (had to reflash recovery.img):
Code:
fastboot -b 0x80000000 -i 0x1949 flash boot boot.img [COLOR="Red"][B](DON'T RUN THIS LINE)[/B][/COLOR]
The only workaround I have is to include the zImage inside the source tree of CM9, and rebuild CM9 in order to package the custom kernel inside update.zip. Then, I flash that from TWRP. This takes quite a while (about 15 mins) even with no changes to CM9 source. There must be a way to create a flash-able update.zip with only the kernel (and ramdisk), but I haven't discovered it. Even better would be a way to do this all from the command line, so I can script it instead of using TWRP. Any ideas? Thanks

[DEV][Tools] simg2img for Windows

Hello, although I'm working in Linux (VM too) I rewrote the SIMG2IMG so far for Windows (PE32, x86)
Usage: simg2img.exe -i <chunked Image file name> -o <outputname>
Optional: -d for debugging messages, listing all chunks of the image (.ext4.img) files to stdout (in case there are partial image files )
MD5: e5fc02b2f27756c1de270d31e29447e6 *simg2img.zip
cant unpack system.img (3.48GB) Samsung G928P . After Unpacking image size 164MB.
Error calling ftruncate() to set the image size
simg2img.exe -i system.img -o system.ext4
packed img filename: system.img
output img filename: system.ext4
Error calling ftruncate() to set the image size
Note: system.img is 1.9G.
Victor_Hsu said:
simg2img.exe -i system.img -o system.ext4
packed img filename: system.img
output img filename: system.ext4
Error calling ftruncate() to set the image size
Note: system.img is 1.9G.
Click to expand...
Click to collapse
I got the same problem when I ran this on system.img.ext4 from the Samsung Galaxy S5 Lollipop firmware. However, the output file still looked like it was the right size, and EXT2Read opened and extracted it without a problem.
MAXIMATOR said:
cant unpack system.img (3.48GB) Samsung G928P . After Unpacking image size 164MB.
Click to expand...
Click to collapse
same here output is only 104mb while system.img is 3.55 gb
Same problem here:
packed img filename: system.img
output img filename: system.img2
Error calling ftruncate() to set the image size
Output file was 2.8GB, input file 2.4GB wich looked OK, so I tried opening the output file with ext4_unpacker_exe wich failed, then I tried opening it with ext2explore-2.2.71 and it was able to open it !!!!
Thanks
your tool not working, Error calling ftruncate() to set the image size
https://github.com/KinglyWayne/simg2img_win
this work better
G:\vbox_share\simg2img>simg2img.exe -i userdata.img -o new-userdata.img
packed img filename: userdata.img
output img filename: new-userdata.img
Wrote "new-userdata.img"
The userdata.img only 21.4MB , but the new-userdata.img is 1.19 GB . Is right ?
I couldn't get this version to work, but I did find another version that did. I then created this thread with complete instructions: [GUIDE]How to extract /system from Samsung S7 OTA/FW in Windows without a Phone Hope it helps. Thanks!
kevin71246 said:
I couldn't get this version to work, but I did find another version that did. I then created this thread with complete instructions: [GUIDE]How to extract /system from Samsung S7 OTA/FW in Windows without a Phone Hope it helps. Thanks!
Click to expand...
Click to collapse
does anyone know why it would say bad magic?

new boot.img tools ( for boot.img with dtb )

hello
this thread for new boot.img (for boot.img with dtb)
you cant normally pack kernel with ramdisk only on newer devices with secure boot on
so you will need mkbootimg with dtb support
i found a source on git hub and compiled it
here it is btw
Direct link newbootimgtools.zip
usage:
Code:
unpackimg image.img
it will output folder named imagename-out
repack-editme
edit this file with your device config and copy edited file into the folder and runit
source:
https://github.com/osm0sis/mkbootimg

[Samsung 5.1.1] Why wont phone boot custom boot.img with a repacked ramdisk.cpio.gz

As the title states, why can't I boot a custom boot.img when I repack the ramdisk.cpio.gz. It freezes and doesn't boot past the logo, with the text "KERNEL is not SEANDROIDENFORCING". BUT I know that the phone can boot custom boot.img 's as I removed the word "SEANDORIDENFORCING" from the original boot.img via a hex editor and flashed it to my phone. My phone booted up all the way and did not freeze or get stuck, even when the red text (KERNEL IS NOT SEANDROID ENFORCING) was shown at the top of my phone
I belive it has to do with the unpacking/repacking of the ramdisk.cpio.gz file. When ever I try to boot an image with a repacked ramdisk the phone won't boot.
Usefull info:
I am not using any scripts to unpack the boot.img as none of them seem to be able to handle a boot.img designed for a armv8 (arm64 (64 bit)) CPU (As they try to extract the kernel as a zImage when it is Image.gz, thus ending prematurely and not working). Therefore I manually unpack the boot.img via a hex editor. I know I have extracted the files properly as it would throw an error anytime you would try to extract it if it wasn't properly copied from the boot.img.
The Commands Used:
Unpack:
Code:
mkdir ramdisk
cd ramdisk
gunzip -c ../ramdisk.cpio.gz | cpio -I
Then to pack it up:
Code:
find . |cpio -o -H newc | gzip > ../ramdisk-custom.cpio.gz
OR repacking it with root ownership
Code:
find . |cpio -o -H newc -R 0.0 | gzip > ../ramdisk-custom.cpio.gz
Little Phone Info: Samsung XCover 3 Lollipop 5.1.1, No Root, Flashing via Odin.
Am I correct in assuming that the repacked ramdisk is not letting the phone boot? Or is there something I am missing or doing wrong or is just plain obvious. Any Info would be great.
In relation to this thread: http://forum.xda-developers.com/android/development/4-4-4-5-1-1-6-0-1-samsung-xcover3-t3465132/page2

How to repack boot.img with modified kernel?

I downloaded the Xiaomi ROM, unzipped it, and extracted the boot.img with
abootimg -x boot.img
Then I recreated the boot.img with the modified kernel
abootimg --create boot.img -f bootimg.cfg -k $SCRIPT_DIR/devices/$DEVICE/kernel/k/arch/arm64/boot/Image -r initrd.img
and flashed it
fastboot flash boot boot.img
but then the phone boots right into fastboot mode.
I then reflashed the original boot.img from the ROM and it worked.
Then I thought I had compiled the kernel wrongly somehow, so I tried just unpacking the ORIGINAL boot.img from the ROM and repacking it, without changing the kernel:
abootimg -x boot.img
abootimg --create boot.img -f bootimg.cfg -k zImage -r initrd.img
but it boots right into fastboot mode again. So the problem is not in my kernel but in my repacking method for boot.img
How should I repack the boot.img?

Categories

Resources