yashsingh1/xdaforums huggingface dataset:
[Miscellaneous Android Development] superdragonpt:
^This

Please stop asking about unrelated things, to this thread.

This is not the proper place to ask for kernel compiling.

Have a look on android general please.

The thread is all about a tool to pack and repack kernel ramdisk, totally unrelated to kernel compiling.

Thanks
[Miscellaneous Android Development] fays91:
Support MTK X25 on boot.img ?????

RedmiPro Xiaomi
[Miscellaneous Android Development] SashaVeliki:
I tried all night to repack and I do not know how. I have not Ubuntu. Please, can somebody to post me all needed files for dead MEIZU MX4 phone (mt6595)? Please...
[Miscellaneous Android Development] bgcngm:
The scripts are for boot/recovery images only. That kind of file is totally unsupported.
[Miscellaneous Android Development] billyx1:
I have been able to unpack, modify and repack an image for a Mediatek device according to several blogs and instructions in the net. But if I try to boot the image with "fastboot boot twrp.img" the device just reboots after some time.

On my first tries I got the errors 'image is not a boot image' and 'invalid kernel address: not lie in memory' so I expect to have made some steps forward, but I have no idea to analyze the next problem. Is there a possibility to find more information about the problem?
[Miscellaneous Android Development] teknosrp:
Hello!

I managed to modify sucesfully the boot logo of a MT6589 device using these scripts, but now I have tried with a MT6580 and the scripts failed. After researching a little bit and studying the differences between the logo.bin files, I have found that the structure of the MT6580 logo file is almost identical, only there are two little differences which make the script fail.

In the headers of the logo file, the old one uses capital letters and the new one doesn't.

The images contained use 32 bit color depth (bgra) instead of rgb565.

Then, with a little modifications I achieved modifying the original script and making it work with this new logo.bin file. I managed to modify the logo.bin of the MT6580 and sucesfully flash it on the phone. I think this new logo.bin format is also used in all new MT67xx devices, so I think updating the original script worth it. If you don't have time, I can try doing it myself and post it.

Sorry if my english is not very correct. I'm spanish and I don't write it very well:)

Thanks for the original work!
[Miscellaneous Android Development] bgcngm:
You can submit a PR to my GitHub. I will take a look and be happy to merge your contribution.
[Miscellaneous Android Development] ssuicidequad:
I have Micromax Vdeo 2 (Q4101),I've been trying to root my device with magisk.For this, I need boot.img , I also downloaded stock rom and extracted that .rar file but I didn't find anything.. I read a thread saying that boot.img can be found in stock rom file after extracting it..but I found nothing. So, if anyone have any suggestions help me with it..
[Miscellaneous Android Development] dtingley11222:
Hi I used this to try and unpack this boot.img and I get this error:

Error!! the specified boot image does not appear to contain a valid gzip file!

Is there anything I'm not doing?

Thanks
[Miscellaneous Android Development] bgcngm:
Except for the fact that MT6575 outperforms MSM7227A...

Anyway, this "MediaTek vs Qualcomm" chat is offtopic, so let's end it now.
[Miscellaneous Android Development] balamu96m:
We'll end it & hope mediatek release their source code soon.....
[Miscellaneous Android Development] banjo0917:
We've got kernel source code of Alcatel 918N which is MT6573 phone, succesfully compi,ed the kernel but failed injecting zimage into boot.img, Im stuck at bootlogo. Maybe anyone can help.
[Miscellaneous Android Development] myphoneuser:
Please post the source. I can start testing with you too.
[Miscellaneous Android Development] bgcngm:
There you go: http://sourceforge.net/projects/alcatel/files/
[Miscellaneous Android Development] myphoneuser:
Just curious, how difficult could be to port all compiled drivers (modules) from the original kernel to the alcatel kernel source? I am very interested on adding swap support to my rom. I would really appreciate an approximate roadmap.

Thanks in advance...
[Miscellaneous Android Development] bgcngm:
In order not to go off-topic, please refer to this thread for those specific questions related to MT65x3 kernel development.
[Miscellaneous Android Development] myphoneuser:
Thanks, posting right now...
[Miscellaneous Android Development] balamu96m:
Alcatel 918D is a dual sim phone and it would be more closer to our phones................so we can try using it.......

-----------------

i'm a noob in compiling things from source.......is there any guide for that ?? i want to give it a try..........any links for learning it would help a lot !!:)
[Miscellaneous Android Development] gh.rohit:
can anyone help me?? i want to extract boot.img and system.img etc files on windows 7, i have cygwin installed.

