Jump to content


Photo

[tool] AML8726mx Partition Size Patcher by cxz


  • Please log in to reply
15 replies to this topic

#1 cxz

cxz

    Advanced Member

  • Moderator
  • PipPipPip
  • 1,091 posts

Posted 18 March 2017 - 12:02 PM

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.


Edited by cxz, 20 March 2017 - 04:48 PM.


#2 amlogic8726

amlogic8726

    Advanced Member

  • Jr. Member
  • PipPipPip
  • 58 posts
  • LocationGerman

Posted 18 March 2017 - 06:52 PM

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.

#3 amlogic8726

amlogic8726

    Advanced Member

  • Jr. Member
  • PipPipPip
  • 58 posts
  • LocationGerman

Posted 19 March 2017 - 04:24 AM

Hello @cxz I can't modify mines I have provided them here: https://www.dropbox....9h97y7l0ya?dl=0
Do your tool work with this recovery.img and boot.img, for me it's not working for some reason. I did everything provided by your manual doesn't work for windows xp I have only xp here.

#4 amlogic8726

amlogic8726

    Advanced Member

  • Jr. Member
  • PipPipPip
  • 58 posts
  • LocationGerman

Posted 19 March 2017 - 04:52 AM

-----------------------------------------------------
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 cxz

cxz

    Advanced Member

  • Moderator
  • PipPipPip
  • 1,091 posts

Posted 19 March 2017 - 06:28 AM

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)

Edited by cxz, 19 March 2017 - 06:59 AM.


#6 amlogic8726

amlogic8726

    Advanced Member

  • Jr. Member
  • PipPipPip
  • 58 posts
  • LocationGerman

Posted 19 March 2017 - 11:32 AM

I do not have ntfs, :( cxz can you please try to modify my provided files? I swear this doesn't work. You wouldn't get the compiled files modded. I'm pretty sure, or are your recovery and boot image also compiled?

#7 cxz

cxz

    Advanced Member

  • Moderator
  • PipPipPip
  • 1,091 posts

Posted 19 March 2017 - 02:33 PM

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.)

Attached File  uImages_for_amlogic.zip   7.23MB   2 downloads

#8 amlogic8726

amlogic8726

    Advanced Member

  • Jr. Member
  • PipPipPip
  • 58 posts
  • LocationGerman

Posted 19 March 2017 - 11:37 PM

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 cxz

cxz

    Advanced Member

  • Moderator
  • PipPipPip
  • 1,091 posts

Posted 20 March 2017 - 12:36 AM

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...


Edited by cxz, 22 March 2017 - 09:06 AM.


#10 amlogic8726

amlogic8726

    Advanced Member

  • Jr. Member
  • PipPipPip
  • 58 posts
  • LocationGerman

Posted 20 March 2017 - 10:41 AM

Hi

I solder serial console on and the important - volume three tx rx and gnd for my serial console no gnd, when you tun it on without battery or supply which isn't possible you need vcc with 5v for me

I'm happy, I'll test kernel now patched

#11 amlogic8726

amlogic8726

    Advanced Member

  • Jr. Member
  • PipPipPip
  • 58 posts
  • LocationGerman

Posted 20 March 2017 - 03:20 PM

@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 cxz

cxz

    Advanced Member

  • Moderator
  • PipPipPip
  • 1,091 posts

Posted 20 March 2017 - 04:44 PM

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 cxz

cxz

    Advanced Member

  • Moderator
  • PipPipPip
  • 1,091 posts

Posted 22 March 2017 - 10:35 AM

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)

Edited by cxz, 23 March 2017 - 08:00 AM.


#14 amlogic8726

amlogic8726

    Advanced Member

  • Jr. Member
  • PipPipPip
  • 58 posts
  • LocationGerman

Posted 28 March 2017 - 02:32 PM

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.

#15 cxz

cxz

    Advanced Member

  • Moderator
  • PipPipPip
  • 1,091 posts

Posted 28 March 2017 - 03:29 PM

The scripts just un-lzma the image and and unpack cpio.
Maybe you a after something else...?
https://yadi.sk/d/m0eHCi6n3GS7v2

#16 amlogic8726

amlogic8726

    Advanced Member

  • Jr. Member
  • PipPipPip
  • 58 posts
  • LocationGerman

Posted 29 March 2017 - 09:48 AM

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....74rbesiwKa?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 *oops is put on me right now, somehow. Idk

Thanks, sorry I'm kind stupid, but not pissed.