Reply
Thread Tools
Posts: 2,152 | Thanked: 1,490 times | Joined on Jan 2006 @ Czech Republic
#31
Originally Posted by tolou View Post
Thanks,
and will I be able to reflash the internal rootfs from a mmc booted OS, using this 'flasher -f -r rootfs.jffs2' ?
Yes, but not via flasher. You need to use mtd-utils. I did it few times. There is no simple way but you can use tools from initfs flasher. This is what I do:

When I like current stable system in flash (after clean reflashing and tweaking it a bit) I boot from mmc and do a backup

Code:
mount -t jffs2 /dev/mtdblock4 /opt
./mkfs.jffs2 -r /opt -o /media/mmc1/rootfs.jffs2 -e 128 -l -n
umount /opt
There is also optional sumtool command that optimizes the image a bit for faster mounting.

Code:
sumtool -i rootfs.jffs2 -o rootfs.faster.jffs2  -e 128KiB -l -n
then when I want to restore system in flash I boot from mmc and do

Code:
./flash_eraseall -j /dev/mtd4
./nandwrite -a -p /dev/mtd4 /media/mmc1/rootfs.jffs2
Be sure to use correct device name (/dev/mtd4 for rootfs) and never ever use -j option of nandwrite. Also never ever erase or flash /dev/mtd1 or mtd0. By doing this you can seriously screw your device to the point that reflashing will not help you (and won't be posible at all).
 

The Following 8 Users Say Thank You to fanoush For This Useful Post:
Posts: 152 | Thanked: 6 times | Joined on Dec 2006
#32
Originally Posted by fanoush View Post
never ever use -j option of nandwrite.
Isn't that the reason why we dualboot and primary use sd/mmc for rootfs. If it's removable then it's replacable. If my nandflash died, then I'm totally screw. Cuz, by the time the flash died, the unit probably out of warranty.
 
Posts: 2,152 | Thanked: 1,490 times | Joined on Jan 2006 @ Czech Republic
#33
Originally Posted by freeman View Post
Isn't that the reason why we dualboot and primary use sd/mmc for rootfs. If it's removable then it's replacable. If my nandflash died, then I'm totally screw.
Yes, touching the internal flash when you don't know exactly what you do is dangerous. Using nandwrite -j by mistake is recoverable but not easy (special hacked kernel, special flash_eraseall) http://www.gossamer-threads.com/list...rs/10530#10530
Reflashing config or bootloader partition may be unrecoverable. I should probably comment out -j option in nandwrite source and rebuild the binary sometimes since it is quite useless but very dangerous on nokia tablets.

As for normal writing to the internal flash I wouldn't be so afraid. It would take some time to wear out internal flash. See end of https://maemo.org/bugzilla/show_bug.cgi?id=598
 
tolou's Avatar
Posts: 87 | Thanked: 1 time | Joined on Mar 2006
#34
Originally Posted by fanoush View Post
Yes, but not via flasher. You need to use mtd-utils. I did it few times. There is no simple way but you can use tools from initfs flasher.
Canīt I just do what I did to make the mmc OS installation, but reversed? I.e the GNUtar extraction back into the jffs2 partition? That would be simple enough, I think. After having made the flash_eraseall, that is.
 
Posts: 2,152 | Thanked: 1,490 times | Joined on Jan 2006 @ Czech Republic
#35
Originally Posted by tolou View Post
Canīt I just do what I did to make the mmc OS installation, but reversed? I.e the GNUtar extraction back into the jffs2 partition? That would be simple enough, I think. After having made the flash_eraseall, that is.
Well, yes, but mkfs.jffs2 is there for some reason. I guess the reasons are
- speed (both of creating the filesystem and later also accessing it)
- flash wear

While I don't know it for sure I think that when created incrementally by tar (i.e extracting file by file) the result won't be as nice and compact as creating it via mkfs.jffs2 (and sumtool) in one go and then flashing. I also guess it will take ages but never actually tried.
 
Posts: 3,401 | Thanked: 1,255 times | Joined on Nov 2005 @ London, UK
#36
Fanoush - do you know if it's possible to create a bootable filesystem on MMC/SD direct from a FIASCO image, ie. rather than install the FIASCO image into the device and tar over to the MMC/SD card is it possible to dump the FIASCO image on to the MMC/SD card and then boot it? This would be great to test new firmware without having to blow away a working device.
 

The Following User Says Thank You to Milhouse For This Useful Post:
penguinbait's Avatar
Posts: 3,096 | Thanked: 1,525 times | Joined on Jan 2006 @ Michigan, USA
#37
without compression would it even fit on the flash device?

I see no reason to even bother, if I was worried about needing more space, I would not have moved in off flash in the first place. I moved onto flash for backup/recovery/portability/speed. booting to flash will allow you to remove packages from mmc OS easily. install a package thats bad (system wont boot), boot to flash and remove it. edit a file and mess up the boot process, boot to flash and fix it, these are GREAT advantages over default OS distribution.

I personally think they should put a minimal OS in flash (with install/recovery/remote backup/) and use itself to download, upgrade and push OS onto a MMC/SD card. But I guess I am just dreaming...

Seriously though, HOW MANY REPAIRS WOULD THIS SAVE NOKIA!!!!! Does it work in flash, well then run diagnostics or restore remote backup.

Last edited by penguinbait; 2007-02-05 at 16:52.
 
Posts: 2,152 | Thanked: 1,490 times | Joined on Jan 2006 @ Czech Republic
#38
Originally Posted by Milhouse View Post
Fanoush - do you know if it's possible to create a bootable filesystem on MMC/SD direct from a FIASCO image, ie. rather than install the FIASCO image into the device and tar over to the MMC/SD card is it possible to dump the FIASCO image on to the MMC/SD card and then boot it?
No, in current system you need to flash at least initfs and kernel to boot newer firmware completely. Newer kernel and initfs may (or may not, depends on specific version) make older rootfs in flash not booting. Not talking about flashing bootloader of course which is sometimes updated too and currently cannot be flashed from device.

What may be possible is to replace kernel and initfs in flash with some generic stubs and keep real kernel and initfs on mmc so we can have more of them. This is quite tricky but maybe possible. Maybe it would be even needed to dualboot between os2007 hacker edition and IT2006 so I will be forced to try to make it working :-)
 
