2015-04-08 Big Update to version 1.0 stable
- corrected few issues in scripts;
- rebuilt all modules also to correct some issues;
- cleaned up the source;
- added more compression support - see next;
- now the kitchen supports ramdisks compressions as following: gz, bz2, lzma, xz, lzo, lz4;
- converted to a Menu driven interface: now everything can be done from inside kitchen menu with few clicks;
- updated Instructions (can be loaded in kitchen interface for reading).
* for those of you who don't want the menu interface, there is version 0.5 in download list, with the old individual scripts structure but updated with same modules and compression support as version 1.0 (I kept this especially for windows, where it can be used with drag and drop).
2015.02.16 Update version 0.3
So, what's this?
- rebuilt binaries to correct few issues.
- some fixes in scripts.
- generate correct sha id.
- use minigzip for repacking ramdisk as in recovery building.
- compiled standalone bzip2 module.
It's a utility (tool) for unpacking and repacking boot and recovery images for many kind of android phones. I made two versions, one for windows users and one for linux users. The windows version works by dragging&dropping over the script you want to use, while the linux version will work with terminal commans (very simple commands though).
For windows version
the scripts are batch files
and for linux bash files
, but the names are the same and they do same thing:
- clear_all will clear the working folder deleting any unpacked boot/recovery folder, but not the boot or recovery files (original or repacked).
- image_info will print on screen all informations about the image you want to check (sizes, offsets, cmdline, etc.) and all these infos will be saved in a text file (which will be deleted when you clear the folder - see point 1). This is handy if you don't want to unpack the image, but only to see its infos. This script works for all kind of images (not specific to a hardware platform).
- unpack_img is the script for unpacking images for all kind of phones with different platforms (qcom, exynos,...) but not MTK. It will work I think for AndroidOne project phones.
- unpack_MTK_img is the script for unpack any MTK image, including the ones from new platforms (mt6595, mt6752, mt6753, and whatever they are).
- repack_img is the repacking script for regular (non-MTK) phones.
- repack_MTK_img is the repacking script for all MTK boot/recovery images.
Besides these in Utility folder there is a bin folder (hidden) with all executables needed by the scripts.
How to use it?
As I said, for windows
an image (boot or recovery) you want to unpack over the corresponding script, and drag&drop the folder of the unpacked image over the repacking script when you want to repack it. Choose the scripts with MTK in name for MTK images, and the other ones for any other kind.
open a terminal window in CarlivImageKitchen folder and type (or just copy/paste from here) the commands:
or what name has your image.
To repack type like this:
and so on.
NOTICE here for repacking just type the name of the folder, without slashes.
Important, my utility doesn't have any request for position on partitions or directories. In testes worked in a third sub-sub-subfolder on an external partition (both in linux and windows), and it proves to work with any kind of name (except special characters that may break the script), including spaces or dots in folders names, but I recommend you to use dashes or underscores instead of spaces, and avoid dots. In repacking procedure, the script will prompt you to introduce a name for the new image, and if it will contain dots or spaces you will see an error. Also the name must include the type of image
) - Eg: "boot-stock-repack" or "recovery_cwm_m7", and without the extension (.img).
Same condition about names applies for images you want to unpack; if they have other names, like "cwm-m7.img", rename it including the type of image in name: eg "recovery-cwm-m7.img". Why this? As many of you used bgcngm
's tool you noticed he asked for including an argument in script command ("-boot" or "-recovery") because this is the way his script can apply the right header for ramdisks in repacking. My tool does that from image name and you don't have to add extra arguments in command.
A second note: This tool doesn't support Rockchip Android images.
What's under hood?
All modules used in my tools are compiled by me, both for windows and linux.
Also for windows, because it requires few cygwin libraries to work with compressing/uncompressing executables, I used those libraries and executables from latest cygwin release
(gzip, xz, bzip2, cpio and the corresponding dlls).
But my utility doesn't require a cygwin installed. Well, linux version worked very well in cygwin environment, but it's not necessary since I provided a standalone windows version.
The executable modules:
- imageinfo - a initial source is shared by osm0sis here, but I used that only for inspiration because I liked the ideea; I used the unpackbootimg from cyanogenmod 12, system/core/mkbootimg and modded to get a similar output as in osm0sis bootimg-info.
- mkbootfs - built in cygwin for windows and normal in linux. I used the "stock" source from cyanogenmod 12 /system/core/cpio.
- mkbootimg - based cyanogenmod 12 source, but modded, and for windows fixed to work (the standard source it builds in windows but doesn't work). I used for fixing the ideeas from Pete Batard's source. This module repack also dtb-images back to repacked image.
- mtkbootimg - same as mkbootimg, but with additions from omnirom code for MTK, to append the MTK header to this kind of images. This one will check first the kernel and then the ramdisk for MTK header, and if it's not there it will append it, but if it's there will skip.
- unpackbootimg - from same cyanogenmod 12 source, with few extra additions by me.
- unpackmtkimg - same as unpackbootimg but adapted for MTK images, for which will strip the header off before unpacking, to be easy to work with.
For windows I used jeremejevs cmdcolor source
to build a module which add colors in cmd console, for a pleasant experience.
All these sources are modified, improved and fixed in some aspects.
Why I did it?
Well, the trigger was the apparition of the new platforms from MTK, which didn't worked with any of the old tools. First who found out what's changed was mrjavum
. Starting from his findings I explored more, and then provided the update ideea and binaries for bgcngm
's tool. But that is only for linux. I know it can be used in windows with cygwin, but we had a standalone tool, michfood
's tool, which now doesn't work with the new platforms.
So I started to think for a new utility for windows to solve that need. After I did it I thought I can do it for linux too even if there exists already bgcngm
's tool and works great. And I made it not only for MTK phones.
That's the reason I called it Image Kitchen. It is like a tool that combines michfood
's tool with osm0sis
Kitchen, and serves for different platforms (I tested MTK
, with or without dtb
, and all worked great). But it's first release, not fully tested (I don't have all kind of phones for that), and so it is marked beta.[/HIDE]
Removed since it was only for some specific testing, and anyway the windows version now works and it shows exactly the same with linux, producing same result.