Android Tablets Forum banner

[tool] AML8726mx Partition Size Patcher by cxz

4K views 17 replies 2 participants last post by  cxz 
#1 · (Edited by Moderator)
Here is an experimental Windows tool for changing partition sizes.
It can change the size of these partitions in the same order.
data, cache, system, boot, recovery, aml_logo, logo
The internal storage size adjusts automatically.

aml8726mx-partition-size-patcher_[cxz].zip
download: https://yadi.sk/d/2F8RoIAy3G6bUU

the Readme.txt included
--------------------------------------------------------------------------
AML8726mx Partition Size Patcher by cxz (slatedroid)
--------------------------------------------------------------------------
No guarantee is given. Use at your own risk.

Patches the partition sizes of a lzma compressed uImage

Usage: just drag-and-drop uImage file onto the bat file.
(or batch-file.bat uImage-file)

Old partition size is shown and new can be given as hex
(prefix with 0x), decimal or in MiB (end with M).
Notice that not all size values are valid. Min. is 4M.

Orig. file is not touched. The patched file is put into
the same folder using ".patched" as the file extension.

The list of the partitions is on top of the batch file.
partitions=data,cache,system,boot,recovery,aml_logo,logo
Edit it if necessary.

Both boot and recovery must be patched similar way.
And possible custom recoveries used.

- cxz (slatedroid, freaktab), cxza (xda, 4pda)
Before (default stock)
cat /proc/mtd
dev: size erasesize name
mtd0: 00400000 00100000 "bootloader"
mtd1: 00800000 00400000 "logo"
mtd2: 00800000 00400000 "aml_logo"
mtd3: 00800000 00400000 "recovery"
mtd4: 00800000 00400000 "boot"
mtd5: 20000000 00400000 "system"
mtd6: 10000000 00400000 "cache"
mtd7: 40000000 00400000 "userdata"
mtd8: 18d000000 00400000 "NFTL_Part"

After (a bit overdone maybe)
cat /proc/mtd
dev: size erasesize name
mtd0: 00400000 00100000 "bootloader"
mtd1: 00400000 00400000 "logo"
mtd2: 00400000 00400000 "aml_logo"
mtd3: 00400000 00400000 "recovery"
mtd4: 00400000 00400000 "boot"
mtd5: 1a000000 00400000 "system"
mtd6: 04000000 00400000 "cache"
mtd7: c0000000 00400000 "userdata"
mtd8: 120000000 00400000 "NFTL_Part"

0_1ab77e_ef4edae5_L.png


Installing partition-resized uImages can be tricky, erasing the old settings
and partitions, making a custom update package etc. etc.
Therefore I made this package with instructions.
Read the Readme.txt file included (also below).

flashing-package-for-partition-resized-uImages_[cxz].zip
https://yadi.sk/d/G6qlXOHc3GBs85

******************************************************************
Flashing package for partition-resized uImages by cxz
http://cxzstuff.blogspot.com
******************************************************************

Installing partition-resized uImages
====================================

Contents of your microSD card's root
1. aml_autoscript (erases nand but skips the bootloader)
2. patched recovery named as uImage_recovery AND recovery.img (just in case)
(put above files to the /zt-update folder if having a Zenithink tablet)
3. update.zip (your firmware)
4. recovery.i2p (patched recovery for images2partitions)
5. boot.i2p (patched boot for images2partitions)
6. images2partitions_for_AML8726mx_external_[cxz].zip
(writes above two files to their partitions)
7. install-recovery.sh-fixer_[cxz].zip
(in stock firmwares install-recovery.sh restores the orig.recovery if changed)

Boot into the recovery mode.
aml_autoscript does its thing, restarts and then patched recovery starts.
Flash update.zip, images2partitions_for_AML8726mx_external_[cxz].zip
and if using stock also install-recovery.sh-fixer_[cxz].zip
Do the factory reset and wipe the media (internal storage).