penguinbait's Avatar
Posts: 3,096 | Thanked: 1,525 times | Joined on Jan 2006 @ Michigan, USA
#39
Is it as simple as changing the root_dev info? (init and linuxrc)

If I created a partition on mmc for kernel, it seems like it would work, is there something I am not thinking of?

root_dev=mtdblock4
root_dev_name="Flash"
root_fstype="jffs2"
root_fsoptions="rpsize=1024,rpuid=0,rpuid=30000"

You got anything you want to try, you just let me know


EDIT
Now that I think about that, mtdblock4 is rootfs right, so would you need to put something on the kernel device to redirect it, or you need to hack the xloader?

Last edited by penguinbait; 2007-02-05 at 17:05.
 
Posts: 152 | Thanked: 6 times | Joined on Dec 2006
#40
Originally Posted by fanoush View Post
No, in current system you need to flash at least initfs and kernel to boot newer firmware completely. Newer kernel and initfs may (or may not, depends on specific version) make older rootfs in flash not booting. Not talking about flashing bootloader of course which is sometimes updated too and currently cannot be flashed from device.

What may be possible is to replace kernel and initfs in flash with some generic stubs and keep real kernel and initfs on mmc so we can have more of them. This is quite tricky but maybe possible. Maybe it would be even needed to dualboot between os2007 hacker edition and IT2006 so I will be forced to try to make it working :-)
And when you say in current system, you meant both the 770 and N800 and the way they were design for now right. Cuz, when I upgrade the kernel on my N800, the only way I could upload the kernel is to use 'flasher-3.0 -k'.
The way I see it right now is that the flash have 5 sections, aka 5 partition.
blk0=128KB
blk1=385KB
blk2=2MB
blk3=2MB
blk4=the rest=rootfs

For obvious reason, It's safe to assume that blk0 is a loader and blk4 is the rootfs
blk3 seem to be initfs in the jffs2 format.
so, blk2 is the only one left large enought to fit the kernel. (I don't think nokia want to store kernel on a compressed partition) and therefore mean, if you make your own kernel, it has to be less than 2MB(there may be some overhead there as well.) blk1 then probably a special kernel used for usb flasher. and that mean leave those 2 alone(block0 and 1) if you don't want your $400 toy to be an expensive paperweight.
 
Reply

Thread Tools

 
Forum Jump


All times are GMT. The time now is 06:03.