I've unfortunately become something of a serial reflasher and I'm loathe to constantly reinstall hotfixes, and community codec packs, set up my desktop and menus etc every time I reflash. Is there any way I can back up the current status of my NAND into a new rootfs.img file that I can put on my reflash SD card so that I'll always have a ready-to go system after reflashing?
This looks possible by doing crazy stuff with the ubifs tools... by literally taking a running system and squishing it back into a rootfs.img for flashing purposes.
Looks scary as sin to do, though!
Though I haven't figured out a way of even opening the existing rootfs.img on my PC yet ( haven't really spent much time looking at it ) so there may be a safer way of doing it that way.. would be less fun though
I guess the best would be if the current Firmware reflasher could be extended into a general-purpose nand-flashing and dumping tool.
Basically your boot from SD Card, and it offers you a Menu along the lines of:
Code:
-----------------------
Pandora NAND Utils
-----------------------
->dump NAND to file
flash file to NAND
reboot
shutdown
** WARNING ** I COULD BE TALKING OUT MY ARSE HERE SO DON'T ATTEMPT THE FOLLOWING UNLESS YOU'RE FEELING BRAVE! ** WARNING **
By the looks of things, you'll need mkfs-ubifs from the Angstrom repository.
You'll then need to do something like: sudo mkfs.ubifs -r / -m 4096 -e 516096 -c 4095 -o /root.ubifs
You might want to not have anything mounted when you do that, however.. and I'm not sure if it'll be smart enough to ignore it's own file. If not, you'll have to do some sneaky binds to a separate folder, and ignore/blank out the stuff you don't want to copy over.
You'll then want to run: ubinize -o rootfs.img -m 4096 -p 512KiB ubinize.cfg
Where ubinize.cfg is something like:
[rootfs]
# Volume mode (other option is static)
mode=ubi
# Source image
image=root.ubifs
# Volume ID in UBI image
vol_id=0
# Allow for dynamic resize
vol_type=dynamic
# Volume name
vol_name=rootfs
# Autoresize volume at first mount
vol_flags=autoresize
Then you should have a rootfs.img that _might_ work.
I have NOT tested this, but from what I've read from the ubifs docs, this seems to be about right.
The Pandora may expect different block sizes and things, I'm not sure as I haven't looked further into it yet. This might start you off though, that and looking over the information on building the rootfs from scratch to ensure the ubifs format is correct.
You'll want to look over here anyway: http://www.linux-mtd.infradead.org/doc/ubifs.html and here wouldn't hurt either: http://blogs.distant-earth.com/wp/?p=90
I've still got MilkyTracker to fix before I look at anything else ( I now at least have ddd running to track down the bugger! ) but if there's been no progress made by the time I have that done, I'll have a further poke around. I seem to be doing the more ludicrous hacks at the moment
/dev/mtd0-3 = boot images/etc, you don't need.. they come with the flash utility
/dev/mtd4 = your rootfs files, and the flash utility will use this file to reflash mtd4, granted you replace the old rootfs.img file with the one created by nanddump.
/dev/mtd0-3 = boot images/etc, you don't need.. they come with the flash utility
/dev/mtd4 = your rootfs files, and the flash utility will use this file to reflash mtd4, granted you replace the old rootfs.img file with the one created by nanddump.
Wow, that doesn't sound anywhere near as painful as I thought it was going to be ( didn't realise there was a nanddump program actually ON the Pandora.. I was going round the hard way, knowing that the filesystem is UbiFS so figuring out how to create one of them! )
Glad someone who actually knew what they were up to stepped in I could've ended up going all over the place instead!
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.