yashsingh1/xdaforums huggingface dataset:
[Miscellaneous Android Development] Santhosh M:
I would like to have basically, though wouldn't be much of use in MTK scene atleast for now. Would like to try and test :)
[Miscellaneous Android Development] superdragonpt:
Hi

Yeah , so far i tried :

LZMA:

MT6582 : (Wiko DarkMoon) JB Kernel :

http://xdaforums.com/android/development/wiko-darkmoon-mt6582-performance-06-08-t2840159

MT6577: (Zte v970 / etc) JB Kernel:

http://xdaforums.com/showthread.php?t=2698984

XZ:

MT6582 / MT6577 (Wiko DarkMoon/ ZTE v970 & MXX a110 )KK Kernel(s):

http://xdaforums.com/android/development/rom-zte-v970-v970m-t2956447

http://xdaforums.com/micromax-a110/development/rom-mmx-a110-t2972561

NOTE: XZ Also works on JB Kernels

And very soon i'll have an MT6595 to play around ...

Stock MTK JB uses GZIP ---> Working

Stock MTK KK uses XZ (and GZIP in some rare cases) --> Working

Everything working just fine ;)

Regards ;)
[Miscellaneous Android Development] bgcngm:
Okay, I see you are referring to kernel compression, but we could assume that the ramdisk compressed with at least the same method would work as well (as kernel supports it). Which device do you currently have so that I can try to repack some test images?
[Miscellaneous Android Development] :
Hi,

I never saw ramdisk compressed in a different way than gzip, but I read it is possible with LZMA, and it is experimental at the moment. They say it must be used with a kernel compressed with same method and with default compression parameters or it will lead to kernel panic.
[Miscellaneous Android Development] superdragonpt:
Hi

Sorry I misunderstood the question ...

The ramdisk itself is GZIP, in all the devices I currently own:

Mt6582

Wiko darkmoon

Zte blade L2

Mt6577

Zte v970

Mt8125

Asus memo tab hd7

If you need the stock boot.img of those devices, I can send them to you.

Also other mtk devices that I work with, are all the same, gzip compression on ramdisk.

With the exception of android one devices that appear to be compressed with XZ

( but the Android One devices, aren't support by this tool, so no harm )

Also, the new 3.10.x MTK kernel ( lollipop) released last week is also compressed with GZIP on the ramdisk. ( currently only lenovo released this new kernel/boot.IMG) with their beta lollipop vibeui 2.5 releases .

Regards *
[Miscellaneous Android Development] jukyO:
Hi all,

when I try unpack, I get script error (linux mint 17):

./unpack-MTK.pl: line 5: syntax error near unexpected token `newline'
./unpack-MTK.pl: line 5: `<!DOCTYPE html>'

Any idea what to do?

Perl version is 5.18.2.

Thanks.
[Miscellaneous Android Development] bgcngm:
No way... error on line 5? :rolleyes: How did you download the scripts?
[Miscellaneous Android Development] jukyO:
Chromium browser, save as.....

chmod +x

dos2unix just in case

in the end chmod 777

Any idea? thanks.

EDIT:

if I do with sudo, it is different:

sudo ./unpack-MTK.pl
./unpack-MTK.pl: 6: ./unpack-MTK.pl: Syntax error: newline unexpected

:eek:
[Miscellaneous Android Development] bgcngm:
Save as? You are saving the HTML then.

Either download the files as .zip (using the feature from Github) or git clone the repo.
[Miscellaneous Android Development] jukyO:
Not html. 'pl'. Not a noob here, I know something on programming.

I'll try as zip.

Link is:

https://github.com/bgcngm/mtk-tools/blob/master/unpack-MTK.pl

https://github.com/bgcngm/mtk-tools/blob/master/repack-MTK.pl

How to download as zip?

EDIT2,

found it.

After download as zip, works as intended.

Thanks and sorry for the confusion.
[Miscellaneous Android Development] superdragonpt:
Hi
[Miscellaneous Android Development] junaid_butt:
help me please!

i was beating around the bush since weeks and unable to solve my issue.... can somebody tell me where to put this script to make it work with cygwin.......help will be appreciated!!!!:laugh::crying:
[Miscellaneous Android Development] bgcngm:
Install cygwin, and put the scripts on the user home folder (PATH_TO_CYGWIN\home\USER).
[Miscellaneous Android Development] junaid_butt:
thanks!

Thanks for this sir, and after this it will be enabled or we have to with some command?

---------- Post added at 03:07 PM ---------- Previous post was at 03:02 PM ----------

One thing more sir, I have changed my cygwin's default home location so it means I have to put this script where I have changed my home's location. E.g c/users/junaid/home/here?
[Miscellaneous Android Development] yiminghung:
I want to try repack the recovery.img , I use the command in Cygwin as the below:

./repack-MT65xx.pl -recovery ./recovery.img-kernel ./recovery.img-ramdisk ./output/newrecovery.img

everything seen good, but the output folder is empty ?? Why ?? not output ???

ps: no error message during repack !

please help~ Thank you so much
[Miscellaneous Android Development] ajparag:
init.rle/ logo.rle not found in ramdisk

I have extracted the boot.img file but the ramdisk here does not contain any init.rle or logo.rle file. How can I change the boot logo in such cases?
[Miscellaneous Android Development] bgcngm:
There is no boot logo inside boot.img. Are you referring to the first boot logo or the second one (before the usual boot animation)?

The first boot logo is logo.bin which I don't know how to edit. The second boot logo is the file boot_logo under /system/media. That one can be easily edited with nbimg.
[Miscellaneous Android Development] ajparag:
I am refering to the boot_logo file. I will try out nbimg. Thanks
[Miscellaneous Android Development] pcgg:
Wow ! Got it finally.
[Miscellaneous Android Development] balamu96m:
It can also be edited with image search editor!!
[Miscellaneous Android Development] yuweng:
Hello yiminghung,

Since nobody reply you, i reply you...:o As mention before, ignore the script error in cygwin, it works fine actually. However, i've tried with ActivePerl for Windows, it doesn't work so don't even bother to try ! :p

./repack-mt65xx.pl -recovery ./recovery.img-kernel.img ./recovery.img-ramdisk ./newrecovery.img

Then rename newrecovery.img to recovery.img & flash via mobileuncle tool

Tips : You can try here for the latest version to port. Examine your original /recovery.img-ramdisk/etc/recovery.fstab & compare to the latest version you want to port. I've successfully ported CWM 5.8.1.9 for my phone...Latest version 5.8.3.1 is not compatible...:rolleyes:

Happy Modding...

Once again, thanks to Bruno for sharing this great tool ! ;)
[Miscellaneous Android Development] dangk:
this is my original recovery.img from my phone mtk65xx.... somebody please help me to make CWM custom recovery for my phone... thanks in advance...
[Miscellaneous Android Development] bindassdost:
Please mention your phone model

