LZMA compression tool - Android Q&A, Help & Troubleshooting

Hey , this is a small tool -you can call it patch - to compress kernel / recovery ramdisk .
Why this tool ?
Simply some devices have little space for kernel / recovery like samsung galaxy star which has about 10MBs for kernel/recovery .
How to use :
You must first activate LZMA support for ramdisks in kernel Go to your kernel config file then change this
Code:
# CONFIG_RD_LZMA is not set
TO
Code:
CONFIG_RD_LZMA=y
Clone the tool under device/vendor_name/device_name.
Add those line to your BoardConfig.mk file .
Code:
# LZMA compression for recovery's & kernel ramdisk....
BOARD_CUSTOM_BOOTIMG_MK := device/vendor_name/device_name/custombootimg.mk
BOARD_CANT_BUILD_RECOVERY_FROM_BOOT_PATCH := true
Enjoy .
Note :
This tools is used while you building any ROM/Kernel/Recovery from source .
This tool should work with any device .
LZMA compression takes more time to decompress than GZIP but When I tested it didn't take more than 1 or 2 more seconds to decompress .
You won't be able to decompress boot.img or recovery.img using boot-repacker or unpack tool for linux as you will get an error because those tools won't be able to decompress ramdisks for recovery or kernel -boot-repacker only gives you kernel zImage- and If you want to edit anything in ramdisk you will need to build it again from source !!!
This tool derived from
http://review.cyanogenmod.org/#/c/96227/
http://review.cyanogenmod.org/#/c/118533/​
Results using this tool :
Before :
Kernel ramdisk : 1.1 MB (1,117,760 bytes) .
recovery ramdisk : 4.2 MB (4,158,392 bytes) .
Total kernel.img : 9.1 MB (9,111,552 bytes) .
Total recovery.img : 12.2 MB (12,152,832 bytes) .
After :
Kernel ramdisk : 579.3 kB (579,257 bytes) .
recovery ramdisk : 2.7 MB (2,736,844 bytes) .
Total kernel.img : 8.6 MB (8,572,928 bytes) .
Total recovery.img : 10.7 MB (10,731,520 bytes) .
Something to discuss :
Maybe you find that these compress is not enough to save up the space or you maybe find this is very suitable for you , In my case it was useful in some aspects and not in others .
I tried to use LZMA compression for kernel zImage it self and it was pretty good (8 MBs to 2.9 MBs) but the problem that the kernel wasn't loaded so It themes that the bootloader of my device hate LZMA compression or anything else I didn't figure it out so If you find anyway to run and support LZMA compression for kernel please kindly let me know .
Download :
LZMA compression tool
Credit :
Andreas Blaesius
Dan Pasanen
LehKeda (ME )

Neat idea. How do I implement this into a ROM? I see boot.img and recovery.img tutorials but nothing for ROM.

RatchetPanda said:
Neat idea. How do I implement this into a ROM? I see boot.img and recovery.img tutorials but nothing for ROM.
Click to expand...
Click to collapse
You mean compress system.img with LZMA ? if yes , no you can't .

LahKeda said:
You mean compress system.img with LZMA ? if yes , no you can't .
Click to expand...
Click to collapse
Do you think you could modify TWRP so it could handle zips zipped using LZMA instead of just plain deflate? It'd be very useful to get 300-500mb zips down to 200-350mb

RatchetPanda said:
Do you think you could modify TWRP so it could handle zips zipped using LZMA instead of just plain deflate? It'd be very useful to get 300-500mb zips down to 200-350mb
Click to expand...
Click to collapse
It won't reduce the actual size of the ROM it will reduce the zip file size -you will have to download/upload 200 to 300 mb instead of 300 to 500 mb- so it isn't useful that much as you can compress rom zip file before uploading then decompress it again after downloading .
BTW ... Is it good to replace device default bootloader with another one ? and Is there any way to backup it ?

LahKeda said:
It won't reduce the actual size of the ROM it will reduce the zip file size -you will have to download/upload 200 to 300 mb instead of 300 to 500 mb- so it isn't useful that much as you can compress rom zip file before uploading then decompress it again after downloading .
BTW ... Is it good to replace device default bootloader with another one ? and Is there any way to backup it ?
Click to expand...
Click to collapse
Yes that's what I mean is reducing the zip file size, I don't care about the size of the ROM. You probably can on Nexus devices since they are developer friendly however I do not know about other devices.

RatchetPanda said:
Yes that's what I mean is reducing the zip file size, I don't care about the size of the ROM. You probably can on Nexus devices since they are developer friendly however I do not know about other devices.
Click to expand...
Click to collapse
Messing with recovery mechanism doesn't theme so much fair while you can do it by any other file compressor

LahKeda said:
Messing with recovery mechanism doesn't theme so much fair while you can do it by any other file compressor
Click to expand...
Click to collapse
What I'm saying is TWRP cannot currently handle flashable zips using anything other than plain Deflate so it would need modifying to support zips zipped using LZMA2 or Deflate64 for example.

RatchetPanda said:
What I'm saying is TWRP cannot currently handle flashable zips using anything other than plain Deflate so it would need modifying to support zips zipped using LZMA2 or Deflate64 for example.
Click to expand...
Click to collapse
that's theme a little bit interesting .....maybe I'll look into it .

Related

[DEV] Custom MTD Partitions for the N1