If using patched custom recovery, restore instead of flashing the update.zip.
If your custom recovery is too big to be installed to recovery partition,
you can modify the environment, or just use patched stock as recovery.i2p file
- which might be a good idea anyway as you can always flash it later.
 
See less See more
1
#2 ·
I'll test this, can you tell me if your kernel uImage is Cortex A9 compiled? Would it be possible to fetch the boot partition and recovery partition mtd3 and mtd4 with dd and get recovery.img and boot.img and then modify their partitions layout, do this really work?

Regards.

Addition: Can you please upload your boot.img file where you have the partitions modified or where are you going to modify their partitions, I can't believe that compiled kernel can be modified, crazy. Need proof. Yeah.
 
#4 ·
-----------------------------------------------------
AML8726mx Partition Size Patcher by cxz (slatedroid)
-----------------------------------------------------
No guarantee is given. Use at your own risk.

Drücken Sie eine beliebige Taste . . .
-----------------------------------------------------
Checking the file
"C:\Dokumente und Einstellungen\amlogic\Desktop\amlogic\uImage"
-----------------------------------------------------
error: nat a valid uImage

-----------------------------------------------------
All done.
-----------------------------------------------------

Drücken Sie eine beliebige Taste . . . _

No given tool work for my boot or recovery images I also tried to use every image I got now, but nothing works

recovery: u-boot legacy uImage, Linux-3.0.8-ge9ca3e2, Linux/ARM, OS Kernel Image (lzma), 3787181 bytes, Sat Nov 24 05:37:57 2012, Load Address: 0x80008000, Entry Point: 0x80008000, Header CRC: 0x59698FEC, Data CRC: 0x11A6596C

As you can see these are uImage everyone is, but they don't work with your program. When I flash them to my tablet they get booted.

Regards

Amlogic
 
#5 · (Edited by Moderator)
There was a bug. Now corrected. The download address is the same.

edit: tested my unpacker-repacker in a virtual xp. Worked just fine.
(notice that the file system must be ntfs because cpio makes an invalid package on fat)
 
#7 ·
unpacker-repacker needs that ntfs this Partition Size Patcher doesn't.

I have them patched (2040M data) but how to install them easily.
The old partition layout might and most likely will cause troubles.

