yashsingh1/xdaforums huggingface dataset:
[Miscellaneous Android Development] bgcngm:
Yes, the latest version of the unpack / repack scripts can only run using Perl v5.14+. Update your Cygwin installation and make sure the latest Perl package is installed. ;)
[Miscellaneous Android Development] idoasis:
Thanks, working but still the file

"recovery.img-ramdisk.cpio.gz" is missing
[Miscellaneous Android Development] bgcngm:
And why do you need that file? Since one of the latest releases that file is deleted after successful extraction.
[Miscellaneous Android Development] idoasis:
Its not:)

Just tried to make a cwm recovery for mtk6565 phone.

The custom recovery didnt work so I thought this is the reason.

When I try to enter the recovey, it is stuck on the logo screen.
[Miscellaneous Android Development] bgcngm:
That is not the reason the CWM-recovery port is failing. It can be due to various reasons... wrong kernel, wrong init binary, etc...
[Miscellaneous Android Development] idoasis:
The kernel I took from the old recovery, and put the "recovery.img-ramdisk" folder of a mtk6577 custom recovery.

Is it a problem it is a mtk6575 phone?
[Miscellaneous Android Development] bgcngm:
Yes, the problem could be the init binary. Try using the binary from the stock recovery.
[Miscellaneous Android Development] idoasis:
How do I do that?
[Miscellaneous Android Development] bgcngm:
Just copy it over from the stock recovery ramdisk into the new ramdisk and then repack.
[Miscellaneous Android Development] projectmax:
does this also applies on boot image? i have to 2 init files, one has an rc file extension and the other has .file extension, do i need to copy them both?thanks. my phone stucks at android logo when restoring boot image..maybe because of this problem..thanks for the help..^_^
[Miscellaneous Android Development] idoasis:
Thanks Bruno, will try it.

Do you mean the sbin folder in ramdisk?
[Miscellaneous Android Development] Phil3759:
Thank you for this great script and the source :good:

I did not use it but was curious about looking at the source.

The repack command is basically mkbootimg, obviously

mkbootimg --kernel $kernel --ramdisk new-ramdisk-repack.cpio.gz -o $outfile

However, are there any side-effects due to missing the cmdline, pagesize... options?
[Miscellaneous Android Development] :
So say I have ubuntu and I'm using the terminal to execute the command

unpack-mt65xx.pl boot.img

It says command not found...

How do i extract this kernel?

Then once it's extracted can I go through and enable an overclock from within?

thanks
[Miscellaneous Android Development] bgcngm:
You can say so, but that's just the end part of the script. Before, ramdisk has to be created in a special way or else boot.img won't work in MediaTek devices. ;)

Have you ever worked with linux? :rolleyes: Try this:

./unpack-mt65xx.pl boot.img

After unpacking you get the ramdisk as well as the compiled kernel image. As far as it concerns to the kernel image itself, there's actually nothing you can do with it. Forget this if you think that you may be able to overclock your phone. For that, you need to compile a kernel from sources. :cool:
[Miscellaneous Android Development] jahideu:
MT6589 system.img

how can i extract file from MT6589 system.img ???
[Miscellaneous Android Development] bgcngm:
Search the forum for a way to unpack ext4 system images. You have a guide over here. ;)
[Miscellaneous Android Development] :
How can we figure out how the Micromax A110 guy's developed a 1.4Ghz Thunderzap kernel for their MTK6577?
[Miscellaneous Android Development] bgcngm:
Surely that kernel was compiled from sources. :cowboy:
[Miscellaneous Android Development] Valkirie:
Hello,

For some reasons, when I extract my boot.img (kuphone.img) with MTKTools, I get a 6MB file that can be both flashed/unpacked without any issue.

./unpack-MT65xx.pl kuphone.img
./repack-MT65xx.pl -boot kuphone.img-kernel.img kuphone.img-ramdisk boot.img

- original file: http://scalfig.free.fr/kuphone/kuphone.img (working)

- repacked file: http://scalfig.free.fr/kuphone/boot.img (bootloop)