i copied mkbootimg(modified one, found on page 2) to cygwin > bin, and created one folder in cygwin>new folder , where i copied scripts and boot.img......then opened command prompt and type command from first post.....but i think its wrong method.

sorry for noob question, i am new to this.
[Miscellaneous Android Development] breaky9973:
With these tools you also have to make a system.img? Or is there a faster way for that?

Answer solved!

I succesfully packed my system folder to a system.img file with this website:

http://www.slatedroid.com/topic/32450-how-to-unpack-repack-systemimg-properly-using-linux/
[Miscellaneous Android Development] killer04:
please help me to make custom recovery for my phone...

CSL Mi322

Android 2.2.1

mt6516

s-csl.my/index.php/csl-phones/switch/item/254-mini-mi322

thanks in advance...
[Miscellaneous Android Development] bgcngm:
I have created a public github repository (bgcngm/mtk-tools) to host the scripts. The most up to date version is always available at the repo.

I'm currently finishing the re-write of the scripts in order to add the unpack/repack feature of MediaTek logo.bin images.

Please don't just leech the files and go away. You can easily say thanks just by pressing "Thanks" button.
[Miscellaneous Android Development] bgcngm:
Tests are finished and the new version of the scripts has been released. There were some code changes to the "old" unpack/repack functions, but the main change is the possibility to unpack/repack MT65xx logo.bin images. This was inspired on the great finding by starix (source here).

The unpack script can now extract all the raw images (RGB565 format) found inside logo.bin. Those raw images can be edited using paint.net + RGB565 plugin. After editing your images, you just have then to repack logo.bin (make sure that the number of raw images is the same).

One last note: unpack script usage has been changed, so please read the new instructions.
[Miscellaneous Android Development] myphoneuser:
@banjo0917

Were you able to compile a new kernel for you mt6573 device using the 918D kernel sources?

Thanks in advance...
[Miscellaneous Android Development] bgcngm:
Please don't ask those questions in this thread. That is not the topic of this thread, so use the correct one.
[Miscellaneous Android Development] hardi75:
Thank you very much, rootet a phone the first time on my own with your scripts. :D
[Miscellaneous Android Development] balamu96m:
Thabks a lot!!
[Miscellaneous Android Development] qltsar:
First of all, i want to thank you your hardwork bgcngm!

Unfortunatelly, i have some problems with the new boot.img at SPFlashTool, it seems that the repack process uses hihger compression rate, than the original, because, my original boot.img is ~6MB, the new boot.img after i used your scipts is ~2.58MB.

The flash tool can't make it, and it's shows this error message:

I hope that somebody can help!

Thanks :)!
[Miscellaneous Android Development] bgcngm:
That error message you are getting has nothing to do with the new boot.img. You are using a scatter file that is not meant for your phone, that's your problem.
[Miscellaneous Android Development] qltsar:
Thank you for the fast reply, but i did what i have to.

I pulled cat /proc/mtd and saved it to /sdcard/firmware.info, like thist tutorial says, after that I loaded it to MTK Rom Studio, and creted a scatter file, and loaded this scatter file to SP Flash tool.

I don't know what am i doing wrong :(.

________________________________________

I don't know what happened, i've managed to try this method with another phone (Alcatel OT-918D MIX) and i have rooted the device with modifying the boot.img.

The first phone was Alcatel OT-985, and i can't flash back the modified boot.img to the phone. This is very misterious :)!
[Miscellaneous Android Development] dzingga:
hi bgcngm...

how the script if i want to repack logo.bin???

please teach me how...
[Miscellaneous Android Development] bgcngm:
As explained on the first post of the thread:

Repack script usage:

Usage: repack-MT65xx.pl COMMAND [...]

COMMANDs are:

-boot <kernel> <ramdisk-directory> <outfile>
Repacks boot image

-recovery <kernel> <ramdisk-directory> <outfile>
Repacks recovery image

-logo <logo-directory> <outfile>
Repacks logo image

So, if you want to repack logo you can run the following command:

./repack-MT65xx.pl -logo ./ new_logo.bin

In this example, it is assumed that .rgb565 files are on the same folder as the script.
[Miscellaneous Android Development] dzingga:
hi again bgcngm...

i already succeed unpack logo.bin with script unpack-mt65xx.pl logo.bin

i had instal cygwin and gzip in my computer with OS win7 prof.

but, when i repack with script: repack-mt65xx.pl -logo logo newlogo.bin i had something error like this attachment.