I'll try to make some "special" aml_autoscripts so that a bootable sdcard method does not have be used.
(if the device shows any life, i.e. is not hard bricked)
(That usb dumper package I'm planning has some scripts that should make things easier.
But again it's for Windows only.)

View attachment uImages_for_amlogic.zip
 

Attachments

#8 ·
Okay my windows xp installation have no ntfs partitions, I'll try the kernel today to see if this works (my device is not hard bricked I got it already to life back again).

It's possible that your tools didn't work cause of just a ntfs partitions omg.

I can't believe that compiled kernel images can be modified, didn't thought so
 
#9 · (Edited by Moderator)
It's possible that your tools didn't work cause of just a ntfs partitions omg.
It's a permissions related thing. Strangely I have some memory that
cpio has failed on ntfs too and using another folder helped. Also that
it has worked run from the USB stick which most likely was fat. But maybe
I'm mixing occasions. Anyway, one can always format an USB stick to ntfs...
 
#11 ·
@cxz your patched kernel "doesn't" work, at least there is the kernel splash screen dispkayed, nice hope we can cut the image closer and closer to find this picture. As you can see the both kernel images and the both recovery images are completely different. You will see that there is data located and there CRC and other adresses, but my tablet kernel doesn't support this feature.

Regards, you could break the nut and get this kernel modded pretty sure, letßs start with the image init.logo, I'll need to mod u-boot via seral console to net boot the kernel and don't waste my nand chip further, I'll create a net connected tablet. Hopefully
 
#12 ·
These nand flashes can be "hard to please".

Added a "Flashing package for partition-resized uImages" to the first post.

Nice that you got that serial working.
Net boot and all. I have no experience about those.
 
#13 · (Edited by Moderator)
It's possible that your tools didn't work cause of just a ntfs partitions omg.
Okay. Made an unpack-repack version for fat FS.
It's a lazy hack but it works. It now patches the cpio
archive making all files executable except the default.prop.
Download: https://yadi.sk/d/WW7x6OF43GFWwh
uImage_unpack-repack_batch+files_for_Windows-fat-version_[cxz].exe.7z
(to extract remove the 7z from the end and run)
 
#14 ·
Please @cxz I gave this unpacking stuff up, cause its not working for me in any way, I provided the kernel and the recoverywithkernel images, can you unpack them for me, please? And give me a link to the contents? I swear this wonßt work for my tablet, these kernel canßt get unpacked for some reason, and I assume it's cause the kernel images are precompiled. For you they seem nnot to be precompiled, your u-boot just takes them, u-boot is the only thing compiled. Might be

Please man I gave this part of unoacking already up, swear no unoacking possible.
 
#16 ·
Hi,

I compiled the kernel and it changed alot of times it's file type:

OBJCOPY arch/arm/boot/ccImage
Kernel: arch/arm/boot/ccImage is ready
Image arch/arm/boot/ccImage.lzma is ready
UIMAGE arch/arm/boot/uImage
Image Name: Linux-3.0.8
Created: Tue Mar 7 19:46:46 2017
Image Type: ARM Linux Kernel Image (lzma compressed)
Data Size: 2986712 Bytes = 2916.71 kB = 2.85 MB
Load Address: 80008000
Entry Point: 80008000
Image arch/arm/boot/uImage is ready

Here are the both images: https://www.dropbox.com/sh/jaswfm1vzwwwbxx/AAA2nAHZNTWQfGu74rbesiwKa?dl=0 what kind of file type are the both images, I assume uImage, correct? Can you do the uImages into izma packages back? And then into ccImage or so? Can you reverse this produce..? It would be really nice, because I'm out of my plan, and completely confused and shit is put on me right now, somehow. Idk

Thanks, sorry I'm kind stupid, but not pissed.
 
#17 · (Edited by Moderator)
Hello cxz,

I'm giving your mod for the partitions a new try, maybe it will work. I'm tied about U-Boot work, and want to see now for real if it's possible that my partition beginnings and endingsnarendefined bynthe kernel, these are mtdblocks so I think that they are.

I just want to hack my tablet by removing the NFTL_Part and put /storage/sdcard0 aka /dev/block/avnftli in the /data and get good solution for my original idea of hacking my device.

You know that cache, system, userdata, nftl_part are yaffs2 partitions? They have bad block management, does your partition patcher handles the new added blocks in one yaffs2 partition?

Is it possible to edit the partition names for you?

Regards.
 
#18 · (Edited by Moderator)
If I recall correctly my patcher modifies the partition sizes not directly their positions.

>by removing the NFTL_Part

by making other partitions big enough that partition will eventually vanish (size=0) and one can then for example

swap the internal and external - or whatever one chooses. I haven't tested all possibilities whether they will work or not.

>cache, system, userdata, nftl_part are yaffs2 partitions? They have bad block management,

>does your partition patcher handles the new added blocks in one yaffs2 partition?

I'm remembering that in my tablet <snip> (remembered wrong. below is its recovery.fstab, same as yours)

# mount point fstype device device2
/bootloader mtd bootloader
/logo mtd logo
/aml_logo mtd aml_logo
/recovery mtd recovery
/boot mtd boot
/system ubifs system
/cache yaffs2 cache
/data ubifs userdata
/sdcard vfat /dev/block/mmcblk0p# /dev/block/cardblksd#
/media vfat /dev/block/avnftl8p1 /dev/block/avnftli1
 
This is an older thread, you may not receive a response, and could be reviving an old thread. Please consider creating a new thread.
Top