But once repacked, the file is now 3.9MB and will give me bootloop if flashed. Any idea ?
[Miscellaneous Android Development] lolet:
I pretty sure it's because you messed up file permissions. Look at screenshot below. Right side is original file, left side its yours - your files don't have permissions to execute ;/ and original file is bigger because its raw copy of partition.
[Miscellaneous Android Development] Valkirie:
Thanks for your fast answer.

Anyway, how am I suppose to handle those permissions as I'm using windows & cygwin.

Am i supposed to chmod something ?
[Miscellaneous Android Development] lolet:
chmod in cygwin environment can't change the execution permission. The best thing you can do is to install ubuntu on a virutal machine.
[Miscellaneous Android Development] Valkirie:
I'm not against installing Ubuntu but I tried something faster and the result is strange...

I modified ./unpack ./repack so they won't unpack ramdisk.cpio.gz.

Then ./repack will use the ramdisk.cpio.gz I'm giving him. (I'm doing this to avoid unpack/repack to modify any permissions under the ramdisk file).

But somehow, the phone won't boot with the new boot.img.

Just like last time, I uploaded both files.

Original (6MB): http://88.191.136.34/kuphone/boots/boot.img

Original Kernel (3.3MB): http://88.191.136.34/kuphone/boots/boot.img-kernel.img

Original Ramdisk (0.6MB): http://88.191.136.34/kuphone/boots/boot.img-ramdisk.cpio.gz

Original Koophone S9 boot.img.

Modified (3.8MB): http://88.191.136.34/kuphone/boots/test.img

In this one I just unpacked the original boot.img. Then, repacked it with its own kernel and ramdisk.cpio.gz. (without any modifications) (this one won't boot :/)

Damn it ! I would have ported MIUI / LEWA for a long time without this problem... (I've been doing this for Goophone I5 without any problem...)
[Miscellaneous Android Development] lolet:
You edited out code of repack script too much, so it doesn't generate 512k ROOTFS header for ramdisk.
[Miscellaneous Android Development] Valkirie:
Well. I edited almost nothing. I'm surprise this 512k ROOTFS header is gone...

EDIT: FIXED. Now I'm able to use ramdisk outofbox (still unable to modify them without breaking permissions)

EDIT #2: Almost forgot the most important. Thanks ! :)
[Miscellaneous Android Development] nemero16:
why when i try to recompile my logo.bin, I get this error?

$ ./repack-mt65xx.pl -logo logo.bin-unpacked logonew.bin
MTK-Tools by Bruno Martins
MT65xx repack script (last update: 27-01-2013)

Repacking logo image...
Error: could not find any .png or .rgb565 file under the specified directory 'logo.bin-unpacked'

In "logo.bin-unpacked" folder I have all rgb565 images...

I think the problem is here

for my $inputfile ( [COLOR="Red"]glob "./$filename-img[*.*"[/COLOR] ) {
[Miscellaneous Android Development] bgcngm:
Can't test at the moment because I'm on holidays, but can you upload your logo.bin somewhere? I will check that when I'm back.
[Miscellaneous Android Development] dhikunthea:
This is what i looking for...

Many thanks to dev
[Miscellaneous Android Development] nemero16:
this is the logo.bin...when I decompile it all works, but when I recompile it, the script shows that message.
[Miscellaneous Android Development] t-minik:
Hi

Thanks for your great work

I tried your script into cygwin and after installing some binaries it seem to work great for unpacking but when i repack, all seem ok but no output file.img is created.

I tried with boot.img from my Acer V370 MT6589

here you can see :

does anyone has a clue on what's going wrong ?

Best regards.
[Miscellaneous Android Development] bgcngm:
Sorry for the late reply. Never seen that happening. Can you check if it could be an anti-virus that is putting the file into quarantine or something like that?
[Miscellaneous Android Development] honaga:
hi can you analyzed what i've done wrong? im using windows 7 64bit cygwin. i'm not an expert :D
[Miscellaneous Android Development] bgcngm:
Are you working with MediaTek boot/recovery images?
[Miscellaneous Android Development] NetMare:
Hi Bruno,

you still know me from the rhyme pro and the v970 times? ;)

I do have some questions and maybe you can help me with it (tried to send you PN - did not work?!)

I do have a new MTK6589t based device. There was a chinese cwm based recovery installed (and the rom was not that good).

In this chinese recovery (btw it says Zopo C3 by Kyle but my device is no zopo?! ;)) all keys are working.

I made a backup via MTK Droid Tools of it and installed the stock rom with SPFT. This stock recovery is english but very limited and vol- is down, vol+ is select and power just fades in/out the menu text).

