Originally submitted by member 'Cyberrmate-123' (based in Kolkata) in XDA forum on 4th June 2013.
All I have done is correct spelling and “flesh out” the explanation.
This is NOT a “step by step for dummies” guide. It presumes you know about adb and where to find it. Similarly it presumes you are already familiar with a unpack/repack utility in your favourite OS (Windows or Linux).
But, if like me, you have reasonable skills and have spent an inordinate amount of time simply trying to recover from the situation where the Uberizer doesn't recover your backup AND you already took a 'dd'/'cat' backup of every damn 'nand' partition you could find........... then you may find the following useful.
Note for User2247823
U said u can adb. So stick a uSD card in and
mount the uSD
Change to the mounted folder n
cat /dev/block/nanda >nanda. (This is bootloader with script.bin,etc)
cat /dev/block/nandb >nandb. (This is env for uboot, save fir completeness)
cat /dev/block/nandc >nandc. (This is boot partition with kernel & init.sun?.rc files)
cat /dev/block/nandd >nandd. (This is system with vendor specific driver modules)
cat /dev/block/nandg >nandg. (This is recovery)
Unmount the sd card and clone those files. With them you'll be able to recreate an identical working copy of the stock rom that your supplier never gave you.
Hi all, some allwinner device users find themselves having a clone /backup of their tablet but without the manufacturers stock ROM image (or can't find a download) in case a custom ROM fails.
Here is how to save yourself.
Download any clones stock ROM. ( There are some limitations here – common sense prevails – if you have an A10 tablet then it has to be an A10 ROM if you are on ICS – then it has to be an ICS ROM. MUST BE A LIVESUIT IMAGE (most are)
SAVE ORIGINAL ROM **
Now install and setup adb and pull your whole tablets internals out.
By using commands like 'adb pull system system'. It will make a directory called system and pull your system partition into it.
Now for the bootloader and bootable kernel (and it's ramdisk) we use 'cat' to read nand partitions 'nandc' and 'nanda'.
Su -c "cat dev/block/nanda > sdcard/bootloader.img"
Su -c "cat dev/block/nandc > sdcard/boot.img".
*NOW WE CHANGE THE VANILLA ROM TO YOUR VERSION *
Now with any rom un/packing utility (i use image repacker xda forum) unpack the clone image.
Replace the boot and bootloader files inside the unpacked livesuit img and change extension to .fex (if your packing program has an 'iso' folder change there as well)
(Davemusic prefers to copy nandd to system.fex and nandg to recovery.fex plus the boot and bootloader as specified above)
Now repack and flash. If it works immediately then that's cool. Else use adb to push modules from your system folder to the rom your running. Also push the 'etc' folder to 'system/etc' and push the 'hw' folder in 'lib/hw' to 'system/lib/hw'. Now reboot. It will work.
Davemusic had problems with the following because the tool "repack-bootimage.pl" was incorrect. The line that does the mkbootimage should read
system ("mkbootimg --cmdline 'console=ttyS0, 115200 rw init=/init loglevel=5' --base 0x40000000 --kernel $ARGV --ramdisk ramdisk-repack.cpio.gz -o $ARGV");
it's one long line....that wraps in this post.
But, after modding that command I was able to use it and create my livesuit image.
* NEXT IS ONLY IF YOU WANT TO CREATE YOUR OWN MODIFIED IMAGE *
Now for a permanent solution. Use sunxi tools in ubuntu or any linux to 1st make the system.fex of the clone ROM to a system.fex file using SIM2IMG.
Now mount it by using 'sudo mount -o loop system.img '
Now in linux you should type 'sudo nautilus' to open the gui file browser in superuser mode. (It makes changing files a bit easier).
Now from your backed up system folder, copy the contents of 'vendor/modules', 'lib/hw' and 'etc' to the mounted directory. (If this seems a little strange – remember that the target directory is /system. But, your backup is relative to that. IE the '/system' prefix disappears. So; '/system/etc' became simply 'etc' and '/system/lib/hw' became 'lib/hw')
Then use 'make_ext4fs' to make a sparse fex file like this;
'make_ext4fs -s -l 500M -a system system newsystem.fex' .
It will create newsystem.fex. Copy it back to your unpacked rom. Replace it. Pack. Flash.
Now you have “almost” got your stock rom running. (NOT identical yet because you havent changed the apps,do it if you want).
If you want you can make the ext4fs directly into your backed up system folder. (change the target path of 'newsystem.fex'in the make_ext4fs command to include your system backup folder)
Copy the new fex file back. Repack. flash. It will bring your true stock rom back. On some livesuit images it corrupts the the “disk fileystem” so the internal sd doesnt mount. (like in eken T01A's ROM)
If so - then do the following. Open adb shell. then list /dev/block/nand? The last nand partition is your sdcard.
There are either 9,10 or 11 nand partitions named nanda through nandi (or nandj or nandk)
Whichever is the last - format it by using the appropriate one of the following commands;
busybox mkfs.vat /dev/block/nandi void'
busybox mkfs.vat /dev/block/nandj void'
'busybox mkfs.vat /dev/block/nandk void'
Then you will be able to get it mounted.
Now u can hav peace of mind while flashing custom ROMs. Enjoy.
It MAY be that you have no entries at all for 'nand' in /dev/block. This can occur if you have the wrong version of the nand.ko module in the root directory.
Sorry but, fixing that issue is beyond the scope of this tutorial.