for easy porting
[Miscellaneous Android Development] dangk:
selular.co.id/handset/Selular/nexian/Nexian/315494244319/nexian-A899-Xtreme

this is the link my phone model... thanks before...
[Miscellaneous Android Development] yuweng:
@dangk

i have already sent your the file since 26 May ! Why you people never check your pm one... :(
[Miscellaneous Android Development] myphoneuser:
How can I add ext2 and zram to the unpacked boot.img? Is it possible?
[Miscellaneous Android Development] dangk:
im sorry master... i dont see notification on my PM... I ll try it and feed back.... thank a laot before..
[Miscellaneous Android Development] jbctiong:
@yuweng

Can you tech me how to port and edit cwm recovery? TIA.:)
[Miscellaneous Android Development] yuweng:
Hello jbctiong,

Haha, this question by right should be answer by Bruno himself but since you ask, i'll just explain it from my experience...;)

Clock Work Mod(CWM) is developed by Koushik Dutta & he is so nice that he put all his work here to share...:o

As said before, first unpack your own recovery & look at your /recovery.img-ramdisk/etc/recovery.fstab & download few latest version of recoveries, unpack & compare it to yours... Make sure they match (unpack command mention on previous pages)

Then copy your original recovery.img-kernel.img & repack it together with the ported recovery.img-ramdisk folder...require trial & error though...:o

If yours is not an MT65xx then you'll have to refer to here for the unpack tools & commands...

Happy Modding...;)

@dangk

No hard feelings...:D

@myphoneuser

i think Bruno did that before...(read it before on his eten forum) The only way is to try it yourself or wait for Bruno's answer...;)
[Miscellaneous Android Development] jbctiong:
Thanks for the info.

I am trying but I couldn't find the location for the boot and recovery of my ROM.

I am using Zopo100 and the existing Recovery works well except it cannot do a FULL Nandroid backup. i.e. the boot and recovery after backup is only 1KB each.

DO you know how to locate the boot and recovery location of an ICS ROM?

The /proc/mtd has null data n /proc/partitions show only the sizes. PLs advise. TIA.
[Miscellaneous Android Development] yuweng:
Wow, i envy you, you have lay ur hand on Zopo100...:p Not even one MT6575 has landed in my country...:o