So I do have both recovery.imgs and I can unpack both with your pl skripts... but I can not use the online cwm bulider as the image is not gz format.

Can you maybe show me a way how to mod the recovery to get a full english cwm based recovery for my device?

Hope you can gime a hint...

regerads,

NetMare
[Miscellaneous Android Development] bgcngm:
Although this is not on topic, the simplest way to do what you want is to take an already compiled recovery for another MTK device and port it to yours. For example, you can get the latest one that I've released for V987, unpack it and then repack it using the kernel from your phone. You may only want to change default.prop with the correct entries.
[Miscellaneous Android Development] relol:
EDIT: Forget it, i've found the error, i was not using the script properly :)
[Miscellaneous Android Development] swooby:
FYI: Looks like they also work with the MT8125 that ships in the Lenovo Yoga 8" and 10" Tablets.
[Miscellaneous Android Development] bgcngm:
Yes, I was aware of that already. ;)
[Miscellaneous Android Development] gacama:
I´ve reciently ported to my device te huawei g610 rom, that has an logo.bin with a so strange structure...

with this rom off charge animation it´s bugged, flashing a stock logo.bin doesn´t work

this is the original logo.bin

https://www.dropbox.com/s/pvs2m439dw06ij0/logo.bin

any idea?
[Miscellaneous Android Development] beavermml:
sorry for noobish question..

can i use the technique to repair FAKE ram info in the kernel? i got a chinese note 2 clone and i really hate the fake info on it.. i have a working kernel with correct info but wont boot with the stock rom...
[Miscellaneous Android Development] faizul134:
Boot.img and ramdisk.img

I have a MTK6589T device (walton x2mini)

