[Q] Android - splitting / modding ramdisk / repacking . flashing boot.img - General Questions and Answers

Android - splitting / modding ramdisk / repacking . flashing boot.img
changing ram disk in boot.img - (using ubuntu 11.10)
after several attempts to do this (after modding init.rc), I am at my wits ends...
here is a summary:
Page size: 2048 (0x00000800)
Kernel size: 3098256 (0x002f4690)
Ramdisk size: 250590 (0x0003d2de)
Second size: 0 (0x00000000)
still failed -
Board name:
Command line:
Base address: (0x10000000)
Writing oldboot.img-kernel ... complete.
Writing oldboot.img-ramdisk.gz ... complete.
./mkbootimg --kernel oldboot.img-kernel --ramdisk newramdisk.cpio.gz --base 0x10000000 --pagesize 2048 -o newboot.img
stuck in boot loop...
this is for Toshiba Thrive AT100-100

Related

unpacking and repacking boot.img from stock rom

Hi all,
Since it took me some time to figure out the correct values I guess this info can be useful to someone out there
1) the boot partition is mmcblk0p20 but it is signed. To get something meaningful out of it you need to drop the head of it
Code:
dd if=/dev/block/mmcblk0p20 of=boot.img bs=256 skip=1
2) to repack you need to pass the options
Code:
--pagesize 2048 --base 40400000
to mkbootimg

[Q] extracting ramdisk from boot.img keeps failing using unpacking tools (Pomp C6)

Hello
I'm trying to make a custom rom (for a Pomp C6) and need to adapt the bootclasspath.
Plenty of tutorials etc, so thats not the problem.
The problem i have is that none of the tools are able to correctly extract the ramdisk from my boot.img
I get errors like:
Code:
./unpack-bootimg.pl boot.img
Could not find any embedded ramdisk images. Are you sure this is a full boot image?
splitboot.pl apparently can extract at least something, but the resulting ramdisk image is not a gz
Code:
./split_bootimg.pl boot.img
Page size: 2048 (0x00000800)
Kernel size: 4376464 (0x0042c790)
Ramdisk size: 636685 (0x0009b70d)
Second size: 0 (0x00000000)
Board name: Release.V2.03
Command line:
Writing boot.img-kernel ... complete.
Writing boot.img-ramdisk.gz ... complete.
gzip -dc ../boot.img-ramdisk.gz | cpio -i
gzip: ../boot.img-ramdisk.gz: not in gzip format
cpio: premature end of archive
I already searched for a solution but cannot find any (All tutorials seem to have no problem extracting the ramdisk)
Am i overlooking something?

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

carliv image kitchen repack boot.img

Repack imageHello,
I trying to repack the boot.img with carliv_image_kitchen-linux64 (https://github.com/alexax66/carliv_image_kitchen)
And i got this error here:
Code:
Processing the boot folder.
Repacking the image....
The kernel is: ./boot.img-kernel
Getting the ramdisk compression....
Compression used:
Getting the image repacking arguments....
Base: 0x40078000
Pagesize: 2048
Command line: bootopt=64S3,32N2,64N2 buildvariant=user
Kernel offset: 0x00008000
Tags offset: 0x07808000
Device tree blob: ./boot.img-dt
Executing the repacking command....
Repack image utility by [email protected]
Check and add the kernel
Check and add the ramdisk
Error: could not load ramdisk ''
>> Exit script
Press any key to continue...
How can i Repack image ??? i have try root and no root.
Thanks for your time
Does this video help?

Problem unpack kernel pxa1908 (Android Image Kitchen)

Hello,
I own a samsung xcover 3 (sm-g388f, android lollitop) and out of curiosity I start to be interested in the android system. I downloaded the ROM and get back the file boot.img, i try to get the file Image.gz (kernel) with Android Image Kitchen.
Code:
./unpackimg.sh boot.img
I get:
Code:
Android Image Kitchen - UnpackImg Script
by osm0sis @ xda-developers
Supplied image: boot.img
Setting up work folders...
Image type: AOSP-PXA
Footer with "SEAndroid" type detected.
Splitting image to "split_img/"...
BOARD_KERNEL_CMDLINE
BOARD_KERNEL_BASE 0x10000000
BOARD_NAME
BOARD_PAGE_SIZE 2048
BOARD_KERNEL_OFFSET 0x00008000
BOARD_RAMDISK_OFFSET 0x01000000
BOARD_SECOND_OFFSET 0x00f00000
BOARD_TAGS_OFFSET 0x00000100
BOARD_DT_SIZE 475136
BOARD_UNKNOWN 0x03000000
Unpacking ramdisk (as root) to "ramdisk/"...
Compression used: gzip
4739 blocs
Done!
I get the file boot.img-kernel, i use dumpimage:
Code:
./dumpimage -i boot.img-kernel -p 0 Image.gz
The return is:
Code:
./dumpimage: invalid option -- 'i'
Usage: ./dumpimage -l image
-l ==> list image header information
./dumpimage [-T type] [-p position] [-o outfile] image
-T ==> declare image type as 'type'
-p ==> 'position' (starting at 0) of the component to extract from image
-o ==> extract component to file 'outfile'
./dumpimage -h ==> print usage information and exit
./dumpimage -V ==> print version information and exit
I try the command:
Code:
./dumpimage -T boot.img-kernel -p 0 Image.gz
i get:
Code:
./dumpimage: Invalid type
I no longer see what to do, here is the boot.img
If anyone has an idea I’m interested
Thanks

Categories

Resources