With the advent of Blackrose custom HBOOT which gives us S-OFF, we can now resize the MTD partitions of our N1. This method is the one used by lbcoder in the Desire thread where you patch the recovery and boot in order to pass modified MTD partition information which supersedes the one provided by the SPL. Using this, I've managed to increase my userdata partition by ~50 MB by taking ~50 MB from the cache partition.
These instructions are for advanced users only. This will involve hex calculations and command line instructions that are not for the faint of heart. I don't believe it's dangerous though so anyone could still try since I will try to make these instructions as detailed as I possibly can.
What you need:
N1 with Blackrose HBOOT (I'm not sure this is needed though after I read more in-depth about the patch)
hex calculator (or a pencil & paper if you want to do it manually)
adb
fastboot
unpack-bootimg.pl
mkbootimg
recovery.img <- in my case I used ClockWorkMod 5.0.2 from here
boot.img <- taken from CM zip (in my case my KANG)
Partition Layout:
0x000003ee0000-0x000003fc0000 : "misc"
0x000004240000-0x000004640000 : "recovery"
0x000004640000-0x0000049c0000 : "boot"
0x0000049c0000-0x00000dac0000 : "system"
0x00000dac0000-0x0000139c0000 : "cache"
0x0000139c0000-0x00001fe00000 : "userdata"
Partition Sizes in Hex:
0x0000000e0000 : "misc"
0x000000400000 : "recovery"
0x000000380000 : "boot"
0x000009100000 : "system"
0x000005f00000 : "cache"
0x00000c440000 : "userdata"
Step-by-step Instructions:
A>Backup your current system: (OPTIONAL)
*I'm assuming you're using CWM 5.0.2 for the backup step since I tried using 3.X and the restore didn't work
1.) Boot your N1 into recovery using either adb reboot recovery or through the bootloader
2.) Backup your current system (I'm going to assume you know how to use your recovery for this)
B>Calculate new MTD parameter values:
*For this example I'm going to transfer ~50MB of cache space to my userdata partition:
1.) Since I know the cache partition is ~100MB in size, I'll just divide the hex size in 2:
0x5f00000 / 2 = 0x2f80000 <= this will be our new cache size
**Note that there is a minimum of 0x20000 (128k) for a partition and the size must be divisible by it which is why I'm playing safe and just dividing the original number in order to get an easier value for this example.
2.) Add the new cache partition size to the original cache partition starting address to get the new starting address of the userdata partition:
0xdac0000 + 0x2f80000 = 0x10a40000 <= this will be the new starting address for userdata
3.) Get the new userdata size by subtracting the new starting address of userdata with the ending address:
0x1fe00000 - 0x10a40000 = 0xf3c0000 <= this will be the new userdata size
C>Create a new recovery.img file which uses the new values:
1.) Breakdown the recovery.img file into it's kernel and ramdisk components using unpack-bootimg.pl:
.\unpack-bootimg.pl recovery.img
*This will yield 2 files and 1 directory. You can delete the directory since we only need the files.
2.) Rename the kernel from the recovery.img-kernel.gz made from unpack-bootimg.pl to recovery.img-kernel.
3.) Create the recovery-new.img file using mkbootimg with the new MTD command embedded:
mkbootimg --cmdline 'no_console_suspend=1 console=null mtdparts=msm_nand:[email protected](misc),[email protected](recovery),[email protected](boot),[email protected](system),[email protected](cache),[email protected](userdata)' --kernel recovery.img-kernel --ramdisk recovery.img-ramdisk.cpio.gz -o recovery-new.img --base 0x20000000
*Note that the values for cache starting address, userdata starting address and userdata size have been changed to the newly calculated values in the previous step.
**This will yield recovery-new.img which will be used in the next steps.
D>Create a new boot.img file which uses the new values:
1.) Breakdown the boot.img file into it's kernel and ramdisk components using unpack-bootimg.pl:
.\unpack-bootimg.pl boot.img
*This will yield 2 files and 1 directory. You can delete the directory since we only need the files.
2.) Rename the kernel from the boot.img-kernel.gz made from unpack-bootimg.pl to boot.img-kernel.
3.) Create the boot-new.img file using mkbootimg with the new MTD command embedded:
mkbootimg --cmdline 'no_console_suspend=1 wire.search_count=5 mtdparts=msm_nand:[email protected](misc),[email protected](recovery),[email protected](boot),[email protected](system),[email protected](cache),[email protected](userdata)' --kernel boot.img-kernel --ramdisk boot.img-ramdisk.cpio.gz -o boot-new.img --base 0x20000000
*Note that the values for cache starting address, userdata starting address and userdata size have been changed to the newly calculated values in the previous step.
**This will yield boot-new.img which will be used in the next steps.
E>Flash the recovery-new.img:
1.) Boot into bootloader and use fastboot command to flash the new recovery:
fastboot flash recovery recovery-new.img
F>Make system operational:
1.) Boot into recovery mode.
2.) Erase everything (factory reset)
3.) Either:
- Flash the ROM you took the original boot.img from OR
- Restore the backup you made previously (this only works (or has been tested) on CWM 5.0.2)
4.) DO NOT REBOOT YET!!!
G>Flash modified boot.img:
1.) Use adb to reboot to bootloader directly from recovery: (this is for safety since if you boot from an unmodified boot.img you'll have to start from F again.
adb reboot bootloader
2.) Use fastboot to flash the new boot image:
fastboot flash boot boot-new.img
3.) You may restart normally.
For those who've read this far, everything above has been rendered obsolete! Here's an editor for the SPL itself for the partition sizes:
http://intersectraven.euroskank.com/tools/SPLHexEditor.exe
*Instructions are in dla5244's thread 2nd post.
Try it at your own risk though!
Credits:
dla5244 - for bringing S-OFF to our N1 even after a looong time since its release
Firerat - for the original patch idea
Lbcoder - for coming up with the idea in the Desire thread
Reserved!
(I'm learning to reserve now... )
2 Questions:
Is the userdata space where downloaded apps go?
why didn't you choose any other partition to transfer empty space from?
drzplaya1121 said:
2 Questions:
Is the userdata space where downloaded apps go?
why didn't you choose any other partition to transfer empty space from?
Click to expand...
Click to collapse
1.) Yes.
2.) This is a sample. If you want to transfer from system or to system from cache, this example will show you how to do so.
thank U. Now I have no need to buy a new phone because of constantly running out of memory
Does it mean that every time I flash a new kernel, the whole effort will go waste?
Also, can I use the same procedure for Amon RA recovery??
rjmohit said:
Does it mean that every time I flash a new rom (which obviously has a different boot.img), the whole effort will go waste?
Also, can I use the same procedure for Amon RA recovery??
Click to expand...
Click to collapse
For that you need to do only steps D, F and G. If you flash only a kernel which uses koush's anykernel updater, you don't need to do anything.
intersectRaven said:
For that you need to do only steps D, F and G. If you flash only a kernel which uses koush's anykernel updater, you don't need to do anything.
Click to expand...
Click to collapse
Thanks.
One more silly question
Will the following procedure work.
1. Flash any ROM.
2. Then flash the modified boot.img (which may not belong to that ROM).
3. Then optionally flash the desired kernel.
rjmohit said:
Thanks.
One more silly question
Will the following procedure work.
1. Flash any ROM.
2. Then flash the modified boot.img (which may not belong to that ROM).
3. Then optionally flash the desired kernel.
Click to expand...
Click to collapse
Yeah. That would work since you're replacing the kernel anyways. What's important is that the kernel is compatible with the ROM.
Well done IR cannot wait to resize my data partition..
Okay, I extracted the recovery.img file, now when I try to extract recovery.img-kernel.gz, it gives the following error: not in gzip format. Exactly same happens for boot.img. I tried extracting it with different extractors on windows and ubuntu, nothing worked. Pls help.
I don't like using MTD because over time you will notice lag. If your already using sd-ext then your data is basically not being used. And I believe that cache never gets past 50% usage. Just putting in my two cents
rjmohit said:
Okay, I extracted the recovery.img file, now when I try to extract recovery.img-kernel.gz, it gives the following error: not in gzip format. Exactly same happens for boot.img. I tried extracting it with different extractors on windows and ubuntu, nothing worked. Pls help.
Click to expand...
Click to collapse
That's odd. In my installation, it worked flawlessly. Were there no errors during the run of unpack?
blahbl4hblah said:
I don't like using MTD because over time you will notice lag. If your already using sd-ext then your data is basically not being used. And I believe that cache never gets past 50% usage. Just putting in my two cents
Click to expand...
Click to collapse
intersectRaven said:
That's odd. In my installation, it worked flawlessly. Were there no errors during the run of unpack?
Click to expand...
Click to collapse
Nope. No errors. :-/
rjmohit said:
Nope. No errors. :-/
Click to expand...
Click to collapse
Found the problem. It seems it was never compressed in the first place. Ark sees this and just copies the file without the .gz extension.
*Instructions edited accordingly.
I may sound a bit noobish, but I'm facing one more hindrance:
How exactly do I run the mkbootimg file in the ubuntu terminal? I mean, can you give me the exact syntax?
I was facing a similar problem with the perl script, but then I found a solution on google, but didnt find anything for the mkbootimg. Can I run it under windows cmd?
rjmohit said:
I may sound a bit noobish, but I'm facing one more hindrance:
How exactly do I run the mkbootimg file in the ubuntu terminal? I mean, can you give me the exact syntax?
I was facing a similar problem with the perl script, but then I found a solution on google, but didnt find anything for the mkbootimg. Can I run it under windows cmd?
Click to expand...
Click to collapse
I already posted the syntax in the instructions. You just need to make sure the mkbootimg file has execute permissions in order for it to run.
Updated OP with SPL editor program.
intersectRaven said:
Updated OP with SPL editor program.
Click to expand...
Click to collapse
I tried your program. Everything worked fine. Just that my /cache now shows 290 MB free, while I had resized it to 20 MB!! Is that a bug? /system & /data show proper sizes though. thanks.
rjmohit said:
I tried your program. Everything worked fine. Just that my /cache now shows 290 MB free, while I had resized it to 20 MB!! Is that a bug? /system & /data show proper sizes though. thanks.
Click to expand...
Click to collapse
Is it the display on the program or display on the Android device when booted?
Wait, I found it. It's a bug. Thanks! I'll edit it when I get home. For now, please double check the values by reopening the made file before flashing. If the values are incorrect, please DON'T FLASH!!!