and i send my unpack result for you, perhaps you could repack it for me

but, i strongly hope that you could learn me how to correct the error so i can repack it myself

greathfully thanks and sorry for my bad english...
[Miscellaneous Android Development] bgcngm:
Can you please confirm which package version of Perl you have installed? I must be Perl v5.10.1, so if you have another version you should force install that one.
[Miscellaneous Android Development] dzingga:
I think it should be latest version i had installed, 'cause i download from official site. are you sure that the problem caused by perl???
[Miscellaneous Android Development] bgcngm:
As I said, please check Perl version. I understand that you have downloaded Cygwin from official site, but please use its installer to check which version of Perl is installed and to install the correct one.

EDIT: I've just noticed from the screenshot you've posted that you are running the scripts from Windows command prompt and not from Cygwin terminal window. Please check that as well.
[Miscellaneous Android Development] dzingga:
my perl version is 5.14.22.140

so i should downgrade the perl??

when i run from cygwin terminal window it says:

bash: ./repack-mt65xx.pl: /usr/bin/perl: bad interpreter: permission denied
[Miscellaneous Android Development] bgcngm:
Yes, you must downgrade Perl version to the one I mentioned before.
[Miscellaneous Android Development] dzingga:
that's very hard to find perl v5.10.1 from the internet. i wish if you have it and upload it for me...
[Miscellaneous Android Development] dzingga:
it's has 3 times i found and download perl but it's always a zip file and when i extract nothing executable file found. i wondering how to instal, is that just copy paste or there is a tutorial???

could you teach me??
[Miscellaneous Android Development] bgcngm:
From Cygwin setup you can choose which packages you want or not to be installed.

Just choose that Perl version by removing the one that is installed by default and installing the previous one. :good:
[Miscellaneous Android Development] bindassdost:
can we use your scripts in dsixda kitchen

if there is any method then pls let me know

if there isnt please add your scripts to dsixda

one more question

how to flash logo.bin in recovery mode

im using following edify syntax but dint work

package_extract_file("logo.bin", "/tmp/logo.bin");

write_raw_image("/tmp/logo.bin", "logo.bin");

delete("/tmp/logo.bin");
[Miscellaneous Android Development] dzingga:
it works!!!!!

finally, after hundred times try to install perl and cygwin i success to repack logo.bin

thanks to bgcngm for teach me and learning me how to do it....

great...great...great...thanks....
[Miscellaneous Android Development] jurben:
can we use your scripts in dsixda kitchen?

i'm sure yes, but not directly.

i think what you must do is just modify files in

tools/extract_boot_files/

and

tools/mkboot/

to accommodate these perl script

attached is what i have try
[Miscellaneous Android Development] cybermaus:
I did not try them, as I use dsixda kitchen only to de-odex, but I believe someone already did integrate these scripts into that kitchen?
[Miscellaneous Android Development] bgcngm:
Even I wasn't aware of that. :p
[Miscellaneous Android Development] jurben:
i think that is plugins that run under kitchen but not directly-integrated used at cooking.
[Miscellaneous Android Development] cybermaus:
Ok, for those of you (running under Linux, not Cygwin) that have issues running this script, getting the error that the mkbootimg cannot be found or executed, I found an extra possible cause.

If you read this thread, you should already know to make the program executable and copy it to /bin, as this was reported several times before.

sudo chmod a+x mkbootimg
sudo chmod a+x repack-MT65xx.pl
sudo chmod a+x unpack-MT65xx.pl
sudo cp mkbootimg /bin

But additionally, if you are running on a 64-bit Linux, please also ensure you have the 32 bit libraries installed. The mkbootimg is 32-bit only.

sudo apt-get install ia32-libs

I spend quite some time figuring out why suddenly I could not build images anymore after refreshing my Ubuntu install. The shell is not reporting the binary is wrong, but that it cannot find the binary, which is confusing.
[Miscellaneous Android Development] comdevx:
unpack-MT65xx.pl recovery.img

unpack-MT65xx.pl: command not found

on ubuntu 12.04 help
[Miscellaneous Android Development] oz42:
do a ./unpack-MT65xx.pl instead
[Miscellaneous Android Development] dzingga:
is it able to unpack n repack recovery.img from broadcom chipset???
[Miscellaneous Android Development] bgcngm:
No, this is MediaTek specific. But probably you can manage to do that by using dsixda's kitchen.
[Miscellaneous Android Development] dzingga:
well, do you have script for that chipset? where do i can find it??
[Miscellaneous Android Development] bgcngm:
No, I don't. As I said, try dsixda's kitchen. If that doesn't work, search on Google.
[Miscellaneous Android Development] dzingga:
well, i should download the kitchen first. but i don't know how to use it...
[Miscellaneous Android Development] browsingman:
Newer logo.bin files not only contain full-screen graphic images but also smaller graphic images for showing battery percentage information within the main picture.