In my stock rom i have boot.img and ramdisk.img both these file. After going through the thread I think it should be one file. Now my question is If I want to port a rom I have to use my original boot.img. Now should I compile those to into one boot.img for porting? If yes, How to do that? Any help plz. :( Sry for my bad english . :/
[Miscellaneous Android Development] bjef10:
I need help.i want to port android 4.2.2 to my device MT6577. But i don't know how to edit boot.img to boot android 4.2.2
[Miscellaneous Android Development] superdragonpt:
Wrong Thread mate.

On topic:

I can also confirm this works great with the MT6589 SoC

Regards
[Miscellaneous Android Development] bgcngm:
Which information you want to change exactly? You are probably looking for build.prop changes, which is found under /system.

Disregard that ramdisk.img... boot.img contains ramdisk and kernel. As far as it concerns to ports, this is not the thread to ask those questions.

MT6589?!? :confused: Didn't you want to write MT6592 instead?
[Miscellaneous Android Development] superdragonpt:
Hi

../mediatek/platform/mt6589/kernel/core/include/mach/uncompress.h:18:19: warning: unused variable 'tmp' [-Wunused-variable]
AS arch/arm/boot/compressed/lib1funcs.o
AS arch/arm/boot/compressed/ashldi3.o
LD [M] mediatek/kernel/drivers/fmradio/mtk_fm_drv.ko
LD [M] mediatek/kernel/drivers/combo/common/mtk_wmt_wifi.ko
LD [M] mediatek/kernel/drivers/combo/drv_wlan/mt6628/wlan/wlan_mt6628.ko
LD [M] mediatek/kernel/drivers/dual_ccci/ccci.ko
LD [M] mediatek/platform/mt6589/kernel/drivers/devinfo/devinfo.ko
LD [M] mediatek/platform/mt6589/kernel/drivers/dual_ccci/ccci_plat.ko
LD [M] mediatek/platform/mt6589/kernel/drivers/gpu/pvr/mtklfb.ko
LD [M] mediatek/platform/mt6589/kernel/drivers/videocodec/vcodec_kernel_driver.ko
LD [M] mediatek/platform/mt6589/kernel/drivers/devapc/devapc.ko
LD [M] mediatek/platform/mt6589/kernel/drivers/masp/sec.ko
LD [M] mediatek/platform/[COLOR="Red"][B]mt6589[/B][/COLOR]/kernel/drivers/gpu/pvr/pvrsrvkm.ko
AS arch/arm/boot/compressed/piggy.gzip.o
LD arch/arm/boot/compressed/vmlinux
OBJCOPY arch/arm/boot/zImage
Kernel: arch/arm/boot/zImage is ready
superdragonpt@superdragonpt-System-Product-Name:~/android/source/asus/kernel$

It's MT6589 :p

Regards
[Miscellaneous Android Development] bgcngm:
Ohhh, that's old news. :D
[Miscellaneous Android Development] faizul134:
old perl version.

I have cygwin installed but perl version is old than requirement. I just only want to update the perl. How to do that? because whole cygwin is a very big file to download from cygwin.com :(
[Miscellaneous Android Development] AbduL_PT:
Hi,

thanks for sharing this tools, but i'm having a problem with this. I tried unpacking and repacking a boot.img of a MTK 6589 ( BQ Aquaris5), without doing anything in between and can't get it to boot.

I now that is a good boot.img because i use it to revert the non boot. I'm using the same CWM package to flash the 2 boot.img.

This is what i'm doing.

I'm using sudo, but i also tried it without. What i'm doing wrong ?

This is the boot.img that i'm using.
[Miscellaneous Android Development] beavermml:
fake RAM capacity.. if i look at the setting->app->running, it shows that my phone has 2GB ram and 95% full which is fake becoz my SoC only has 512MB ram ( i confirmed this by running command ,"free" in the terminal which shows that i only has 480MB ram ). the phone also shows fake internal capacity of 12GB which i know that it only have 400MB for..
[Miscellaneous Android Development] AbduL_PT:
Got the issue solved.

I had a mkbootimg in usr/local/bin that i use for RK devices and it's only for RK. I edit your script to call the mkbootimg that is in the mkt-tools folder and it boots ok. :good:
[Miscellaneous Android Development] bgcngm:
That's something you can't change just by editing ramdisk, as such information is not there. May be at kernel level, but in that case there's nothing you can't do without sources. Anyway, I would say that fake information is at system apps level. Anyway, that goes beyond the topic of this thread, so...

Thanks for confirming that issue was on your side. As a matter of fact you should have changed the name of the binary you already had, because that one is modified and mine is the original.
[Miscellaneous Android Development] showjechar:
lenovo S938T is MT9592

What time can support MT6592 ????

thank you
[Miscellaneous Android Development] bgcngm:
Most likely the scripts also support MT6592 images. Do you have some for me to try?
[Miscellaneous Android Development] iZLeeP:
Many thanks for the scripts. Works very well on my MT6575 and MT6577 devices.
[Miscellaneous Android Development] JimieTheFox:
No output file on Cygwin !!

Hi, first of all awesome work and thank you very much :) But I tried using your scripts to repack my boot.img and while everything works out great I still can't find the output file :confused: Firewall + Anti-virus disabled and mkbootimg(.exe) chmoded with a+x !!! Thank you again !
[Miscellaneous Android Development] bgcngm:
Probably the same problem already reported with Windows 8 x64 and Cygwin. I wish I could reproduce that issue, but I can't. Use a virtual machine instead and it will be fine.
[Miscellaneous Android Development] superdragonpt:
Hi

works great on the new MT6582 (Wiko DarkMoon) ;)