boot.img unpacking question.

I can't seem to get the boot.img file to unpack, regardless of what tool I use or what os. I typically get the results below. the long term goal is to edit the boot.img to allow the next7p to use ext3 /system as opposed to cramfs, and give full read/write. It has been done by Wendal Chen on a different but similar tablet. (Both are rk29xx tablets.)
Any help would be appreciated.
I have been able to create a "custom" rom, which has root and SU, but you cannot write to the /system.
the boot.img from my custom rom is 598k The boot.img pulled from the tablet
is 4096K i get the same issues from both.
Code:
Welcome to the ZTE Racer kitchen by TigTex!
If you aren't using Windows XP, you might need to run this as admin
Make sure you have boot.img on the same folder as this file
Press 1 to decompress the ramdisk and kernel from boot.img
Press 2 to build the boot.img from the ramdisk folder and boot.img-kerne
Press q to exit
Type 1,2 or q and press ENTER: 1
Android Magic not found in boot.img. Giving up.
******kernel and ramdisk extracted!******
* Kernel is the "boot.img-kernel" file *
* Ramdisk is on gzip + cpio *
* YOU CAN ONLY EDIT RAMDISK ON LINUX *
* original img backed up as oldboot.img *
*****************************************
Press 1 to decompress the ramdisk and kernel from boot.img
Press 2 to build the boot.img from the ramdisk folder and boot.img-kerne
Press q to exit
Type 1,2 or q and press ENTER:
Ok so let's try the android kitchen
Here is the show boot.img information
Code:
Working folder's boot.img information
-------------------------------------
Kernel Size : 559903 bytes
Kernel Base Address : 0x00000000
Ramdisk Size : 2090599168 bytes
Ramdisk Load Address : 0x65545c0b
Second Stage Size : 779876570 bytes
Second Stage Load Address : 0xe1906573
Page Size : 84348953 bytes
ASCIIZ Product Name : (None)
Command Line: (None)
Press Enter to continue
And now the attempt to extract first using w option...
Code:
Working folder found
Android header not found at start of boot.img
Warning: Android header not located anywhere in boot.img
Kernel found at offset 84348953 in boot.img
Making folder BOOT-EXTRACTED ...
Extracting kernel ...
Extracting ramdisk ...
Error: No ramdisk folder found!
Press Enter to continue
Ok so lets try the other option in the menu.
Code:
Press Enter to continue
Android header not found at start of boot.img
Warning: Android header not located anywhere in boot.img
Kernel found at offset 84348953 in boot.img
Extracting kernel ...
Extracting ramdisk ...
Error: No ramdisk folder found!
Contents of bootimg_010612_234100:
total 0
-rw-r--r-- 1 0 2012-01-06 23:41 zImage
Press Enter to continue
The zImage file it writes is 0k in size.
Here is the first line from the boot.img looking at it in the hexeditor.
Code:
00000000 4b 52 4e 4c 3a 93 08 00 1f 8b 08 00 00 00 00 00 KRNL:"...<......
From what I have read the kernel is supposedly starting at 1f 8b.....
getting the error that the Ramdisk is not there, it is almost like it is not a complete boot.img file. More so if I look at boot.img in a hexeditor and lookup that address. (Sigh) I keep plugging away.
any help is appreciated.
Dochoppy said:
I can't seem to get the boot.img file to unpack, regardless of what tool I use or what os. I typically get the results below. the long term goal is to edit the boot.img to allow the next7p to use ext3 /system as opposed to cramfs, and give full read/write. It has been done by Wendal Chen on a different but similar tablet. (Both are rk29xx tablets.)
Any help would be appreciated.
I have been able to create a "custom" rom, which has root and SU, but you cannot write to the /system.
the boot.img from my custom rom is 598k The boot.img pulled from the tablet
is 4096K i get the same issues from both.
Code:
Welcome to the ZTE Racer kitchen by TigTex!
If you aren't using Windows XP, you might need to run this as admin
Make sure you have boot.img on the same folder as this file
Press 1 to decompress the ramdisk and kernel from boot.img
Press 2 to build the boot.img from the ramdisk folder and boot.img-kerne
Press q to exit
Type 1,2 or q and press ENTER: 1
Android Magic not found in boot.img. Giving up.
******kernel and ramdisk extracted!******
* Kernel is the "boot.img-kernel" file *
* Ramdisk is on gzip + cpio *
* YOU CAN ONLY EDIT RAMDISK ON LINUX *
* original img backed up as oldboot.img *
*****************************************
Press 1 to decompress the ramdisk and kernel from boot.img
Press 2 to build the boot.img from the ramdisk folder and boot.img-kerne
Press q to exit
Type 1,2 or q and press ENTER:
Ok so let's try the android kitchen
Here is the show boot.img information
Code:
Working folder's boot.img information
-------------------------------------
Kernel Size : 559903 bytes
Kernel Base Address : 0x00000000
Ramdisk Size : 2090599168 bytes
Ramdisk Load Address : 0x65545c0b
Second Stage Size : 779876570 bytes
Second Stage Load Address : 0xe1906573
Page Size : 84348953 bytes
ASCIIZ Product Name : (None)
Command Line: (None)
Press Enter to continue
And now the attempt to extract first using w option...
Code:
Working folder found
Android header not found at start of boot.img
Warning: Android header not located anywhere in boot.img
Kernel found at offset 84348953 in boot.img
Making folder BOOT-EXTRACTED ...
Extracting kernel ...
Extracting ramdisk ...
Error: No ramdisk folder found!
Press Enter to continue
Ok so lets try the other option in the menu.
Code:
Press Enter to continue
Android header not found at start of boot.img
Warning: Android header not located anywhere in boot.img
Kernel found at offset 84348953 in boot.img
Extracting kernel ...
Extracting ramdisk ...
Error: No ramdisk folder found!
Contents of bootimg_010612_234100:
total 0
-rw-r--r-- 1 0 2012-01-06 23:41 zImage
Press Enter to continue
The zImage file it writes is 0k in size.
Here is the first line from the boot.img looking at it in the hexeditor.
Code:
00000000 4b 52 4e 4c 3a 93 08 00 1f 8b 08 00 00 00 00 00 KRNL:"...<......
From what I have read the kernel is supposedly starting at 1f 8b.....
getting the error that the Ramdisk is not there, it is almost like it is not a complete boot.img file. More so if I look at boot.img in a hexeditor and lookup that address. (Sigh) I keep plugging away.
any help is appreciated.
Click to expand...
Click to collapse
Dsixda's kitchen has this feature, (un/re-pack) boot.img built in. Makes for very easy editing. Also helps for making your ROM.
Sent from my PC36100 using xda premium
jamieg71 said:
Dsixda's kitchen has this feature, (un/re-pack) boot.img built in. Makes for very easy editing. Also helps for making your ROM.
Sent from my PC36100 using xda premium
Click to expand...
Click to collapse
That's what he said he used, but the kitchen does not support boot.img of his device's format. A lot of the cheaper tablets use a special format but I have seen Wiki guides on how they are built and extracted.
Any chance you know a link to one of the guides? I will also start searching on like tablets.
Dochoppy said:
Any chance you know a link to one of the guides? I will also start searching on like tablets.
Click to expand...
Click to collapse
Google for the "cmp738a" by Craig. It's a really ****ty tablet that I owned for one day. It uses cramfs like yours, and there are some links on how to unpack and create a ROM. Use terms like "cmp738a unpack ROM"
Dsixda: First thanks for your kitchen tool really it is a great piece of work, I am sure you are under appreciated for it.
After you told me to do some searches I did, then I looked back over everything I had been reading.
I can say I feel like an idiot. I was letting the big picture blot out the details so to speak.
Almost literally all I had to do was remove 3-4 bytes from the header, and ungzip the file...cpio etc etc.
I was stuck in the train of thought that I had to "unpack the boot.img" file first, then ungzip it...
Dochoppy said:
Dsixda: First thanks for your kitchen tool really it is a great piece of work, I am sure you are under appreciated for it.
After you told me to do some searches I did, then I looked back over everything I had been reading.
I can say I feel like an idiot. I was letting the big picture blot out the details so to speak.
Almost literally all I had to do was remove 3-4 bytes from the header, and ungzip the file...cpio etc etc.
I was stuck in the train of thought that I had to "unpack the boot.img" file first, then ungzip it...
Click to expand...
Click to collapse
You mean it's like any other boot.img except for the extra bytes at the beginning and a different header (instead of "ANDROID!" - the actual header the kitchen looks for)?
Well yes and no. The kitchen still does not extract the boot.img correctly, zImage is created as a 0k file, and the ramdisk is still not extracted.
Ok I am still missing something here.
Ok I am still missing something here.
dsixda-
Could you take a look at the boot.img file and tell me what I may be missing?
http://www.mediafire.com/?n9an9o5vmjida1c
I would appreciate it very much.
Dochoppy said:
Ok I am still missing something here.
dsixda-
Could you take a look at the boot.img file and tell me what I may be missing?
http://www.mediafire.com/?n9an9o5vmjida1c
I would appreciate it very much.
Click to expand...
Click to collapse
It's not going to work in the kitchen, what are you trying to do? It is missing the "ANDROID!" magic header and the rest of the file is in a garbled format. You'll need to Google for the solution for your device. I can't offer much help, sorry.
I understand that much. When you do a file boot.img command in linux it just comes back as DATA.
I'm not so much concerned with being able to use the kitchen on it as just being able to unpack and pack the file correctly, and completely.
Thanks for taking a peak at it.
Can you upload to dropbox and let me know. I was working on an experimental tool to do this, so an unknown device would be good to check.. I might be some time in getting back to you though
Sent from my HTC Desire using Tapatalk
Droidzone-
Drop box link
http://dl.dropbox.com/u/56600275/boot.img
Media fire link if that doesn't work.
http://www.mediafire.com/?n9an9o5vmjida1c
Thanks for taking a peak.
Could you also provide the full name of the tablet, manufacturer, and possibly a link to the device?
The tablet in question is the nextbook 7 premium
marketed in the US by E-fun. Website is www.nextbookusa.com
on the front of the page there is a link to the latest firmware which the current version of DocHoppy Rom is based on.
Thanks again for taking a peak at it.
I know this much, the boot.img file it's self once unpacked from the update.img file
is a gziped cpio file, with odd header and footer bits. I have been able to unpack the file (removing header info to make it gzip recognizable), and then using 7zip of all things to unpack the cpio portion. That is where I get hung up at. I need to unpack it correctly so it can be rebuilt correctly. By doing it the way I have, you can't rebuild the file properly.
Update:
After alot of research, and trial and error, I was able to correctly unpack and repack the boot.img. I flashed the repack to my tablet, and successfully booted.
Next step is to modify init.rc and convert /system to ext3.
I will keep you posted.
Do document what you did so that it helps someone else later
Sent from my HTC Desire using Tapatalk
I'm having a similar problem, posted about here. I don't understand why the Android magic number isn't making it into my kernel. I thought the kernel compile would be straightforward, but sheesh...
Dochoppy said:
Update:
After alot of research, and trial and error, I was able to correctly unpack and repack the boot.img. I flashed the repack to my tablet, and successfully booted.
Next step is to modify init.rc and convert /system to ext3.
I will keep you posted.
Click to expand...
Click to collapse
Hi, i am trying to extract a boot.img without the Android header too. What have you done to extract it?
Regards.