However the current repack script does not seem to produce valid logo.bin files in such situations.

So i assume that the script needs to be modified. I only took a quick look at those files and got the feeling that those files are not packed.
[Miscellaneous Android Development] bgcngm:
I haven't yet found any MTK logo.bin file that couldn't be repacked using my scripts... even with the additional images that you refer. Can you please base your conclusions on one example of a logo.bin that is not repacked like it was supposed?
[Miscellaneous Android Development] qltsar:
Hi bgcngm!

I don't know if it's a good place to ask, but I hope it won't be a problem.

So I red that you have a ZTE V970. It has MTK6577 chipset. Mine too, it's an ALCATEL OT-997, but I can't make a correct scatter file to the phone.

When I want to read back a partition the flashtool gives an error, that i can't handle.

Is that any trick that You used when you have created a scatter file for your phone? Unfortunatelly, Alcatel phones have a customized partition layout, because all phone's have an additional (/custpack) partition, which generates some problems to the flashtool. I have faced them before, i.e. In older phones (MT6573)I have to add __NODL_CUSTPACK 0x.... to a scatter file to flash the phone.

Thanks in advice!

qltsar
[Miscellaneous Android Development] browsingman:
Sure. I have attached the logo.bin from the current Zopo zp300+ ROM (original .bin file + extracted contents from your unpack routine).

If i use your repack routine, it will get repacked.

When using the unmodified logo.bin file, as soon as the ac adapter gets plugged in, i will see the "battery is loading" bitmap and on top of this i will see the current battery level in percent.

When using the repacked logo.bin file (even without modifying a single file, just repacking the extracted content), the "battery is loading" bitmap still shows. However, the battery level in percent is a screwed up graphics.

Kind regards,

BrowsingMan

P.S.:

Ah...one additional note -> I have seen this kind of logo.bin files beginning with Android 4.0.4 builds. All former 4.0.3 builds just had static bitmaps all of the same size.....
[Miscellaneous Android Development] bgcngm:
Well, that logo.bin is indeed different than all the other ones I've seen before. I don't think it is related to the fact you refer about Android 4.0.4 because both ZTE V970 and Huawei U8836D are based on Android 4.0.4 and its logo.bin can be successfully repacked.

Anyway, I will look deeper into that logo.bin and see if I can manage to deal with it.
[Miscellaneous Android Development] vshlkmr:
Lets see if i can port over a cwm for my device :) thanx bruno..
[Miscellaneous Android Development] browsingman:
Thanx Bruno. And you are right: There are models with Android 4.0.4 that do not have this kind of logo.bin.

However, besides all Zopo phones with MTK6577 chipset i found another manufacturer that uses this kind of logo structure: Amoi N820.

I am still unsure if this is related to the build level of Android 4.0.4 or if it is a specific feature that has been added by some chinese developers.
[Miscellaneous Android Development] dzingga:
i have succesfully mod my mtk 6573 recovery.img with cwm 6.0.1.1 touch but i can't wipe data / factory reset from recovery mode. if i chose that there is no option for YES or NO. how can i fix that??
[Miscellaneous Android Development] cibi21:
PLease post your logo.bin files.