Mostly new technology are like dat, too many bugs when it is launch, this not working, dat not working...:o As always people are debating on forums; to wait or to buy now...:p

This question is best answer by Bruno as he has experience on MT6575...:D

Best place to look for solutions is russian forums as they are also among the first to lay their hands on MT6575. In the mean time, i've just googled & found Bruno commenting in this forum. It is in russian so use google translation...;)

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

You can also try extracting recovery from here & port it to ur Zopo100...See if it works... ;)
[Miscellaneous Android Development] balamu96m:
Yuweng bro,

I think it is not good to buy another mtk device until they release their source..........

If you are going for a 1ghz,512mb ram & ics, you can go for a similar to spice mi 500, it is a snapdragon phone & 5" too......i think it costs the same as other mtk6575 phones.........
[Miscellaneous Android Development] yuweng:
Wow, Spice Mi-500, 5 inch screen with snapdragon & the price is the same as MT6575 ! Meaning bye-bye Mediatek & hello Qualcomm...:D
[Miscellaneous Android Development] balamu96m:
Yeah!!

We should make MediaTek realize their big mistake!!
[Miscellaneous Android Development] bgcngm:
Doesn't matter. Put it wherever you like, you just need to run the scripts from within Cygwin environment. My previous reply was just to make things easier for you.
[Miscellaneous Android Development] junaid_butt:
Thanks Again, sorry if I sounded like noob

Sir, I am getting bash error that directory not found :( I want to unpack my boot.img and I also paste the boot.img in the script folder and run the command for unpacking in cygwin and I am getting error :( sir please its been a week I am stuck here I also re-installed my Windows....Please sir help me out I am badly stucked here. Thanks Sir.
[Miscellaneous Android Development] bgcngm:
If you want to report a problem, please do it correctly. Post here the command you're using and the script output.
[Miscellaneous Android Development] bgcngm:
Where did you see that info? Do you have any idea what device works with LZMA compressed ramdisk? I have made some tests with [MENTION=5238428]superdragonpt[/MENTION] in one of his devices and it doesn't boot. I used default compression parameters.

Before closing this "issue" I would like to be sure that we tested everything.
[Miscellaneous Android Development] superdragonpt:
Hi there

I actually made some more tests...

The ones you already know, and this time i did tests under the MT6577 Platform.

JB Kernel(s) [3.4.0 / 5 / 11] with LZMA compression + LZMA RmDisk = No boot

KK Kernel [3.4.67] with LZMA compression + LZMA RMDisk = No boot

Same on the MT6582 platform (the tests we did...)

Regards
[Miscellaneous Android Development] DerTeufel1980:
Why do you want to use lzma for ramdisk?

If it's just for size, you can try what I did on my note2.

I have compiled the ramdisk into the zImage by specifying its directory in defconfig.

Then I added an empty gzip compressed ramdisk to satisfy the need of having one.

Edit: obviously, you would not be able to extract those ramdisks easily

Gesendet von meinem GT-N7105 mit Tapatalk
[Miscellaneous Android Development] bgcngm:
Basically, I just wanted to add support for other compression methods. Not a real need at the moment. Of course, LZMA compressed ramdisk would be good for old devices with smaller partition sizes, specially recovery.
[Miscellaneous Android Development] :
Actually wasn't LZMA but XZ, which uses LZMA compression, and they call it LZMA2. I read about that last summer when I was studying possibilities to reduce recovery ramdisk size.

The only one functional I read about it here, and the author's github is here. I abandoned for the moment the investigation because it needs the kernel compressed same way (which my current computer can't do in any way), and I read more about different tests that concluded the gzip compression is superior at the moment (what you gain in terms of size with XZ you loose in time - took longer to boot - and the ones who tested it said it has problems sometimes). But in all the phones I could touch and test I never seen other compression than gzip. Yes, it is a possibility to use different compression, but even google devices din't do it yet, although they are listed.
[Miscellaneous Android Development] Little.lin:
I'm not happy ,for the previous version,it works fine

but new version can not work anymore

term show the syntax error word unexpected

can give me a previos versiong else?
[Miscellaneous Android Development] bgcngm:
If you're not happy, please report the problem properly. Writing that there's a syntax error doesn't help and I don't have a clue of what you may be doing. Error could be yours.
[Miscellaneous Android Development] leo.riv:
[MENTION=455439]bgcngm[/MENTION]

Canot repacked using Cygwin

__________________________________________________________________________________________________________________

$ ./repack-MTK.pl -boot neo.img-kernel.img stock.img-ramdisk boot.img

MTK-Tools by Bruno Martins

MTK repack script (last update: 06-01-2015)

Repacking boot image...

Ramdisk size: 3179 blocks

Build information:

Base address and offsets:

Base address: 0x10000000

Kernel offset: 0x00008000

Ramdisk offset: 0x01000000

Second stage offset: 0x00f00000

Tags offset: 0x00000100

Other:

Page size (bytes): 2048

ASCIIZ product name: '1336460062'

Command line: ''

Error: couldn't execute 'mkbootimg.exe' binary!

Check if file exists or its permissions.

_________________________________________________________________________________________________________________________________________

Please Help me........
[Miscellaneous Android Development] delta-roh:
Sir, I have got a problem with the version of mkbootimg.exe from 15th ‎January ‎2015 from GitHub. I don't use your scripts, but only mkbootimg.exe with own (normal) Windows batch files.

I called it with this command line:

mkbootimg --kernel new\kernel --ramdisk new\ramdisk.gz --cmdline "console=ttyHSL0 androidboot.hardware=pyramid no_console_suspend=1" --base "0x48000000" --pagesize "2048" --kernel_offset "0x8000" --ramdisk_offset "0x1000000" -o new\boot.img

It worked perfectly without any errors messages and created the boot.img in the subdirectory new. But when I analysed the header parameters of the new boot, I recognized that from the SHA1 checksum only the first 8 bytes were written. I calculated the SHA1 manually and these first 8 bytes are correct - but the other 12 bytes are just 0.

The same call as above with the cygwin-mkbootimg.exe generates a correct header - but I like your work! Any help is much appreciated - thank you in advance!
[Miscellaneous Android Development] delta-roh:
I just checked the new version from GitHub from 2015-02-15 (yesterday) and now it works perfect, SHA1 sum is OK - thank you very much! May I post this version together with my batch-file - of course with reference to you?
[Miscellaneous Android Development] :
Since you only want to use mkbootimg.exe you should ask that from me :), since I'm the one who built it for bgcngm's tool. I saw your post earlier and checked then fixed shd id generate. I'm glad it's fixed now.
[Miscellaneous Android Development] delta-roh:
Thank you very much and - sorry - I didn't know that you have built mkbootimg.exe - very good job! And yes, I only need mkbootimg.exe and now ask you for your permission, Sir.
[Miscellaneous Android Development] :
Sure, go ahead. :)
[Miscellaneous Android Development] delta-roh:
Thank you very much, Sir, much appreciated! :D:D:D
[Miscellaneous Android Development] quantik:
Hello,

