www.chinaphonearena.com

Full Version: [EXPLORE]Your recovery image
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
WARNINGS
#########
I am not an Andoid expert so try at own risk
Plus the Apache license says the same thing.

Credits
########
vampirefo for his advice on adb and dumchar_info
Bruno Martins for his perl scripts
Android dev team for mkbootimg

Devices known to work
#####################
MT6516
MT65x3 (MT6513 and MT6573)
MT65x5 (MT6515 and MT6575)
MT6577
MT65x2 (MT6572 and MT6582)
MT6589
MT83xx (MT8377 and MT8389)

System requirements
##################
Perl v5.14+

Compressors for repack
cpio
gunzip (gz)

Unpack errors
If you see "Error: the input file does not appear to be supported or valid"
You may need more compression software to download
Consider:
lzma, lzop, xz


Software to download = the downloads (not the compression software)
####################
repack-MT65xx.pl, unpack-MT65xx.pl from
[Only registered and activated users can see links Click here to register]
repack-MT65xx.pl, unpack-MT65xx.pl
which both have the following copyright
Quote:* Copyright © 2012 Bruno Martins (bgcngm@XDA)
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* [Only registered and activated users can see links Click here to register]
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* You may not distribute nor sell this software or parts of it in
* Source, Object nor in any other form without explicit permission obtained
* from the original author.
Note that you are doing the download from upstream site so no breach occurs for me

Download mkbootimage from same site and make all three downloads executable

I could not find the actual license for mkbootimg but I believe it was based on
Android stuff so the current header at
[Only registered and activated users can see links Click here to register]

shows the new license is still Apache as per
Quote:** Copyright 2007, The Android Open Source Project
**
** Licensed under the Apache License, Version 2.0 (the "License");
** you may not use this file except in compliance with the License.
** You may obtain a copy of the License at
**
** [Only registered and activated users can see links Click here to register]
**
** Unless required by applicable law or agreed to in writing, software
** distributed under the License is distributed on an "AS IS" BASIS,
** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
** See the License for the specific language governing permissions and
** limitations under the License

Again, I am not distributing anything so quite legal IMO.


Unpack
#######
Create a folder and place your recovery.img in it
also place a copy of your downloads in there

unpack command is (local user)
Code:
./unpack-MT65xx.pl recovery.img

---> new files in folder become:
recovery.img-kernel.img
recovery.img-ramdisk


I make a copy of the ramdisk folder elsewhere before changing anything.

[Image: 2rzxx81.jpg]

Change something to ram folder
##############################
Not discussed

[Image: 2vuzmg1.jpg]

#######
repack
#######
Run the command as a local user
Code:
./repack-MT65xx.pl -recovery recovery.img-kernel.img recovery.img-ramdisk recovery.img-new

[Image: xek7wi.jpg]

###########
CHECK SIZE
##########

You must check the resultant size of the new recovery image called recovery.img-new

It must not exceed the hex to decimal conversion from using dumchar_info

For example
adb shell cat /proc/dumchar_info

recovery 0x0000000000600000 0x0000000002380000 2 /dev/block/mmcblk0

Take first hex number and convert it to decimal gives me 6291456
This is the total byte size.

Compare it to your new recovery.

New recovery must not exceed it so abort if it does please.

EDITS
#####
Can also do boot or logo images but not tested so far