Regards
[Miscellaneous Android Development] bgcngm:
Good. :) At first I thought you were referring to Wiko Highway, which is MT6592 based.
[Miscellaneous Android Development] bgcngm:
Today I have tested unpacking and repacking boot and recovery images from a MT6592 based device and can now confirm it works flawlessly. :victory:
[Miscellaneous Android Development] superdragonpt:
Awesome, its now confirmed that it works on The new SoC's.

;)

Regards
[Miscellaneous Android Development] anonimo95:
hi [MENTION=455439]bgcngm[/MENTION], unpack works great, but i cannot repack it, says:

Can't exec "mkbootimg": Access denied at ./repack-MT65xx.pl line 90.

I already gave 777 to it and executed as root, but error's still there

the command i use is this one:

repack-MT65xx.pl -boot boot.img-kernel.img boot.img-ramdisk kerneltest.img

any solution?
[Miscellaneous Android Development] bgcngm:
Make sure that mkbootimg has the proper permission. To check that, try to execute it. There's no need to run the scripts as root.
[Miscellaneous Android Development] anonimo95:
got this error

http://i.imgur.com/MGgT8S3.png

i suppose i should install any library or something...
[Miscellaneous Android Development] bgcngm:
At first glance, I thought you didn't even had the mkbootimg binary in the working directory. But looking again it really seems a dependency missing. I never came across that issue, though. Which OS are you using, is it Ubuntu?
[Miscellaneous Android Development] anonimo95:
[MENTION=455439]bgcngm[/MENTION]

it's elementary os, based on ubuntu 12.04

i did a research,seems like 32bit libraries are missing, tried to install them and i think i have messed up the libraries or something, i run know: ./mkbootimg and it gives order not found...i think i have to reinstall everything sigh

EDIT!!!!

made this

apt-get install ia32-libs

now i have libraries and repacked without no error, will try new boot img :)
[Miscellaneous Android Development] bgcngm:
Good! Thanks for sharing. It may be useful for others.
[Miscellaneous Android Development] youngchaos:
Hello man , when i do the repack everything is ok says that boot.img is packed but i cannot find it anywhere...