I'm using your script to unpack/repack boot.img for a MTK6572 device, with cygwin under win7 32 bits

All is going well, no errors during unpack/repack

but my original boot.img is 6.144Ko large and my newly created one is 4.146Ko large.

When I flash it, my device is stuck at logo.

Any advice?

Thanks!
[Miscellaneous Android Development] bgcngm:
Differences in file size sometimes may not be taken into account, specially if the input file was readback from the device. The suggestion is to unpack and repack without doing any change. If that still doesn't work, double check your environment setup or even try under Ubuntu.
[Miscellaneous Android Development] quantik:
I tried to unpack/repack without modifying anything, the device wont start

So I tried under Ubuntu, no problem for unpack

Then at repack I have those errors:

Page size (bytes): 2048
ASCIIZ product name: 'vCC015D'
Command line: ''
/home/quantik/Downloads/mkbootimg: 1: /home/quantik/Downloads/mkbootimg: ELF : not found
/home/quantik/Downloads/mkbootimg: 2: /home/quantik/Downloads/mkbootimg: Syntax error: "(" unexpected

ok I've put it in bin, changed the permission, still doesn't work

is it a 64-bit executable? (i'm32bit)
[Miscellaneous Android Development] dougsanti:
Error: board name too large

I tried to repack a boot.img but I get a board name too large error

Contents of boot.img-args.txt:

--base 0x10000000

--pagesize 2048

--kernel_offset 0x00008000

--ramdisk_offset 0x01000000

--second_offset 0x00f00000

--tags_offset 0x00000100

--board SM112_OTD_W_V0.1

--cmdline 5.3_S1016

Other:

Page size (bytes):	2048

ASCIIZ product name:	'SM112_OTD_W_V0.1'

Command line:	'5.3_S1016'

Error: board name too large

Thank you
[Miscellaneous Android Development] bgcngm:
You can temporarily edit boot.img-args.txt and edit board name to something else.

[MENTION=5186178]carliv[/MENTION], could you please check this? It seems an error coming from mkbootimg binary.
[Miscellaneous Android Development] :
This is Android standard lenght for board name:

#define BOOT_NAME_SIZE [COLOR="Red"]16[/COLOR]

and is checked in mkbootimg:

if(strlen(board) [COLOR="Red"]>=[/COLOR] BOOT_NAME_SIZE) {
fprintf(stderr," Error: board name too large\n");
return usage();
}

The board name for that device it has 16 characters lenght, and that triggers the error. Anyway the board name is not checked for security and can be changed to something else (like your username). If people really want this I can increase the lenght to a bigger value, but in my opinion that's not necessary. You can rename the board to something shorter or cut a character from it. It doesn't affect the image functionality. Just do what bgcngm says and edit that file.
[Miscellaneous Android Development] cappa72:
Master bgcngm,

I can confirm that the scripts work well in case of

MT6752 SoC

Tested with Lenovo P70-A_ROW using Linux Mint 13 - 64bit.

Thank you.
[Miscellaneous Android Development] DvDwx.:
it is possible unpack the boot.img/ recovery.img directly from Official updates provided from manufacture?

in Case MT6592 SoC phones updates from Gionee /BLU manufactures...
[Miscellaneous Android Development] bgcngm:
Sure, why not?
[Miscellaneous Android Development] Shinkumara:
Got the same problem, is there any solution for linux 32 bit? [MENTION=455439]bgcngm[/MENTION]
[Miscellaneous Android Development] quantik:
I created a virtualbox (under win7 32 bits) with ubuntu 64 bits and it worked
[Miscellaneous Android Development] Jsierra008:
Hi can you tell me if its posible fix a upside down cwm recovery and how to do it ??
[Miscellaneous Android Development] bgcngm:
Only by compiling it from sources, but that's on topic here.
[Miscellaneous Android Development] Uber_Noob:
I have almost no idea where to start....

ok so like my name i'm an UBER NOOB sorry, I have a rooted device DL800 aka ZTE KIS 3 MAX with a copy of my stock rom, I was directed here after trying to swap my internal sd card with my external sd card with utter failure since my phone runs kitkat 4.4.2 which no longer has a vold.fstab file. To my understanding thus far I've got to edit the Ramdisk (if I'm wrong please correct me) and I'm currently downloading elementary luna os which is a ubuntu based linux so that should be fine, but apart from that I DON'T HAVE THE SLIGHTEST Idea where or how I should start this process after the linux is installed can you guys please throw some pointers my way? some step by steps would be awesome, I see you guys talking scripts but I'm lost.....Sorry again for being such a noob.
[Miscellaneous Android Development] bloodytolits:
/usr/perl/bin : bad interpreter : permission denied

Using windows 8 64 bit via cygwin

Installed several perl versions. Still doesn't work.

Strawberry perl 5.14, 5.18, 5.20

Changing ramdisk of mt6589

Problem with perl or?

Can you post the perl version you're using.?
[Miscellaneous Android Development] bgcngm:
Read first post.
[Miscellaneous Android Development] Dvalin21:
Will there be an update to include the MT8752?
[Miscellaneous Android Development] bgcngm:
Is it needed?
[Miscellaneous Android Development] Dvalin21:
Yes
[Miscellaneous Android Development] superdragonpt:
No.

MT8752 uses the MT6752 Mediatek Platform.

Cheers
[Miscellaneous Android Development] Dvalin21:
Thank you!!! Do you know anything that can unpack the truezone.bin or secro.img
[Miscellaneous Android Development] Dvalin21:
Well I've been trying to unpack MT8752 recovery/boot/and logo.bin.

Apparently it does need to be updated.

I keep getting that the logo.bin file is corrupted when i know for certain its not.

And when i try to unpack recovery/boot, it never works, i get

'Error: the specificed boot image does not appear to contain a valid gzip file!'
[Miscellaneous Android Development] bgcngm:
Would you mind sharing the stock flash dump (image files for SP Flash Tool) for that phone? I wanted to have a look.
[Miscellaneous Android Development] Dvalin21:
Here they are, boot, recovery, and logo https://mega.co.nz/#F!7k5DGLKR!Uh-JzwoWCXLQKLVhCtWgoA
[Miscellaneous Android Development] bgcngm:
From which phone are those files?
[Miscellaneous Android Development] Dvalin21:
Cube T7 64bit CPU 8752

Supposedly the bootloader is unlocked

for what Cube says on their facebook page
[Miscellaneous Android Development] Dvalin21:
Any luck with the files I gave you? Thanks in advance
[Miscellaneous Android Development] bgcngm:
Sorry, but I had no time to check that.
[Miscellaneous Android Development] Dvalin21:
No worries, I was just checking in with ya. Thanks for even doing this