[Q&A] [TOOL][UTILITY] Carliv Image Kitchen for Android - unpack/repack boot-recovery

[Q&A] [TOOL][UTILITY] Carliv Image Kitchen for Android - unpack/repack boot-recovery
Q&A for [TOOL][UTILITY] Carliv Image Kitchen for Android - unpack/repack boot-recovery
Some developers prefer that questions remain separate from their main development thread to help keep things organized. Placing your question within this thread will increase its chances of being answered by a member of the community or by the developer.
Before posting, please use the forum search and read through the discussion thread for [TOOL][UTILITY] Carliv Image Kitchen for Android - unpack/repack boot-recovery. If you can't find an answer, post it here, being sure to give as much information as possible (firmware version, steps to reproduce, logcat if available) so that you can get help.
Thanks for understanding and for helping to keep XDA neat and tidy!
This looks like a really great tool but I'm having troubles with it.
gzip: ../boot.img-ramdisk.gz: not in gzip format
cpio: premature end of archive
Your ramdisk archive is corrupt. Are you trying to unpack a MTK image with regular script?
If so, please use unpack_MTK_img script. ERROR!
>> Exit script
when I use MTK it says
Unpacking the ramdisk....
gzip: ../boot.img-ramdisk.gz: not in gzip format
cpio: premature end of archive
Your ramdisk archive is corrupt. Are you trying to unpack a regular image with MTK script?
If so, please use unpack_img script. ERROR!
>> Exit script
this is for the LG Optimus F3 Boot.img from Team Win 2.8.0.0
is there any way to extract this puppy?
Code:
Printing information for "boot.img"
Android image info utility by [email protected]
Header:
Magic : ANDROID!
Magic offset : 0x00000000
Page_size : 2048 (0x00000800)
Base address : 0x80200000
Kernel address : 0x80208000
Kernel size : 7602936 (0x007402f8)
Kernel offset : 0x00008000
Ramdisk address : 0x88f108f0
Ramdisk size : 2048 (0x00000800)
Ramdisk offset : 0x08d108f0
Second address : 0x81100000
Tags address : 0x80200100
Tags offset : 0x00000100
Cmdline : 'androidboot.hardware=fx3s user_debug=31 vmalloc=308M'
Id : 46c3c0e3d52bc3f86497ddd8f07eae74643c5f0e
Successfully printed all informations for boot.img
HappyRoms said:
This looks like a really great tool but I'm having troubles with it.
gzip: ../boot.img-ramdisk.gz: not in gzip format
cpio: premature end of archive
Your ramdisk archive is corrupt. Are you trying to unpack a MTK image with regular script?
If so, please use unpack_MTK_img script. ERROR!
>> Exit script
when I use MTK it says
Unpacking the ramdisk....
gzip: ../boot.img-ramdisk.gz: not in gzip format
cpio: premature end of archive
Your ramdisk archive is corrupt. Are you trying to unpack a regular image with MTK script?
If so, please use unpack_img script. ERROR!
>> Exit script
this is for the LG Optimus F3 Boot.img from Team Win 2.8.0.0
is there any way to extract this puppy?
Code:
Printing information for "boot.img"
Android image info utility by [email protected]
Header:
Magic : ANDROID!
Magic offset : 0x00000000
Page_size : 2048 (0x00000800)
Base address : 0x80200000
Kernel address : 0x80208000
Kernel size : 7602936 (0x007402f8)
Kernel offset : 0x00008000
Ramdisk address : 0x88f108f0
Ramdisk size : 2048 (0x00000800)
Ramdisk offset : 0x08d108f0
Second address : 0x81100000
Tags address : 0x80200100
Tags offset : 0x00000100
Cmdline : 'androidboot.hardware=fx3s user_debug=31 vmalloc=308M'
Id : 46c3c0e3d52bc3f86497ddd8f07eae74643c5f0e
Successfully printed all informations for boot.img
Click to expand...
Click to collapse
Can you attach that image here, to take a look? It sounds like there is no ramdisk in it. There are some phones that doesn't have ramdisks in boot images.
carliv said:
Can you attach that image here, to take a look? It sounds like there is no ramdisk in it. There are some phones that doesn't have ramdisks in boot images.
Click to expand...
Click to collapse
Sure thing, just remove .zip from the file name, had to do that as it only allows 8Mb img uploads
I'm trying to edit the boot so that I might be able to make the external SD into the data drive, is this even possible or am I wasting my time?
Thanks!
HappyRoms said:
Sure thing, just remove .zip from the file name, had to do that as it only allows 8Mb img uploads
I'm trying to edit the boot so that I might be able to make the external SD into the data drive, is this even possible or am I wasting my time?
Thanks!
Click to expand...
Click to collapse
Ok, I see... Your image is "lokified". In order to use my tool you need to "de-lokify" it first, then after modding you need to "re-lokify" it back. Some infos here and here. It may be many other infos but I didn't have time to do a full search; you have to do it for yourself.
Some LG and Samsung devices have that "Loki" thing and you need to deal with it. Maybe when I'll have a phone like that I'll make an automated process for it, but now I haven't and I can't work "in blind".
I don't know what to say about your last question... I'm not even sure what you're talking about.
carliv said:
Ok, I see... Your image is "lokified". In order to use my tool you need to "de-lokify" it first, then after modding you need to "re-lokify" it back. Some infos here and here. It may be many other infos but I didn't have time to do a full search; you have to do it for yourself.
Some LG and Samsung devices have that "Loki" thing and you need to deal with it. Maybe when I'll have a phone like that I'll make an automated process for it, but now I haven't and I can't work "in blind".
I don't know what to say about your last question... I'm not even sure what you're talking about.
Click to expand...
Click to collapse
Awesome, thanks!
basically, the LG Optimus F3 comes with too little memory built in, there's a program that mounts an external SD's second partition as a data folder, but even still it runs out of internal memory or won't install apps larger than the internal memory because the "System" partition still has little room.
so the goal was to edit the boot so it will boot using an external SD directly as the system drive, it would read it's maximum memory available as whatever the external SD's maximum is.
this would solve the problem, if it works, if not then it'll probably just brick the phone :good:
I just wanted to update and say thanks. This helped out great! I was able to successfully boot /data from my external SD card as desired, however, my card is only a class 2 so it won't be a good idea until I upgrade it to a class 10.
Lg Optimus F3 comes with very little internal storage, which was giving me a headache, so I wanted to make the phone boot using an external SD as the /data partition.
after following your tip, I unloki'd the boot image and used your Carliv Image Kitchen to extract the contents, edited the fstab and edited out the original code: "/dev/block/platform/msm_sdcc.1/by-name/userdata /data" telling it to mount /data on the /dev/block/mmcblk1p2 instead.
after repacking and re-loking and flashing the .img it had some problems, for some reason it was just booting to a black screen, so I used dd from the team win terminal to copy the /dev/block/platform/msm_sdcc.1/by-name/userdata over to the /dev/block/mmcblk1p2, and it worked!
being a class 2, it booted slowly and responded slowly but works none the less.
to be sure there was no problem with partition size, being how I used dd to mirror userdata over to the sdcard, I ran gparted in linux and resized the partition smaller, then larger to full size (just in case)
thanks for your wonderful tool and for pointing me in the right direction.
help sir carliv please
I was trying to install cm12 using carliv touch recovery 3.3 for kit kat on my alcatel pop d3 but it failed now my phone is stuck and wont turn on
what version of cm can that recovery install??????
DONTEGO said:
I was trying to install cm12 using carliv touch recovery 3.3 for kit kat on my alcatel pop d3 but it failed now my phone is stuck and wont turn on
what version of cm can that recovery install??????
Click to expand...
Click to collapse
The answer is already in your question:
I was trying to install cm12 using carliv touch recovery 3.3 for kit kat....
Click to expand...
Click to collapse
As I already posted in recovery's thread, it will work with kitkat kernels. Some people port it to lollipop but I never recommended that.
So to answer clearly cm11 because cm12 means lollipop, or it will work with any other kitkat based ROM if your phone has any kitkat kernel released.
You need to ask the one who released that cm12 for your phone to provide a matching recovery along.
Now you probably need to reflash the phone with SPFlashTools.
ok thanks a whole lot but im having another issue the sd card is now only readable by my phone how do i go about copying a rom to it whenever i plug it into the pc it doesnt come up
DONTEGO said:
ok thanks a whole lot but im having another issue the sd card is now only readable by my phone how do i go about copying a rom to it whenever i plug it into the pc it doesnt come up
Click to expand...
Click to collapse
im trying to install Mystic_OS_v4DL750.zip does it require a gapps package?
Can some one port ne a recovery for xolo era 4g
Sent from my Hacked_Era_4G using Tapatalk
Is it able to unpack stock recovery?
---------- Post added at 03:25 AM ---------- Previous post was at 03:23 AM ----------
Raakib Zargar said:
Can some one port ne a recovery for xolo era 4g
Sent from my Hacked_Era_4G using Tapatalk
Click to expand...
Click to collapse
Which chipset?
Hi there... I woul like to ask if this tool works for Helio x20 cpu's... (Mt6797 - Leagoo T10) because I'm trying to extract the stock recovery but having trouble with the ramdisk... It says "compression used unknown..." I've seen it mentioned in the discussion some times but the explanation was to use the 1. Metod ??? I'm using the windows 1.1 version and I really don't see any other method to use (start bat, r, 1 recovery.img, , 1 unpack image, error....) I'm just installing Ubuntu to see the difference but would be grateful for some advise... Thanks.
Since main Carlive Image Kitchen thread has been closed in 2017 all the util builds have been lost for some unknown reason. Dev claimed he have personal problems and adviced users to help each other.
I've found latest official version 1.3 builds and publish them here for practical and historic reasons. This util mentioned in a various manuals so people will look for it for a long time then. Old Linux modded version by yuweng is also added for completeness.
View attachment CarlivImageKitchen_Windows_v1.3.zip
View attachment CarlivImageKitchen_Windows_x64_v1.3.zip
View attachment CarlivImageKitchen-Linux_v1.3.zip
View attachment CarlivImageKitchen-Linux_x64_v1.3.zip
View attachment CarlivImageKitchen-Linux-DnD-yuweng.zip
Furthermore user FOV5 @ 4pda.ru forums have modded latest 1.3 version a few times so I do publish here his latest modded version 1.5B3 (12-Jan-2018)
Changes history:
- v1.4: Support for some non-standard kernel images (e.g. LibreELEC and similar).
- v1.5B1:
- Removed 'Boot' and 'Recovery' prefixes from file names while unpacking Boot/Recovery images. This is due to ability to easily compare whole Boot and Recovery folders after unpacking.
- Added optional experimental AmLogic core unpacking. This could be helpful to patch storage media layout when device partition build into the core.
- v1.5B2: Fixed 32 bit app crash after core unpacking. A few other small non critical fixes.
- v1.5B3:
- New while core slitting, parameters like Name, Load Address and Entry Point are preserved.
- Fixed: New app will try to pack core only when all the 4 kernel parts are found in the unpacking folder. If core unpacking process some kind failed, one or more kernel.* files will be missing, so repack process will use original core instead of trying to assemble broken one.
View attachment CarlivImageKitchen_Windows_v1.5B3.7z
If you have any questions related to this modded app version look for FOV5 user at 4pda.ru forums and ask him (I don't know does he speak any langs except Russian, online translators available anyway. There is also Russian numeric captcha problem for non-Russian speakers when loggin in to that forums, sorry guys). I do not often use this app and occasionally visit XDA, so I can't support this product in a professional manner. Help each other guys!

[FLASHLIGHT] Low flashlight brightness fix (torch light, not photo flash)

Hello.
Stock libraries on XZ1 Compact are using 25mA current for the flashlight, which leads to very dim light.
I fixed this to get 400mA current, and now flashlight is very bright, much better than on 25mA (stock) current.
WARNING: You may damage (or even fry) your flashlight LED with these libraries, but i'm think 400mA is fine, because there is 25..400mA limits in the code, and after 2 minutes of light at 400mA my phone's LED was just a bit warm (but not hot).
WARNING: You must disable dm-verity for /vendor/ partition before flashing any .zip attached below, or you will get bootloop.
NOTES:
1. The easiest way to disable dm-verity is to use Magisk to get root (it will automatically disable dm-verity of both /system/ and /vendor/ partitions when installed with default settings). The patched libraries does not require root access, Magisk is mentioned here only for disabling dm-verity.
2. To install Magisk you must unlock bootloader and flash TWRP. Please read [RECOVERY] TWRP 3.2.3-0 (lilac) [UPDATE: 2018-11-28] to learn more about TWRP installation for XZ1 Compact (or find appropriate TWRP for your device).
3. Please read [XZ1c/XZ1/XZp] temp root exploit to backup drm keys implemented to learn more about the way to backup your TA with DRM keys before unlocking your device's bootloader (this is important, because DRM keys will be lost on bootloader unlock, and you will have no way to get them back if you don't have TA backup with those DRM keys).
If you need other current value (in 25..400mA range) - feel free to contact me.
If you need patch for another ROM version or device - please contact me with attached /vendor/lib/libcameralight.so and /vendor/lib64/libcameralight.so from your ROM (and please tell me your device's model and version of your ROM).
You may try to do patch by yourself, tech details about patching is in Post #17 - feel free to upload patched .so files or flashable .zip for your device (please don't forget to write device model and ROM version in the description).
Files without model in name is for XZ1 Compact, other files (with model at the end of file name) is for corresponding phone models.
Files for 47.2.A.0.306 are also compatible with 47.2.A.2.33, 47.2.A.4.41 and 47.2.A.4.45 ROM versions, and may be compatible with future ROM releases (or may not - I don't know exactly, so please check compatibility before flashing).
Please check Post #25 for details about compatibility between fixes and ROM versions, and how to check compatibility if your ROM isn't listed.
You can use Magisk module from Post #32 instead of flashing the ZIP files directly to the /vendor/ (just replace existing .so files in Magisk module ZIP with desired versions (using any ZIP archiver) and install the module).
4PDA.ru post (in Russian)
@S-trace
please can modify for me the one for xz3 and for xzp. thank u
I assume root is needed?
karrouma said:
@S-trace
please can modify for me the one for xz3 and for xzp. thank u
Click to expand...
Click to collapse
Please upload necessary files here and tell me device models and firmware versions of each device you need, and which current should i set.
mEREHAIGE said:
I assume root is needed?
Click to expand...
Click to collapse
Yes, you must get root using Magisk (or disable verity on /vendor/ in any other way) before installing this mod, or you may get bootloop.
Root access itself is not necessary for mod to work, just disabled verity is needed (but installing Magisk is the easiest way to get this for me)
@S-trace
can you make a 350ma for pie version of xz1c
it is same as xzp
Can you make some medium for xz1c? Like 250 ?
karrouma said:
@S-tracecan you make a 350ma for pie version of xz1c
it is same as xzp
Click to expand...
Click to collapse
Done.
manuerduarte said:
Can you make some medium for xz1c? Like 250 ?
Click to expand...
Click to collapse
Done.
Thanks!
S-trace said:
Done.
Done.
Click to expand...
Click to collapse
Thank you my friend.
Teting the 350 and 400
400 is better in all condition for cam
And 400 has no heat so it is fine for daily use.
Thank you for your work
Here for xz3
Attached
Can you modified to 400ma
Thank you
Hi,
This is a welcome patch. It used to be (on Z3C) to just change flashled_calc_parameters file - do you think it's still possible on XZ1C? Can you share more details on how exactly you patch the .so files?
gshegosh81 said:
Hi,
This is a welcome patch. It used to be (on Z3C) to just change flashled_calc_parameters file - do you think it's still possible on XZ1C? Can you share more details on how exactly you patch the .so files?
Click to expand...
Click to collapse
Is there anyway, we can control the current that goes to the flash on the go?
S-trace said:
Done.
Done.
Click to expand...
Click to collapse
@S-trace
Can i take a little bit from your time
Can you make an 450ma and 500 for me.
Thank you
rsk_kelkar said:
Is there anyway, we can control the current that goes to the flash on the go?
Click to expand...
Click to collapse
You can use following script for testing different current values:
Code:
#!/system/bin/sh
toggle=$(cat /sys/class/leds/led:switch_0/brightness)
if [ "$toggle" = "0" ];then
echo 60 > /sys/class/leds/led:torch_0/brightness
echo 60 > /sys/class/leds/led:torch_1/brightness
echo 1 > /sys/class/leds/led:switch_0/brightness
echo "on"
else
echo 0 > /sys/class/leds/led:torch_0/brightness
echo 0 > /sys/class/leds/led:torch_1/brightness
echo 0 > /sys/class/leds/led:switch_0/brightness
echo "off"
fi
60 means 120mA here, stock value is 13 (25mA).
I don't know any way to control flashlight current dynamically from the Android OS (like display brightness can be controlled).
karrouma said:
@S-trace
Can i take a little bit from your time
Can you make an 450ma and 500 for me.
Thank you
Click to expand...
Click to collapse
No, it won't work (I tried) - kernel will limit current to 400mA. Maybe it will be possible if you will patch kernel/dt to overcome this limit, but I'm not sure.
S-trace said:
You can use following script for testing different current values:
Code:
#!/system/bin/sh
toggle=$(cat /sys/class/leds/led:switch_0/brightness)
if [ "$toggle" = "0" ];then
echo 60 > /sys/class/leds/led:torch_0/brightness
echo 60 > /sys/class/leds/led:torch_1/brightness
echo 1 > /sys/class/leds/led:switch_0/brightness
echo "on"
else
echo 0 > /sys/class/leds/led:torch_0/brightness
echo 0 > /sys/class/leds/led:torch_1/brightness
echo 0 > /sys/class/leds/led:switch_0/brightness
echo "off"
fi
60 means 120mA here, stock value is 13 (25mA).
I don't know any way to control flashlight current dynamically from the Android OS (like display brightness can be controlled).
No, it won't work (I tried) - kernel will limit current to 400mA. Maybe it will be possible if you will patch kernel/dt to overcome this limit, but I'm not sure.
Click to expand...
Click to collapse
Thank you
Can you use this on lineageos?
karrouma said:
Here for xz3
Attached
Can you modified to 400ma
Thank you
Click to expand...
Click to collapse
Modified
Can you tell exact ROM version (from which you have taken libraries) to let me upload these patched libraries and original libraries to the OP?
4684361 said:
Can you use this on lineageos?
Click to expand...
Click to collapse
This depends on LineageOS you have.
gshegosh81 said:
Hi,
This is a welcome patch. It used to be (on Z3C) to just change flashled_calc_parameters file - do you think it's still possible on XZ1C? Can you share more details on how exactly you patch the .so files?
Click to expand...
Click to collapse
I'm think /vendor/etc/flashled_calc_parameters.cfg holds only camera flash parameters, not torch parameters.
But you may try to edit this file if you want.
Details about patching (offsets is for XZ1c):
Code:
32bit 8.0: (Thumb-2)
0x3F52 ALL 23=>22
0x3F9A 300 00E0FFE746F2A810=>49F2E030C0F20400
0x3F9A 400 00E0FFE746F2A810=>41F68020C0F20600
64bit 8.0: (ARM64)
0x4BBC ALL 0003=>E002
0x4C18 300 020000140100001400358CD2=>007C92D28000A0F21F2003D5
0x4C18 400 020000140100001400358CD2=>005083D2C000A0F21F2003D5
32bit 9.0: (Thumb-2)
0x4D52 ALL 3C=>3B
0x4DCC 250 00E0FFE746F2A810=>4DF29000C0F20300
0x4DCC 350 00E0FFE746F2A810=>45F23070C0F20500
0x4DCC 400 00E0FFE746F2A810=>41F68020C0F20600
64bit 9.0: (ARM64)
0x5CAC ALL E0=>C0
0x5D64 250 020000140100001400358CD2=>00129AD26000A0F21F2003D5
0x5D64 350 020000140100001400358CD2=>00E68AD2A000A0F21F2003D5
0x5D64 400 020000140100001400358CD2=>005083D2C000A0F21F2003D5
Payloads:
32bit:
MOVW R0, #0x1A80
MOVT R0, #6
64bit:
MOVZ X0, #0x1A80
MOVK X0, #0x6, LSL #16
NOP
The first one-byte patch is just a fixup for BEQ offset (to make it jump to correct offset, because we need 4 extra bytes to insert one more instruction, so we'll replace two useless B opcodes with MOV* instructions).
The second multi-byte patch is a payload, in this example MOV* instructions store 0x61A80 (400000) in R0/X0.
You may use http://armconverter.com/ to assemble payload with desired current value and then use HEX editor to patch your libraries (32bit is more important, i don't know who and when will use 64bit library, but patch it too just to leave OS libraries consistent).
S-trace said:
Modified
Can you tell exact ROM version (from which you have taken libraries) to let me upload these patched libraries and original libraries to the OP?
This depends on LineageOS you have.
I'm think /vendor/etc/flashled_calc_parameters.cfg holds only camera flash parameters, not torch parameters.
But you may try to edit this file if you want.
Details about patching (offsets is for XZ1c):
Code:
32bit 8.0: (Thumb-2)
0x3F52 ALL 23=>22
0x3F9A 300 00E0FFE746F2A810=>49F2E030C0F20400
0x3F9A 400 00E0FFE746F2A810=>41F68020C0F20600
64bit 8.0: (ARM64)
0x4BBC ALL 0003=>E002
0x4C18 300 020000140100001400358CD2=>007C92D28000A0F21F2003D5
0x4C18 400 020000140100001400358CD2=>005083D2C000A0F21F2003D5
32bit 9.0: (Thumb-2)
0x4D52 ALL 3C=>3B
0x4DCC 250 00E0FFE746F2A810=>4DF29000C0F20300
0x4DCC 350 00E0FFE746F2A810=>45F23070C0F20500
0x4DCC 400 00E0FFE746F2A810=>41F68020C0F20600
64bit 9.0: (ARM64)
0x5CAC ALL E0=>C0
0x5D64 250 020000140100001400358CD2=>00129AD26000A0F21F2003D5
0x5D64 350 020000140100001400358CD2=>00E68AD2A000A0F21F2003D5
0x5D64 400 020000140100001400358CD2=>005083D2C000A0F21F2003D5
Payloads:
32bit:
MOVW R0, #0x1A80
MOVT R0, #6
64bit:
MOVZ X0, #0x1A80
MOVK X0, #0x6, LSL #16
NOP
The first one-byte patch is just a fixup for BEQ offset (to make it jump to correct offset, because we need 4 extra bytes to insert one more instruction, so we'll replace two useless B opcodes with MOV* instructions).
The second multi-byte patch is a payload, in this example MOV* instructions store 0x61A80 (400000) in R0/X0.
You may use http://armconverter.com/ to assemble payload with desired current value and then use HEX editor to patch your libraries (32bit is more important, i don't know who and when will use 64bit library, but patch it too just to leave OS libraries consistent).
Click to expand...
Click to collapse
52.0.A.3.84 xz3
karrouma said:
52.0.A.3.84 xz3
Click to expand...
Click to collapse
Thank you.
Uploaded files to the OP.
S-trace said:
Thank you.
Uploaded files to the OP.
Click to expand...
Click to collapse
Thank you

AOSP recovery image is too large for partition

Hi, I have a build problem when building AOSP kernel using Vim3Pro for AOSP kernel development with android kernel 5.10.
I cloned AOSP kernel images following the below command.
git clone https://android.googlesource.com/kernel/hikey-linaro -b android-amlogic-bmeson-5.10
Then, I inserted some additional kernel functions and commands like ‘printk’ and rebuilt it.
The size of recovery.img file increased 32 MB → 32.X MB, and I modified BOARD_RECOVERYIMAGE_PARTITION_SIZE 32MB to 64MB in ‘device/amlogic/yukawa/BoardConfigCommon.mk’ file.
However, when using uboot and fastboot, I still get the below message.
target reported max download size of 117440512 bytes
sending 'recovery' (33412 KB)...
OKAY [ 1.832s]
writing 'recovery'...
FAILED (remote: too large for partition)
finished. total time: 1.845s
Which file or option should I modify other files or options?
JWChoi1996 said:
I modified BOARD_RECOVERYIMAGE_PARTITION_SIZE 32MB to 64MB in ‘device/amlogic/yukawa/BoardConfigCommon.mk’ file.
Click to expand...
Click to collapse
Why? That will make recovery larger than 32mb
aIecxs said:
Why? That will make recovery larger than 32mb
Click to expand...
Click to collapse
I added some additional kernel functions and operations to the original aosp source code for debugging.
Then, the build program generated recovery.img larger than 32MB.
So, I had to fix that variable. if not the build program makes a failure.
Is the increased recovery image file wrong?
Had I some mistakes on aosp source code?
your recovery partition is 32mb, you must not create file larger than 32mb. use another toolchain, clang compiler will half the kernel size compared to gcc.
aIecxs said:
your recovery partition is 32mb, you must not create file larger than 32mb. use another toolchain, clang compiler will half the kernel size compared to gcc.
Click to expand...
Click to collapse
Thank you, I'll try it.
Can I ask you a question?
Is it normal for recovery.img size to increase when I add printk?
Idk, but if recovery is build on edge full 32gb, of course any addition will exceed size I guess.

Categories

Resources