using MTK6592, might be the problem? Unpacking works like charm tho... just repack is not going well.. but terminal says everything is ok.. no error no nothing... :S
[Miscellaneous Android Development] bgcngm:
What is your setup by the way? Read this post and the following answer.
[Miscellaneous Android Development] youngchaos:
Ouch maybe win8 is the problem? Win8.1 x64 :( i will try virtual machine with ubuntu or i try to run as win7 mode , give you some updates tomorrow thanks!!!
[Miscellaneous Android Development] bgcngm:
I also have Windows 8.1 x64 and I don't remember having those issues when testing with Cygwin (I mainly use the scripts under Ubuntu).
[Miscellaneous Android Development] youngchaos:
Moved to virtualbox with Ubuntu X64 , but got the same problem . Line 90... how do i check the right permission for mkbootimg? I tried to execrute it with ./mkbootimg but got this -> no suck file or directory.. MHHH :S

Fixed , new ubuntu is a bit messy with ia32 libs do this :

then

tadan , repacking works :D
[Miscellaneous Android Development] Dr-Shadow:
Hi [MENTION=455439]bgcngm[/MENTION],

I made a pull request for "Fix wrong chmod on mkbootimg"

https://github.com/bgcngm/mtk-tools/pull/4

Anyway, good job for your scripts
[Miscellaneous Android Development] Sdk_Zone:
[MENTION=455439]bgcngm[/MENTION]

hello bro

thanks for tool

i got this error at repack on ubuntu

Can't exec "/home/sdkzone/mtktools/mkbootimg": Permission denied at ./repack-MT65xx.pl line 90.

please help asap
[Miscellaneous Android Development] werty100:
Also happens to my and i need to repack a kernel
[Miscellaneous Android Development] DerTeufel1980:
Why don't you just give execute permission to mkbootimg?

Gesendet von meinem JY-G4 mit Tapatalk
[Miscellaneous Android Development] anoopspeaks:
i got this error

unpack-MT65xx.pl

recovery.img

←[1;34mMTK-Tools by Bruno Martins

MT65xx unpack script (last update: 27-01-2013)

←[0m

Valid Android signature found...

←[33m

Input file information:

←[0m

Kernel size: 4226056 bytes / load address: 0x10008000

Ramdisk size: 1143215 bytes / load address: 0x11000000

Second stage size: 0 bytes / load address: 0x10f00000

Page size: 2048 bytes

ASCIIZ product name: ' '

Command line: (none)

Kernel written to 'recovery.img-kernel.img'

←[31m

Error: the boot image does not appear to contain a valid gzip file←[0m

i used active perl to run perl script please help
[Miscellaneous Android Development] blackbeard:
^^^ same as above
[Miscellaneous Android Development] bgcngm:
You should either run the scripts on Ubuntu (highly recommended) or Windows, using Cygwin. Those are the only environments where the scripts were developed and tested.
[Miscellaneous Android Development] irfanjunaid:
But I prefer Ubuntu.... Extremely Android friendly....!
[Miscellaneous Android Development] Rahul Dhobi:
Unpack and repack successfully but not booting

I have successfully unpacked boot.img and replaced zimage which was compiled for mt6589 device, I' able to generate newboot.img but it wont boot please help :(:(:(

I have attached unpacked files here. I'm using Micromax A116 phone
[Miscellaneous Android Development] Diego910:
I get this error

Can't exec "/home/diego/Descargas/mtk-tools/mkbootimg": Permiso denegado at ./repack-MT65xx.pl line 92
[Miscellaneous Android Development] bgcngm:
Fix mkbootimg permissions.
[Miscellaneous Android Development] leo.riv:
Got a error

"Error: cpio binary not found!"

Please help me
[Miscellaneous Android Development] bgcngm:
You are missing dependencies. Did you choose a full Cygwin installation?
[Miscellaneous Android Development] superdragonpt:
missing cygwin modules ( re-install )

this doesn't happens on Linux ;p

you can try Linux on an VM Station ( go with Oracle)

everything is much better on an full Linux environment

regards
[Miscellaneous Android Development] leo.riv:
Only "perl" package
[Miscellaneous Android Development] bgcngm:
Well, then you already have your answer. Either do a full install or go for the best solution, as explained on above post.
[Miscellaneous Android Development] leo.riv:
Thanks
[Miscellaneous Android Development] KineichiNxt:
really thanks sir for this script...
[Miscellaneous Android Development] bgcngm:
Well, in that case, just hit the Thanks button! ;)
[Miscellaneous Android Development] joeyhuab:
Help

Could someone help me make my boot.img insecure? It's an MT6589 device and I've tried your script and all and it keeps on saying Ramdisk Size: FIND: Parameter format not correct upon repacking.

Here's my boot.img. I just want an insecure boot.img. That's all. Thanks in advanced! :fingers-crossed:
[Miscellaneous Android Development] polfrank:
Hello, I managed to unpack successfully, BUT when I try to repack I get this:

I have tried many times, and I made sure that I put the correct name of kernel.img and ramdisk directory in my command... Any help? :(
[Miscellaneous Android Development] bgcngm:
The syntax is incorrect. You must include the command (-boot for boot images / -recovery for recovery images).
[Miscellaneous Android Development] joeyhuab:
I'm sorry sir, I know you're busy and all, but can you help me make my boot.img insecure? It's posted in the last post of the previous page. :( Will really appreciate it since I've tried your wonderful scripts and couldn't get them to repack well.
[Miscellaneous Android Development] bgcngm:
First of all, the error message you're getting points out to an incomplete Cygwin installation (double check your setup). I assume it is Cygwin because 'find' is part of every Linux distro. It has been said over and over that using Ubuntu is the best option to run the scripts.

On other hand, the changes you want to apply are not the topic of the thread, but I can say that creating an insecure boot.img requires a patched adbd binary. You have to find it yourself. Alternatively you can skip modification of boot.img and simply use adbd Insecure.
[Miscellaneous Android Development] joeyhuab:
Found the problem. The cygwin path wasn't the first one in the environment variables causing it to use the Windows comnand find instead of Linux's FIND. Got it repacked now! Thanks for your scripts!