I have now the htc evo logo :(

Its booring
[Miscellaneous Android Development] nhathoa:
Hi

Pls check the attached file. That is logo.bin from original rom for ZP900 with MTK6577. After unpack, I cant repack it. Pls suggest.

NhatHoa@NhatHoa-PC ~/unpack
$ ./repack-MT65xx.pl -logo files new.bin
Subroutine Cwd::cwd redefined at /usr/lib/perl5/5.10/i686-cygwin/Cwd.pm line 407.
Subroutine Cwd::fastcwd redefined at /usr/lib/perl5/5.10/i686-cygwin/Cwd.pm line 812.
Subroutine Cwd::getcwd redefined at /usr/lib/perl5/5.10/i686-cygwin/Cwd.pm line812.
Subroutine Cwd::abs_path redefined at /usr/lib/perl5/5.10/i686-cygwin/Cwd.pm line 812.
32628 blocks
error: could not load kernel '-logo'
[Miscellaneous Android Development] gpshunter:
MTK Rom Studio

Could you please make available the "MTK Rom Studio" for download ?

Thanks a lot !
[Miscellaneous Android Development] bgcngm:
The latest version of MTK ROM Studio can be downloaded from here. Credits go to linerty.
[Miscellaneous Android Development] bgcngm:
Okay, I've managed to solve the problem found while unpacking/repacking those "new" logo.bin files that contain more than nine packed rgb565 raw files. The problem was that raw files were being repacked out of the correct order due to the filenames given when unpacked. I just needed to change a small part of the code to be sure that files were saved with a proper name, which would then lead to a correct repack.

The repo has just been updated! :victory:
[Miscellaneous Android Development] ss429842:
unable to repack my bootimg

i am unable to repack my boot.img it is showing error[screenshot]

please help me to solve this
[Miscellaneous Android Development] cybermaus:
You quoted the entire manual, but should re-read it: On the repack, you should specify one of -boot, -recovery or -logo as parameters.
[Miscellaneous Android Development] ss429842:
Sorry..

But I am unable to repack my boot.img

It always shows error

Please help me out of thisthis
[Miscellaneous Android Development] bgcngm:
Which version of Perl have you installed? It seems to be v5.14 and it should be v5.10.1 as mentioned on the OP. That's the reason why you are having problems with switch function. ;)
[Miscellaneous Android Development] ss429842:
Ohh

Then how would I degrade the perl I installed with cygwin
[Miscellaneous Android Development] bgcngm:
Please read the thread. That has already happened to other user(s) and the instructions can be found a few pages back.
[Miscellaneous Android Development] cybermaus:
Sorry, I think you also failed to notice Bruno, but I repeat: As shown in the manual, you need to specify one of -boot, -recovery or -logo:

./repack.pl -boot <kernel> <directory> <file>
[Miscellaneous Android Development] bgcngm:
That is indeed a syntax problem, but no matter what, Perl version has to be downgraded or else it will keep failing on that part of the code (line 16).

By the way, this doesn't happen under Ubuntu and that's why I never worried too much about it. Only cygwin users have to be sure that the correct Perl version is installed.
[Miscellaneous Android Development] ss429842:
I am using this command

./repack.pl boot.img-kernel.img boot.img-ramdisk new-boot.img

Is there any problem...

How to use this in ubuntu, if I use a ubuntu live os
[Miscellaneous Android Development] bgcngm:
You should type the following command:

./repack.pl [B][COLOR="Red"]-boot[/COLOR][/B] boot.img-kernel.img boot.img-ramdisk new-boot.img
[Miscellaneous Android Development] ss429842:
That my commands are right...

How to mess with ubuntu live cd

Do you have any idea

I have used ubuntu for some days but didn't know to play with terminal.
[Miscellaneous Android Development] bgcngm:
If you don't know how to work with Ubuntu, then keep using cygwin. That should not be a problem, just downgrade Perl version and you're good to go.

I think that you haven't yet noticed that we keep saying that the syntax of your command is not completely correct. Don't forget to add -boot in front of script name.
[Miscellaneous Android Development] paulobrien:
And it now works great. Many thanks! :)

P
[Miscellaneous Android Development] bgcngm:
I took some time and removed the usage of switch function. The latest release of mtk-tools is now also compatible with Perl v5.14.2 for those using cygwin. No more worries! :fingers-crossed:
[Miscellaneous Android Development] ss429842:
Thanks .......

But now A new problem when ever i flash my modified boot img ,my phone says''no sim card''do you have any idea that why should this happen?@
[Miscellaneous Android Development] bgcngm:
No, I don't have any idea of what you have modified on your boot.img, but that's a problem beyond the purpose of this thread.
[Miscellaneous Android Development] ss429842:
I hav just made it unsecure for rooting

Ro.secure+1 >ro.secure+0
[Miscellaneous Android Development] bgcngm:
If that was the only change you made there's no reason for the problem you're experiencing. :rolleyes:
[Miscellaneous Android Development] ss429842:
Yah......

My :screwy:mighty beast (phone) is so sensetive that till now no one is able to root###:screwy::screwy:
[Miscellaneous Android Development] ss429842:
Do you have any idea about extracting and packing of each of the .img &.bin in androids flash file.....
[Miscellaneous Android Development] bgcngm:
Do you mean unpack / repack system.img or usrdata.img? Yes, that's possible. Just search along the forum... there are lots of threads about that. Please note that the most common filesystems for those partitions are yaffs2 and ext4.