PDA

View Full Version : Booting from MMC on N800 Now Available!!


Pages : [1] 2

penguinbait
01-14-2007, 04:46 PM
- Packages will follow soon by Fanoush

I booted in 35 seconds from flash, 27 seconds from mmc)
I was lucky enough to be able to beta test for Fanoush. Which I might add he got it right the first time without an issue. I never had to reflash.

Thanks Fanoush, he said he is updating Bootmenu.deb to support n800, in the mean time, if you just can not wait.


Download and install this

http://maemo.org/pipermail/maemo-developers/2007-January/007111.html

run
initfs_flash

Reboot, it will boot from flash.

vi /mnt/initfs/bootmenu.sh

Change the line
GETKEY="evkey -u -t 1000 /dev/input/event1"
to
GETKEY="evkey -u -t 1000 /dev/input/event2"

RUN
chroot /mnt/initfs cal-tool --set-root-device ask:mmc2


Note The internal mmc is /dev/mmcblk0

/dev/mmcblk0p1 (This is fat)
/dev/mmcblk0p2 (This is ext2 n800 boot)
/dev/mmcblk0p3 (This is my 64mb swap)

The external mmc is /dev/mmcblk1

Make sure you are pointing at the right one for your partition.

I did not cover any partition information, you will need to partition your mmc in order to do this.

The following is cut and paste from:
http://maemo.org/maemowiki/HowTo_BootRootFSFromMMC

( I used tar, I could not find a way to install it on n800, so I copied tar from my 770. I posted a copy on my website)

http://penguinbait.com/tar

Cloning existing rootfs
First you need to backup your FAT partition on MMC card and repartition it to have at least two partitions. First partition as FAT, second one as ext2. You can use fdisk on linux PC and USB card reader to do this (is there fdisk compiled for N770?). As the jffs2 flash filesystem uses compression you need bigger partition on MMC to hold same data. 128MB is too small, at least 256MB is recommended to have similar space as with original flash rootfs.

If you have second partition on MMC card prepared, you can clone you existing IT2006 installation with rsync.

1. Format and mount partition on n770:

You need e2fsprogs (available in maemo2.0 repository)

Nokia770-26:~# apt-get install e2fsprogs
Nokia770-26:~# mkfs.ext2 /dev/mmcblk0p2
Nokia770-26:~# insmod /mnt/initfs/lib/modules/current/ext2.ko
Nokia770-26:~# mount /dev/mmcblk0p2 /opt/
2. Remount flash rootfs to different directory to reveal hidden /dev/ entries:

Nokia770-26:~# mount -t jffs2 /dev/mtdblock4 /floppy -o rw,rpsize=1024,rpuid=0,rpuid=30000
3. Make sure both mount commands succeeded and you really have /opt and /floppy mounted to correct places ('Filesystem' and 'Mounted on' columns below).

Nokia770-26:~# df
Filesystem 1k-blocks Used Available Use% Mounted on
....
....
/dev/mtdblock4 ....... /floppy
/dev/mmcblk0p2 ....... /opt

4. Clone it to card by rsync or tar. Do not swap /floppy and /opt by mistake.

Nokia770-26:~# rsync -avH --delete /floppy/ /opt/
There is some issue with opera fonts caused by such copy made by rsync - details here or here. If you want to make extra sure your copy on mmc card does not have this issue, use GNU tar (not the busybox one) not rsync. Get the binary either from scratchbox arm target (/bin/tar) or by apt-get on the device in download only mode (apt-get -d install tar) After ignoring warnings tar deb should be in /var/cache/apt/archives and you can extract it by dpkg -x. Then you can make the clone by

/path/to/gnu/tar cf - -C /floppy . | /path/to/gnu/tar xvf - -C /opt
5. Cleanup

Nokia770-26:~# umount /opt
Nokia770-26:~# umount /floppy


REBOOT


THANKS AGAIN FANOUSH, I REALLY APPRECIATE IT!!!:D :D

penguinbait
01-14-2007, 04:49 PM
He is quicker than I could even post :-) Here is the new package!!

http://www.internettablettalk.com/forums/showthread.php?t=4052&goto=newpost

flareup
01-14-2007, 08:28 PM
excuse my ignorance but why would you want to boot from flash?

penguinbait
01-14-2007, 09:00 PM
excuse my ignorance but why would you want to boot from flash?

The reason I like to boot from flash for a couple of reasons. I can completely backup my entire OS and restore it or any peice of it. I run from mmc which runs faster than from flash. I can use flash as a failsafe in case I screw up my OS. Its already saved me from reflashing my n800 today. I can boot from mulitple mmc or SD cards.


http://www.internettablettalk.com/forums/showthread.php?t=4061&goto=newpost

bobpaul
02-01-2007, 01:07 AM
I'm having trouble mounting my ext2 partition. In particular, I can't insert the module.

/mnt/initfs/lib/modules # ls -l
drwxr-xr-x 2 root root 0 Dec 19 10:56 2.6.18-omap1
lrwxrwxrwx 1 root root 25 Dec 19 10:56 current -> /lib/modules/2.6.18-omap1
so current won't work as a path, so I use the 2.6.18 one instead

/mnt/initfs/lib/modules/2.6.18-omap1 # insmod /mnt/initfs/lib/modules/2.6.18-omap1/ext2.ko
insmod: cannot insert `/mnt/initfs/lib/modules/2.6.18-omap1/ext2.ko': Unknown symbol in module (-1): No such file or directory
Obviously, the mount command fails without the module:
# mount -t ext2 /dev/mmcblk1p2 /opt
mount: Mounting /dev/mmcblk1p2 on /opt failed: No such device
# mount /dev/mmcblk1p2 /mnt
mount: Mounting /dev/mmcblk1p2 on /mnt failed: Invalid argument

Suggestions?

sebastian.linux
02-01-2007, 01:16 AM
Have you tried:

# insmod /mnt/initfs/lib/modules/current/ext2.ko

bobpaul
02-01-2007, 01:36 AM
# insmod /mnt/initfs/lib/modules/current/ext2.ko
insmod: cannot open module `/mnt/initfs/lib/modules/current/ext2.ko': No such file or directory

yes. current is a symlink to someplace that doesn't exist.

rcull
02-01-2007, 02:54 AM
bobpaul.
You need to insmod mbcache.ko first on th N800

TA-t3
02-01-2007, 05:58 AM
Does anyone know why modprobe isn't used for loading modules?
modprobe (the normal Linux way) would handle such kernel module dependencies so that you wouldn't have to worry about loading mbcache.ko before ext2.ko etc. modprobe currently just says 'could not parse modules.dep', could it be that the kernel builders haven't done 'depmod -a' or similar? Maybe some of you who have actually (re-)built the kernel are up to date on this?

bobpaul
02-01-2007, 11:22 AM
Thanks rcull. Worked.

freeman
02-02-2007, 03:17 PM
well, I got it all kinda work out. I got it successfully clone out the data, reboot, and in the UI from the mmcblk0p2(ext2), but it keep rebooting, while if I choose to boot from flash it is working fine. I even add one step into the instruction, which is to run sync after tar to ensure I don't try to reboot too early and kill whatever didn't finish writing to SD. I tried it twice, same problem. second time started w/ mkfs.ext2 step. Any pointer?

Arch
02-02-2007, 03:20 PM
Hi Guys

The noob here again, please can someone tell me where I can get e2fsprogs
as I have searched all day and cannot find where it is. Thx in advance for all of your support.

Arch

Milhouse
02-02-2007, 03:45 PM
Tip: Search (http://www.internettablettalk.com/forums/search.php) is good.

http://www.internettablettalk.com/forums/showthread.php?highlight=e2fsprogs&p=23844#post23844

:)

fanoush
02-02-2007, 04:23 PM
well, I got it all kinda work out. I got it successfully clone out the data, reboot, and in the UI from the mmcblk0p2(ext2), but it keep rebooting, while if I choose to boot from flash it is working fine.
If you used tar for cloning, make sure GNU tar was really executed, not busybox tar. busybox tar has path limited to 100 chars so not everything is copied. Then it reboots like this. Just run tar with same path without arguments to see which tar it is or run it without -v and check for error messages about 100 character path limit.

I even add one step into the instruction, which is to run sync after tar to ensure I don't try to reboot too early and kill whatever didn't finish writing to SD. critical is to unmount before rebooting, then sync is not needed. sync without unmounting helps a bit but is not ideal at all.

Arch
02-02-2007, 09:34 PM
Tip: Search (http://www.internettablettalk.com/forums/search.php) is good.

http://www.internettablettalk.com/forums/showthread.php?highlight=e2fsprogs&p=23844#post23844

:)

My apologise I thought it was something that needed to be downloaded and installed, instead it is on the system just needed to be installed. Thx for your help and I will search harder next time, probably impatience on my part.

Regards

Arch

Milhouse
02-02-2007, 10:19 PM
You do need to download it, apt-get will download the package then install it for you. I can't remember which repository it's in, but if apt-get can't find it add the following:

Name: Maemo Main
Web Address: http://repository.maemo.org
Distribution: bora
Components: free non-free

Then run "apt-get update" followed by "apt-get install e2fsprogs"

freeman
02-03-2007, 01:50 AM
If you used tar for cloning, make sure GNU tar was really executed, not busybox tar. busybox tar has path limited to 100 chars so not everything is copied. Then it reboots like this. Just run tar with same path without arguments to see which tar it is or run it without -v and check for error messages about 100 character path limit.
critical is to unmount before rebooting, then sync is not needed. sync without unmounting helps a bit but is not ideal at all.

No wonder, I think that deserve to be in the instruction as well.

mrp
02-04-2007, 11:42 AM
am I supposed to get more free memory available by booting from mmc? If yes, where can I verify that?
I have an 490mb ext2 and booting from mmc

sebastian.linux
02-04-2007, 05:46 PM
am I supposed to get more free memory available by booting from mmc? If yes, where can I verify that?
I have an 490mb ext2 and booting from mmc

Just type free at the xterm.

penguinbait
02-04-2007, 06:25 PM
I do not believe booting from mmc will provide you more useable memory. You can create swap partitions or swap files that will give you additional memory resources.

sebastian.linux
02-04-2007, 07:31 PM
I do not believe booting from mmc will provide you more useable memory. You can create swap partitions or swap files that will give you additional memory resources.

Sorry, it was my fault. It doesn't provide you with extra "RAM". I mean, if you type free, you get:

$ free
total used free shared buffer
Mem: 62224 53316 8908 0 248
Swap: 0 0 0
Total: 62224 53316 8908

But YES, you've get extra "installable" memory. That is: the system thinks your mmc available free space is internal memory free space. So that you may install lots of applications there. So you type df (in my 770), and get:

$ df
Filesystem 1k-blocks Used Available Use% Mounted on
/dev/mmcblk0p2 729672 231216 461392 33% /
/dev/mmcblk0p1 261868 12 261856 0% /media/mmc1

As you may see, I've got two partitions. My first vfat partition (mmcblk0p1) is mounted as /media/mmc1. It's almost empty. I haven't enabled the Swap file over vfat, since I find it rather slow (just my feeling, maybe wrong).

My second partition is ext2 (mmcblk0p2), and it's mounted as /
As you may see, I've yet installed 225MB of applications but got space for 450MB more (more or less 140MB was the original system and basic applications; it doubles the 70 MB you usually find at your original native partition because ext2 isn't compressed as jffs2 is)

freeman
02-04-2007, 08:14 PM
Yea, that funny, the SWAP partition is not on by default. I even added
/dev/mmcblk0p3 swap swap defaults 0 0
to /etc/fstab
still swap not on by when reboot
Still you could run 'swapon /dev/mmcblk0p3' to manually activate the swap partition(assuming your swap partition is on partition3) or write a small script to activate it in the /etc/rc2.d or init.d and link to it.
Another important thing is after doing this mod, the usb-to-mmc no longer work. As a workaround, I just setup the samba so my windows can have access to /media/mmc1 and /media/mmc2 as well.

freeman
02-04-2007, 08:50 PM
I wrote a tiny script /etc/init.d/swappart to have it activate swap partition at startup, all you have to do is change the string 'SWAPX=' to your swap partition.
and run the command 'ln -s ../init.d/swappart S19swappart' in your /etc/rc2.d directory. hope that help, BTW, the legal jumble is here. I assume no liability or responsibility in anyway by posting this POS, and use it at your own risk.


#!/bin/sh
# workaround an issue with mounting swap partition at startup

SWAPX='/dev/mmcblk0p3'

case "$1" in
start)
swapon $SWAPX
;;
stop)
swapoff $SWAPX
;;
restart
swapoff $SWAPX
swapon $SWAPX
;;
reload|force-reload)
echo "$0: not implemented"
;;
*)
;;
esac

sebastian.linux
02-04-2007, 08:50 PM
Yea, that funny, the SWAP partition is not on by default. I even added
/dev/mmcblk0p3 swap swap defaults 0 0
to /etc/fstab
still swap not on by when reboot
Still you could run 'swapon /dev/mmcblk0p3' to manually activate the swap partition(assuming your swap partition is on partition3) or write a small script to activate it in the /etc/rc2.d or init.d and link to it.
Another important thing is after doing this mod, the usb-to-mmc no longer work. As a workaround, I just setup the samba so my windows can have access to /media/mmc1 and /media/mmc2 as well.

If you want to use a Swap file, it's better and easier to set it at:
TOOLS > CONTROL PANEL > MEMORY > VIRTUAL > and tick Add Virtual Memory
The maximum size of it is 64MB, no matter how much free space you've got on your VFAT partition. (Because virtual memory added this way CAN ONLY BE SET at the VFAT partition as a SWAP FILE). The advantages of doing so is that you'll be able to access via Windows and USB your VFAT partition. There you'll find the Swap file of 64MB. :cool:

freeman
02-04-2007, 09:24 PM
I do not believe booting from mmc will provide you more useable memory. You can create swap partitions or swap files that will give you additional memory resources.

This is quite hard to answer. but let me try this, Well even though it's exact use more memory in when booting from flash, but the rootfs stored in the flash is in jffs2 and in order for the data to be usable, it got to be uncompressed first, right, so where is that uncompressed data stored? While I'm there at the flash issue, let me answer this as well, the main reason why the system is slow when booted from flash because, all the application(not data stored on SD/MMC) are pretty much in compressed format. The CPU is already underpower at 300MHz already, and now it have to do compression/decompression on the fly, it's another step for the CPU to handle.

freeman
02-04-2007, 09:32 PM
If you want to use a Swap file, it's better and easier to set it at:
TOOLS > CONTROL PANEL > MEMORY > VIRTUAL > and tick Add Virtual Memory
The maximum size of it is 64MB, no matter how much free space you've got on your VFAT partition. (Because virtual memory added this way CAN ONLY BE SET at the VFAT partition as a SWAP FILE). The advantages of doing so is that you'll be able to access via Windows and USB your VFAT partition. There you'll find the Swap file of 64MB. :cool:

The disadvantage is that the swap file on the vfat is/probably limited by the UI, which has the ceiling of 128MB for N800 and 64MB for 770. And I'm not sure how the swap file is handle, but I have no way to check how much was used and how much is left.

fanoush
02-05-2007, 04:53 AM
This is quite hard to answer. but let me try this, Well even though it's exact use more memory in when booting from flash, but the rootfs stored in the flash is in jffs2 and in order for the data to be usable, it got to be uncompressed first, right, so where is that uncompressed data stored?

Well jffs2 is probably optimized for embedded use so I guess it does not take much ram. Maybe it is even optimized for size, not speed :-)

the main reason why the system is slow when booted from flash because, all the application(not data stored on SD/MMC) are pretty much in compressed format. The CPU is already underpower at 300MHz already, and now it have to do compression/decompression on the fly, it's another step for the CPU to handle.
Exactly. Even if default n770 kernel has very poor MMC speed the i/o speed is still slightly faster than internal flash due to jffs2 compression overhead and as a bonus the CPU is free to do something else while reading. With internal flash i/o is slower and cpu usage is 100% while reading/writing which slows the device a lot.

Also when you add high speed mmc modes to n770 linux kernel it is even better. I still don't have n800 so I'm not sure about n800 SD slot speed but in 50MHz SD mode (probably not in stock n800 kernel) it should do ~20MB/s (read speed) in theory.

tolou
02-05-2007, 05:25 AM
Another somewhat generic question in this "N800" thread ;-)
- Would reflashing the device wipe out the initfs along with the root system?

fanoush
02-05-2007, 05:38 AM
Another somewhat generic question in this "N800" thread ;-)
- Would reflashing the device wipe out the initfs along with the root system?
Yes if you flash whole FIASCO image. No if you flash just the rootfs. When reflashing same firmware again flashing rootfs should be enough to fix anything that is fixable by reflashing. Only when flashing newer or older firmware whole FIASCO image should be used (and yes, you loose the bootmenu).

Linux flasher can unpack FIASCO image 'flasher -u -F ....bin' and then flash just the rootfs 'flasher -f -r rootfs.jffs2'. Sadly windows flashing wizard cannot do this.

tolou
02-05-2007, 06:05 AM
Thanks,
and will I be able to reflash the internal rootfs from a mmc booted OS, using this 'flasher -f -r rootfs.jffs2' ?
Dontīt have a Linux PC or LiveCD and it would be great to have the opportunity to be able do this from "inside" the tablet.

fanoush
02-05-2007, 06:26 AM
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

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.

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

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

freeman
02-05-2007, 08:30 AM
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.

fanoush
02-05-2007, 09:29 AM
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/lists/maemo/developers/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
02-05-2007, 11:02 AM
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.

fanoush
02-05-2007, 11:50 AM
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.

Milhouse
02-05-2007, 11:55 AM
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.

penguinbait
02-05-2007, 12:07 PM
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.

fanoush
02-05-2007, 12:24 PM
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
02-05-2007, 01:02 PM
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?

freeman
02-05-2007, 02:38 PM
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.

fanoush
02-05-2007, 03:44 PM
yes, mtd3 is initfs, mtd2 kernel, mtd1 config partition (where flasher flags - r&d mode, lifeguard reset flag,.... and possibly also device specific configuration like wlan and bt MAC address are stored). mtd0 is bootloader (maybe few layers of them)

boot process is

1. some early boot loader directly on omap chip with nand flash chip driver
2. one or more bootloaders in /dev/mtd0 which initialize higher level hardware (video chip at least) and provides flashing support over USB and in normal situation just loads linux kernel from mtd2
3. linux kernel (with jffs2 driver) with root device set to mtd3 (=initfs)
4. /linuxrc in (uclibc based) initfs which starts dsme, bme (battery management) and loads firmware to wlan and bt chips and finally reads root device from config partition, mounts it, then changes root to it via pivot_root (i.e. exchages / and /mnt/initfs mount points) and runs /sbin/init
5. /sbin/init runs normal /etc/rc* scripts


what is possible is to hack kernel in mtd2 to
1. boot something else then initfs in mtd3 (i.e. directly some mmc partition) - looks like the easy one

and/or

2. allow to load and jump to different kernel (from mmc) - this is the harder one but already implemented in LAB (Linux As Bootloader) in handhelds.org CVS

Arch
02-05-2007, 08:50 PM
Hi can anyone tell me if it is possible to repartition SD/MMC card in the N800 if you do not have linux PC and/or a card reader. I have tried following

http://maemo.org/maemowiki/ExtendedRootFilesystem?highlight=%28fdisk%29

and although cfdisk is not in the same place it does not work. As I have stated before I am new to Linux and am learning slowly. I have searched here and the web but cannot find a useable solution so far. Thanks in advance for any pointers.

Regards

Arch

Milhouse
02-05-2007, 10:32 PM
Can't be done on the N800 as cfdisk was only ever ported to OS 2005. You'll need a Linux PC and cfdisk or sfdisk to partition the SD/MMC cards. As long as you have access to a PC, even a Windows PC, your best bet would be to download a LiveCD ISO (eg. DSL - Damned Small Linux) and boot from it. You may also find the LiveCD useful when it comes to flashing your N800 with updated firmware as the Linux flasher has far more functionality than the Windows flasher.

freeman
02-06-2007, 02:17 AM
Well you could get by w/o the card reader, you can use your N800 as a reader when your card isn't inuse. And I recommend using a LiveDVD linux if you are a PC guy. The true is you can get by w/ a LiveCD, but something might came up short w/ it. Also, if you an old HD laying around, and your PC is decent enough, grab a USB chassis for like $15-20 buck, and slap the linux on there, compile your own kernel, and voila, you got your own external USB HD w/ linux on it.

fanoush
02-06-2007, 03:49 AM
Well you could get by w/o the card reader, you can use your N800 as a reader when your card isn't inuse.
Are you sure? I guess it makes available only specific partition from the card, not whole card. So you can't partition since you don't see partition table from PC.

This may work (have not tried)
http://sebas-nokia770.blogspot.com/2007/01/how-to-create-partition-without-pc.html

freeman
02-06-2007, 04:23 AM
Are you sure? I guess it makes available only specific partition from the card, not whole card. So you can't partition since you don't see partition table from PC.

This may work (have not tried)
http://sebas-nokia770.blogspot.com/2007/01/how-to-create-partition-without-pc.html

I'm pretty sure it work, w/ certain condition.
1. you have to boot off the flash, can't boot off the mmc w/ that.
2. the card cannot be inuse, that mean, no swap partition or swap file on the card either. Then, the system will work.
How would I know, well at least it will work on n800, cuz I don't have an SDHC card reader. But I manage to get the setup on my 8GB SDHC card.
On windows, you might only see the fat partition, but on linux, you see the whole thing. w/ 1 problem though, after any change to the partition, you have to reboot your nokia IT unit, otherwise the system won't see the change.

tolou
02-06-2007, 04:32 AM
Hi can anyone tell me if it is possible to repartition SD/MMC card in the N800 if you do not have linux PC and/or a card reader.

Yes indeed you can :) , using sfdisk, done it myself:
http://www.internettablettalk.com/forums/showthread.php?p=20172&highlight=sfdisk#post20172

sebastian.linux
02-06-2007, 07:48 AM
Hi can anyone tell me if it is possible to repartition SD/MMC card in the N800 if you do not have linux PC and/or a card reader. I have tried following

http://maemo.org/maemowiki/ExtendedRootFilesystem?highlight=%28fdisk%29

and although cfdisk is not in the same place it does not work. As I have stated before I am new to Linux and am learning slowly. I have searched here and the web but cannot find a useable solution so far. Thanks in advance for any pointers.

Regards

Arch

Hi Arch. I've just done it, this very last weekend. I've got a Linux PC, but haven't got a card reader. Besides, I liked the idea of doing everything from the 770 device, without using PC.

Yes, I wrote this link:
http://sebas-nokia770.blogspot.com/2007/01/how-to-create-partition-without-pc.html

But it only explains how to do the partition. It doesn't go on with the rootfs mounting on the mmc card. If you wait till tomorrow, I'll update the WIKI so that everyone can extend their rootfs to the mmc (as I've already done on my 770) without PC and without complicated tricks.

Everything is based on excellent Fanoush's binaries and procedure. Wait just one day more and you'll be able to safely complete the whole process. I haven't just had time enough to update the Wiki. Besides, I was waiting a couple of days to be sure everything worked fine. And it does.

Thanks to Fanoush.

sebastian.linux
02-07-2007, 01:13 AM
Hi can anyone tell me if it is possible to repartition SD/MMC card in the N800 if you do not have linux PC and/or a card reader. I have tried following

http://maemo.org/maemowiki/ExtendedRootFilesystem?highlight=%28fdisk%29

and although cfdisk is not in the same place it does not work. As I have stated before I am new to Linux and am learning slowly. I have searched here and the web but cannot find a useable solution so far. Thanks in advance for any pointers.

Hi Arch. I've finally got it. You may look at it in Maemo Wiki:
http://maemo.org/maemowiki/HowTo_EASILY_Boot_From_MMC_card

Or if you only want to learn how to partition the MMC:
http://maemo.org/maemowiki/HowTo_EASILY_Partition_your_MMC_card

It's been tested on N770. I think it also works for N800. Please let me know.

Salut.
Sebas.

fanoush
02-07-2007, 04:16 AM
Nice howto :-)

as for sfdisk there is also option -uM which according to man page (http://www.die.net/doc/linux/man/man8/sfdisk.8.html) does "Accept or report in units of megabytes. The default is cylinders, at least when the geometry is known." With this the partition size specification may be a bit easier. Not tried if it works.

mrp
02-07-2007, 05:25 AM
I have a 512 mmc, arranged to boot from mmc-80MB FAT rest for EXT2. Strange behaviour takes place with internettablettalk.com. All text appears in "lego blocks". Have tried with diferent encodings. Even formatted my ext2 and rearranged the mmc boot. same thing. If I boot from flash all texts are fine. Any ideas?

fanoush
02-07-2007, 06:10 AM
All text appears in "lego blocks". Any ideas?
Yes. https://maemo.org/bugzilla/show_bug.cgi?id=838

Or did you used GNU tar for cloning as suggested in every guide and it still happens?

mrp
02-07-2007, 06:56 AM
unfortunately I did not know of the problem with rsync. Going to do it one more time, this time with tar. Thank you for your help,
Mika

BTW. Nokia has announces a revision for mediastreamer, including video streaming. Have not tried yet

jayholler
02-16-2007, 02:16 AM
Does anyone have a bootmenu.conf file to share that works on the N800? I followed the instructions, got gnu/tar from penguinbait.com using wget, and cloned the entire system after making the appropriate partitions and formatting them, with the required reboots in between. The bootmenu works fine, but the system just hangs when trying to boot the file system from the SD card on /dev/mmcblk1 (and yes, I altered the examples in the appropriate places to indicate the appropriate card and directory). I don't understand what went wrong, but for now I gave up after mutliple attempts have failed. The only thing I didn't follow was that I had already installed a bunch of apps before doing this, so that might have screwed the pooch. I figure I'll give it another try next time I flash the system with a clean image. If anyone has any suggestions or anything, I'm all ears.

fanoush
02-16-2007, 01:44 PM
The bootmenu works fine, but the system just hangs when trying to boot the file system from the SD card on /dev/mmcblk1 (and yes, I altered the examples in the appropriate places to indicate the appropriate card and directory).

can you post your not working entry?


The only thing I didn't follow was that I had already installed a bunch of apps before doing this, so that might have screwed the pooch.

Shouldn't matter, if it boots from flash then it should boot from mmc too. It is better to clone clean system since you have clean backup and you can be sure the system works but otherwise it doesn't matter.

If anyone has any suggestions or anything, I'm all ears.
Check if you have /dev/mmcblk1pX files in initfs. But not when system is already booted since /dev is overlayed with tmpfs filesystem. Remount initfs somewhere else and look into /dev/

mount -t jffs2 /dev/mtdblock3 /opt/
ls -l /opt/dev/


Do you see device file for your boot device? If not, that's the problem.

fanoush
02-16-2007, 02:06 PM
just had a look and partitions 1 and 2 are there for both cards

brw------- 0/0 0 2006-12-19 17:56:30 ./dev/mmcblk0p1
brw------- 0/0 0 2006-12-19 17:56:30 ./dev/mmcblk0p2
brw------- 0/0 0 2006-12-19 17:56:30 ./dev/mmcblk1p1
brw------- 0/0 0 2006-12-19 17:56:30 ./dev/mmcblk1p2

So unless you boot from /dev/mmcblk1p3 the problem is somewhere else

jayholler
02-16-2007, 02:41 PM
Here is my bootmenu.conf file, to boot from mmcblk1p2, which is ext2. mmcblk1p1 is fat16, at 480MB.

# bootmenu customisation file
#
# included from bootmenu.sh after default menu is defined
# you can change some items or redefine menu completely

# timeout for automatic selection when no key is pressed
# set to -1 for no timeout (not recommended, can drain battery when device reboots unatteded)
MENU_TIMEOUT=30

# menu items
MENU_MIN=1 # first item index

#no need to redefine
#MENU_1_NAME="Internal flash"
#MENU_1_ID="flash"

MENU_2_NAME="External MMC card, partition 2 (stable), ext2"
MENU_2_ID="mmc1"
MENU_2_DEVICE="mmcblk1p1"
MENU_2_MODULES="mbcache ext2"
MENU_2_FSTYPE="ext2"
MENU_2_FSOPTIONS="defaults,noatime"

MENU_3_NAME="Power off (when not on charger)"
MENU_3_ID="off"

#last item index, change if you add/remove items
MENU_MAX=3

I know that the menuID references mmcblk1p1, but this was after p2 failed to boot, I was hoping it would skip p1 and find the first bootable partition on the sd card, as per the README.txt.
For now I think I'll be giving up. I don't have mmcblk1 set up that way anymore, but I will post more on my next attempt. Thanks Fanoush!

fanoush
02-16-2007, 02:58 PM
I was hoping it would skip p1 and find the first bootable partition on the sd card, as per the README.txt.

Maybe this is a little confusing in the README but it works like this only with the original 'mmc' root device. If you add your own with specific device nothing is searched or skipped. Did you try to remove 'defaults' and leave only noatime? Is the same card booting when inserted into internal slot (with different menu entry of course)?

jayholler
02-16-2007, 04:28 PM
OK, I lied, I've been trying this again since you posted your response to my questions.

Here is the problem, it would seem that the card may be corrupted. But I have a few questions, please excuse my newbness for the rest of this post.

When using sfdisk, it says that if you make a DOS partition you need to

dd if=/dev/zero of=/dev/mmcblk1p1 bs=512 count=1

Not being too familiar with sfdisk, I read up on it, and it appears that this is necessary. The man page I found online said to exit sfdisk, reboot, then issue the "dd" command above. So I tried that, but then the sfdisk program won't recognize the partitions, nor will mkdosfs or mke2fs. OK.

So, I tried next to only make one 2GB partition for ext2. So I sfdisk, reboot, mke2fs, reboot. Now I should be able to continue with "tar"ring the flash image over, following the instructions from the original post.

Next I do the ./initfs_flash script, reboot. I have modified the bootmenu.conf file to indicate mmcblk1 (since I only have one large linux partition now), and only the noatime option).

I try to mount /dev/mmcblk1p1, and there is nothing there.

sfdisk -l /dev/mmcblk1 says:

"sfdisk: ERROR: sector 0 does not have an msdos signature
/dev/mmcblk1: unrecognized partition
No partitions found"

I am not sure where to go from here. I am using an N800, and trying to use the external MMC so I can still utilize the swap built into the OS on the internal MMC.

Do I have to use a DOS partition on /dev/mmcblk1? It would appear so. Perhaps I have a bad card, or messed it up somehow with all this partitioning from the device?

fanoush
02-16-2007, 05:05 PM
When using sfdisk, it says that if you make a DOS partition you need to

dd if=/dev/zero of=/dev/mmcblk1p1 bs=512 count=1

Not sure if this is still needed. This is historic issue related to bug in old ms-dos format.exe and/or fdisk.exe commands. They were too clever and were confused by previous data in the partition. I guess you can skip it but it shouldn't hurt.

If it hurts then something is seriously wrong, did you really used /dev/mmcblk1p1 and not /dev/mmcblk1 with dd command?


So, I tried next to only make one 2GB partition for ext2.

This is not good idea, default Nokia system expects first partition on card being FAT, if you insist on this you will need to modify few things or it will complain or fail.


I try to mount /dev/mmcblk1p1, and there is nothing there.

sfdisk -l /dev/mmcblk1 says:

"sfdisk: ERROR: sector 0 does not have an msdos signature
/dev/mmcblk1: unrecognized partition
No partitions found"

This is the problem, looks like partitioning by sfdisk somehow doesn't work for you (or you erased if via bad dd above). Can you repartition card in desktop linux via usb card reader?


I am not sure where to go from here. I am using an N800, and trying to use the external MMC so I can still utilize the swap built into the OS on the internal MMC.

You can use swap on internal card partiton 1 (FAT) and still boot from partition 2 (ext2) on same card. This is IMHO the best setup. Then you have external slot completely free for other cards.

Perhaps I have a bad card, or messed it up somehow with all this partitioning from the device?
Yes, I'd guess some problem with partitioning the card. Try also 'dmesg' command to see kernel log, if you don't see i/o errors card is probably not bad.

jayholler
02-16-2007, 05:13 PM
Not sure if this is still needed. This is historic issue related to bug in old ms-dos format.exe and/or fdisk.exe commands. They were too clever and were confused by previous data in the partition. I guess you can skip it but it shouldn't hurt.

If it hurts then something is seriously wrong, did you really used /dev/mmcblk1p1 and not /dev/mmcblk1 with dd command?


This is not good idea, default Nokia system expects first partition on card being FAT, if you insist on this you will need to modify few things or it will complain or fail.

This is the problem, looks like partitioning by sfdisk somehow doesn't work for you (or you erased if via bad dd above). Can you repartition card in desktop linux via usb card reader?


You can use swap on internal card partiton 1 (FAT) and still boot from partition 2 (ext2) on same card. This is IMHO the best setup. Then you have external slot completely free for other cards.

Yes, I'd guess some problem with partitioning the card. Try also 'dmesg' command to see kernel log, if you don't see i/o errors card is probably not bad.

OK, you rule fanoush. I think i must have screwed something up somewhere along the way, I can't even remember how many times I have tried the partition part, and i have done it before, I know it shouldn't be this difficult. I must have screwed something up. I do have a linux system. I can partition the card using Ubuntu, and then finish on the N800?

THanks for your help and severe patience!!

jayholler
02-17-2007, 10:50 AM
So now I've been able to partition the card appropriately:

Disk /dev/mmcblk1: 62032 cylinders, 4 heads, 16 sectors/track
Warning: The partition table looks like it was made
for C/H/S=*/255/63 (instead of 62032/4/16). For this listing I'll assume that geometry.
Units = cylinders of 8225280 bytes, blocks of 1024 bytes, counting from 0
Device Boot Start End #cyls #blocks Id System
/dev/mmcblk1p1 0+ 60 61- 489951 6 FAT16
/dev/mmcblk1p2 61 246 186 1494045 83 Linux
/dev/mmcblk1p3 0 - 0 0 0 Empty
/dev/mmcblk1p4 0 - 0 0 0 Empty
but now the next step is failing me:


/home/user # mount /dev/mmcblk1p2 /opt
mount: Mounting /dev/mmcblk1p2 on /opt failed: Invalid argument

sebastian.linux
02-17-2007, 02:37 PM
So now I've been able to partition the card appropriately:
but now the next step is failing me:

You need to format the partition before mounting it.

Milhouse
02-17-2007, 04:24 PM
Also make sure ext2.ko and mbcache.ko are loaded.

freeman
02-17-2007, 04:32 PM
Also make sure ext2.ko and mbcache.ko are loaded.

I think some of the modules have to be loaded in certain order. I'm not sure if you have to load mbcache.ko first or not. Also, you can't use modeprobe to load it, you have to use insmod and point to the correct folder.

Milhouse
02-17-2007, 04:47 PM
Yes - mbcache.ko first, followed by ext2.ko using insmod. As it says in the howto :)

DCr33P
02-19-2007, 09:05 PM
Guys, I have two little questions. I have no experience with that kind of "deep" booting related stuff on Linux systems. That are subjects, I alwasys missed somehow :( So the first question is:
Why should there be at least one FAT partition on the mmc/sd card when booting from it? Ext2 is the boot partition with rootfs, so what's the FAT partition for?
The second interrogation mark in my head is the wear issue. Jffs2 uses wear leveling to harmonize the write cycles throughout the jffs2 partition. So if we have a 512 mb parition, we have to commit about 50tb of traffic (512 * 10^-6*100000) to reach the 100k cycles limit. By the time we reach this amount there should be Nokia Internet Tablet OS 2280, so that's not a problem.
But what about ext2? If we are unlucky, we can wear out some specific blocks in a few months and had to suffer from read errors. Does the SD Controller have error correction? 2bit errors in one word (does not matter that much wich size, imho) are unlikely and 1bit errors can be corrected easily... Hmmm.. just some thoughts on it.

jayholler
02-19-2007, 09:06 PM
Yes - mbcache.ko first, followed by ext2.ko using insmod. As it says in the howto :)
Yeah, I have those loading in the rcS file, which works nicely on the N800. Turns out that sfdisk formating the card too many times has screwed something up. I am going to see what some othr utilities can do for me. I tried the process again with a 128MB card, and it worked great until tar ran out of room. I appreciate all the help, but I've got to figure out what is wrong with the card before I can get this dual boot situation working.

freeman
02-19-2007, 11:45 PM
Why should there be at least one FAT partition on the mmc/sd card when booting from it? Ext2 is the boot partition with rootfs, so what's the FAT partition for?
The fat partition is to store data, well at least data that used by the application that nokia made, stuff like contact, backup, etc. Which make good sense, because in windows world, FAT is the best compatibility FS between all OSes. It make things a lots easier to move data around between Windows&Linux&n800.

The second interrogation mark in my head is the wear issue. Jffs2 uses wear leveling to harmonize the write cycles throughout the jffs2 partition. So if we have a 512 mb parition, we have to commit about 50tb of traffic (512 * 10^-6*100000) to reach the 100k cycles limit. By the time we reach this amount there should be Nokia Internet Tablet OS 2280, so that's not a problem.
Well, there is no way to predict when the flash will fail or how many write it will take. So, moving the written part to the SD card is better because it's replacable regardless of when or how it fails.

But what about ext2? If we are unlucky, we can wear out some specific blocks in a few months and had to suffer from read errors. Does the SD Controller have error correction? 2bit errors in one word (does not matter that much wich size, imho) are unlikely and 1bit errors can be corrected easily... Hmmm.. just some thoughts on it.
well, if you like you don't have to use ext2 as a rootfs, you can still use jffs2. The problem is that jffs2 is compressed fs therefore, overhead. You could also make it use other fs also, like ext3 or jfs, but you will have to compile the kernel yourself. The kernel&loader are store on flash, and those things are read-only. The root can be store anywhere.

fanoush
02-20-2007, 04:56 AM
Why should there be at least one FAT partition on the mmc/sd card when booting from it? Ext2 is the boot partition with rootfs, so what's the FAT partition for?

it is easier this way, nokia system expect first partition to be FAT. it is also great for interoperability, other systems expect memory cards to be FAT too. For SD cards filesystem specification is even part of SD standard. All SD cards should be FAT (FAT16), all SDHC cards should be FAT32.


But what about ext2? If we are unlucky, we can wear out some specific blocks in a few months and had to suffer from read errors. Does the SD Controller have error correction?
As cards are expected to be FAT and this is very unfriendly filesystem for flash memory I wouldn't bother with ext2 :-)

SD/MMC memory cards (must) have its own internal logic for block management similar to hard disks. You can't tell which block is really used by the card when writing same block of filesystem. There are many reasons for this
- wear levelling and bad block management
- physical block size of NAND flash memory is different than filesystem block size and writing rules are much more complicated - blocks need to be written as a whole and erased before writing, it is better to handle this transparently inside card (i.e. pre-erase them and keep a pool of such fresh blocks ready for writing for better speed )

DCr33P
02-20-2007, 02:08 PM
Thanks guys, your posts were very informative :)
There is just on thing:


First partition as FAT, second one as ext2. You can use fdisk on linux PC and USB card reader to do this (is there fdisk compiled for N770?). As the jffs2 flash filesystem uses compression you need bigger partition on MMC to hold same data. 128MB is too small, at least 256MB is recommended to have similar space as with original flash rootfs.


What size should be the FAT partition? I assume, the 256mb min is according to the ext2 partition...

Thanks again.

freeman
02-20-2007, 04:12 PM
What size should be the FAT partition? I assume, the 256mb min is according to the ext2 partition...

Thanks again.

FAT partition is going to be most, if not all of the space of your card. depending on whether you plan to boot of from that card or not. If you plan to boot off from that card, then I'll say about 512MB-1GB should be devote to ext2 and the rest to FAT. I already used over 700MB on the card, w/ tons of app. That's why people buy large SD card. I bought mine 8GB SDHC for like $70, and it work flowlessly. Just a warning, you can't use SDHC card w/ the stock kernel, at least not yet anyway. The next upgrade will persumably support it, as people are already start using them

schmots
02-20-2007, 04:15 PM
Anyone doing the ext3 boot?

freeman
02-20-2007, 04:19 PM
Anyone doing the ext3 boot?

I think you could, but the modules doesn't exactly work right out of the box, not to mention no body would recommend it. ext3 is basically an ext2 w/ journal support. Well what does journal mean? It mean continuous writing to the storage. This is bad, very very bad for flash base storage.

schmots
02-20-2007, 04:21 PM
You can mount ext3 without turning on Journaling. You just need to edit the mount options for the partition. I just wondered if anyone was though.

fanoush
02-20-2007, 04:46 PM
I think you could, but the modules doesn't exactly work right out of the box, not to mention no body would recommend it. ext3 is basically an ext2 w/ journal support. Well what does journal mean? It mean continuous writing to the storage. This is bad, very very bad for flash base storage.
Well if fact I did (recommend it).

here
http://www.internettablettalk.com/forums/showpost.php?p=34708&postcount=7
and here
http://www.internettablettalk.com/forums/showpost.php?p=35323&postcount=35

And no, it isn't that bad. This continuous writing problem is a myth. There are a bit more writes indeed for metadata journaling but not something significant.

DCr33P
02-23-2007, 08:25 PM
Hmm... I just tried the procedure to boot from SD card.
I used the maemo wiki:

http://maemo.org/maemowiki/HowTo_EASILY_Boot_From_MMC_card

and followed exactly these instructions.

The bootmenu consists of:
boot from flash
mmc
mmc2, partition 2, ext2
...
I get the error : Boot from mmc failed, booting from flash...
when choosing the option "mmc2,partition 2..."

When choosing "mmc" it boots, but boots from flash...
What's wrong?

Some specs:
N800 latest firmware
internal sd card, 2gb
mmcblkp1 ~1.5gb FAT16
mmcblkp2 ~0.5gb ext2
Partitioning done with sfdisk: http://maemo.org/maemowiki/HowTo_EASILY_Partition_your_MMC_card

I realized that the instructions from the wiki differ from the one at the beginning of this thread. In this thread used:

vi /mnt/initfs/bootmenu.sh

Change the line
GETKEY="evkey -u -t 1000 /dev/input/event1"
to
GETKEY="evkey -u -t 1000 /dev/input/event2"


What's the meaning of these steps?

EDIT:
While partitioning my SD card with sfdisk it asks me whether I want to mark the Fat16 partition as active or not. I chose yes (to mark as active). Was this decision ok?

penguinbait
02-23-2007, 09:08 PM
the evkey entry is only to get the menu KEYS to work, if you can toggle which menu entry to choose evkey is working for you. Partiton info looks right, my guess would be your data was not properly copied.

did you do this?

# apt-get -d install tar
# cd /var/cache/apt/archives/
# mkdir /tar-temp/
# dpkg -x tar*.deb /tar-temp/
# /tar-temp/bin/tar cf - -C /floppy . | /tar-temp/bin/tar xvf - -C /opt


/bin/tar (busybox) will not copy things properly. If it can not boot from mmc it will boot from flash I believe. http://penguinbait.com/tar.gz is the one I use.

DCr33P
02-23-2007, 09:11 PM
hmmm... I've just booted from flash, inserted mbcache.ko, ext2.ko and mounted /dev/mmcblk0p2. The mountpoint is empty, so I can assume that the cloning progress went wrong. I did exactly the same as described on the wiki:
I just pasted(not very famillar with those tar options...):

/tar-temp/bin/tar cf - -C /floppy . | /tar-temp/bin/tar xvf - -C /opt


and before that, of curse:

mount /dev/mmcblk0p2 /opt ;
mount -t jffs2 /dev/mtdblock4 /floppy -o rw,rpsize=1024,rpuid=0,rpuid=30000

DCr33P
02-23-2007, 09:25 PM
Yes I did that. Hmmm what can I do now?

EDIT:
I just mounted the card to /opt and initfs to /floppy again to do the try the cloning process again. I checked with df ang got a strange result:


/dev/mmcblk0p2 499014 194165 279085 41% /opt
/dev/mtdblock4 257536 120804 136732 47% /floppy


According to this, there is data on the card. But I can't see it....


du -sh /opt

tells me, there is no data.

DCr33P
02-23-2007, 10:39 PM
Ok, I think I've been able to isolate the problem a bit.
Running dmesg prints out following:


[ 1105.062469] EXT2-fs warning: mounting unchecked fs, running e2fsck is recommended
[ 1109.425537] EXT2-fs error (device mmcblk0p2): ext2_check_page: bad entry in directory #2: rec_len is smaller than minimal - offset=0, inode=0, rec_len=0, name_len=0
[ 1109.426086] EXT2-fs error (device mmcblk0p2): ext2_readdir: bad page in #2
[ 1110.415252] EXT2-fs error (device mmcblk0p2): ext2_readdir: bad page in #2
[ 1120.740539] EXT2-fs error (device mmcblk0p2): ext2_readdir: bad page in #2
[ 1122.880798] EXT2-fs error (device mmcblk0p2): ext2_readdir: bad page in #2


Got several "error blocks" like this, assume every time I try to mount the ext2 partition. Do I have a bad SD card? In sfdisk I used:


# sfdisk /dev/mmcblk0
/dev/mmcblk0p1:1,45000,6
/dev/mmcblk0p2:45001,,
/dev/mmcblk0p3:
/dev/mmcblk0p4:


Still not sure whether I should have switched the "active" flag on or not.

sebastian.linux
02-24-2007, 10:53 AM
While partitioning my SD card with sfdisk it asks me whether I want to mark the Fat16 partition as active or not. I chose yes (to mark as active). Was this decision ok?

I think you shouldn't. Because the vfat partition is not bootable.

DCr33P
02-24-2007, 11:35 AM
I just did the partitioning again and did not set the active flag. Then I made a vfat and ext2 fs, again. After rebooting and mounting ext2, there is still the same data as before when typing "df" but no visible data. How can I format the partiton?

And there is something very wrong:


/media/mmc2 # mkdir test
mkdir: Cannot create directory `test': Input/output error

DCr33P
02-24-2007, 12:30 PM
Ok, I am stalled right now and don't know what to do next. :(

DCr33P
02-24-2007, 01:38 PM
Grr... I am going crazy :mad:
I flushed the sd card with dd if=/dev/null ... stuff. Then I created a whole FAT16 parition with sfdisk:


sfdisk /dev/mmcblk0 << EOF
;
EOF


Then again with sfdisk:


..blk0p1:1,45000,6
..blk0p2:45001,,
...


Then I had a 500mb linux partiton and 1.5 gig fat16.

Now again I did the dd if=/dev/null stuff to /dev/mmcblk0p2, because there were some problems reported, that mkfs.ext2 did not format he partiton right.
Then:

mkdosfs /dev/mmcblk0p1
(REBOOT)
(insmod mbcache/ext2)
mkfs.ext2 /dev/mmcblk0p2
(REBOOT)

and when I mount the ext2 partiton, "df" shows me:


/dev/mtdblock4 2048 1772 276 87% /mnt/initfs
none 512 64 448 13% /mnt/initfs/tmp
/dev/mtdblock4 257536 120884 136652 47% /
none 512 64 448 13% /tmp
none 1024 68 956 7% /dev
/dev/mmcblk1p1 122912 17392 105520 14% /media/mmc1
/dev/mmcblk0p2 499014 194165 279085 41% /opt


I erased the partiton a few times with dd, deleted partitions and crated them, erased them egain with dd and format it with mkfs.ext2 and still have those 41% of data on it?

cd /opt ; mkdir test -> again with input/output error.

Somethig is veeeeeeeeeery wrong...

Please, need help :confused:

sapporobaby
02-25-2007, 03:45 PM
Why would anyone want to do this?

DCr33P
02-25-2007, 03:51 PM
ehhhhhhem...???

sapporobaby
02-25-2007, 03:56 PM
ehhhhhhem...???

Was that a very feeble attempt at humor or an answer?

DCr33P
02-25-2007, 03:58 PM
Ehhhhhheeeem....??? An Answer to what, exactly?:)

sapporobaby
02-25-2007, 04:04 PM
I asked why would anyone want to do this. To boot from an MMC? What is the advantage or need?

DCr33P
02-25-2007, 04:16 PM
Oh ok... didn't think of that because it was discussed in this thread ;)
Advantages:

- Backup system on flash. If you brick your OS you can use your backup system.
- Faster booting. Jffs2 uses compression, so there is a big overhead which results in slower transfer rates and cpu usage. The filesystem on on your SD card can be ext2/ext3 etc.
- Extends your rootfs and you can install more than 256mb of applications.
- Testing system. Install an application on sd and test it. If everything works you ca finally install it on flash. So you can have a cleaner OS.
- ...

sapporobaby
02-25-2007, 04:26 PM
Oh ok... didn't think of that because it was discussed in this thread ;)
Advantages:

- Backup system on flash. If you brick your OS you can use your backup system.
- Faster booting. Jffs2 uses compression, so there is a big overhead which results in slower transfer rates and cpu usage. The filesystem on on your SD card can be ext2/ext3 etc.
- Extends your rootfs and you can install more than 256mb of applications.
- Testing system. Install an application on sd and test it. If everything works you ca finally install it on flash. So you can have a cleaner OS.
- ...

So this would appeal more to the developer world rather then just average users. So my original assumptions was correct.

fanoush
02-25-2007, 04:51 PM
So this would appeal more to the developer world rather then just average users. So my original assumptions was correct.
Well, if you think only developers want faster system or more space for aplications or having safe way to recover from some random buggy program then yes, it is only for developers :-)

I would call them power users.

DCr33P
02-25-2007, 04:53 PM
dito :D

btw: anyone an idea why I can't create a ext2 partition on my card?

fanoush
02-25-2007, 04:55 PM
I just did the partitioning again and did not set the active flag. Then I made a vfat and ext2 fs, again. After rebooting and mounting ext2, there is still the same data as before when typing "df" but no visible data. How can I format the partiton?

And there is something very wrong:


/media/mmc2 # mkdir test
mkdir: Cannot create directory `test': Input/output error

Looks like buggy card, can you post kernel log (output of 'dmesg') when you format or access (read/write) the card? What SD/MMC card you have? If it is SD card make sure it is not write protected, there is a switch on the card.

sapporobaby
02-25-2007, 05:02 PM
Well, if you think only developers want faster system or more space for aplications or having safe way to recover from some random buggy program then yes, it is only for developers :-)

I would call them power users.

Great, hopefully Nokia can count on you "power" users to purchase about a million N800's rather than the average user or early adopters. Yup, I can see a great future for this device with guys like you on the purchasing end. Hopefully the Nokia sales and marketing departments took you into account.

DCr33P
02-25-2007, 06:23 PM
I think that the card is not the problem. I created a 2gig FAT partition and tested it, it was ok. Then I made a whole 2gig ext2 partiton instead, and it worked. Only the combination of two partitons does not work. The first FAT parittion can be mounted, the second ext2 partition not. Dmesg while mounting:


[17180725.936000] NTFS-fs error (device sdd2): read_ntfs_boot_sector(): Primary boot sector is invalid.
[17180725.936000] NTFS-fs error (device sdd2): read_ntfs_boot_sector(): Mount option errors=recover not used. Aborting without trying to recover.
[17180725.936000] NTFS-fs error (device sdd2): ntfs_fill_super(): Not an NTFS volume.
[17180725.936000] FAT: bogus number of reserved sectors
[17180725.936000] VFS: Can't find a valid FAT filesystem on dev sdd2.
[17180725.940000] ReiserFS: sdd2: warning: sh-2021: reiserfs_fill_super: can not find reiserfs on sdd2
[17180725.944000] VFS: Can't find an ext2 filesystem on dev sdd2.


and fsck.ext2:


dusko@dusko-desktop:/etc$ sudo fsck.ext2 /dev/sdd2
e2fsck 1.39 (29-May-2006)
Couldn't find ext2 superblock, trying backup blocks...
fsck.ext2: Bad magic number in super-block while trying to open /dev/sdd2

The superblock could not be read or does not describe a correct ext2
filesystem. If the device is valid and it really contains an ext2
filesystem (and not swap or ufs or something else), then the superblock
is corrupt, and you might try running e2fsck with an alternate superblock:
e2fsck -b 8193 <device>


I also tried with parted, and everytime I create the ext2 partition and commit the changes, the next time it shows that the fs type is unknown.

I tried to make one primary and one extended partition and also tried to make two primary partitions. Now everytime a try something new, I create two primary parititons.

EDIT:

Got a 2gb Extrememory performance card. It's now wirteprotected, cause I can write on the first fat partition and create them all.

fanoush
02-25-2007, 06:59 PM
Hmm, that's strange. The only idea I have is that those two partitions are overlapping so when you write to end of first FAT you overwrite beginning of second ext2 one. But if you tried also other programs to create partitions and did not mess with partition beginning it is unlikely so I don't know.

DCr33P
02-26-2007, 07:58 AM
Tonight I did this to the whole card:


dusko@dusko-desktop:/etc$ sudo dd if=/dev/zero of=/dev/sdd && dd if=/dev/zero of=/dev/sdd
dd: writing to `/dev/sdd': Input/output error
2427905+0 records in
2427904+0 records out
1243086848 bytes (1.2 GB) copied, 815.859 seconds, 1.5 MB/s


Ergo: Not so good...

Then I tried again. This time I set it up to write 5 times to the card. In the morning, after I woke up, i got this:


dusko@dusko-desktop:/etc$ sudo dd if=/dev/zero of=/dev/sdd ; dd ...
dd: writing to `/dev/sdd': No space left on device
3910657+0 records in
3910656+0 records out
2002255872 bytes (2.0 GB) copied, 1295.23 seconds, 1.5 MB/s


fife times.

I don't know why I got input/output error the first time, but to me the card seems ok, cause of the last fife writing cycles.

DCr33P
02-26-2007, 01:02 PM
WTF!?!? I just played around with the sizes of each partition and chose 1gb fpr FAT32 and the rest to ext2 (~900mb) and it worked!? After a few partitions changes I realize that I can't make ext2 partitions of 400-600mb (very rough approximation)... :eek:

I don't get it...

schmots
02-26-2007, 02:30 PM
GNUgremlins.. very common :-)

DCr33P
02-26-2007, 02:35 PM
Grrr... i don't get it. I inserted my SD card into my N800 and mounted ext2 on /opt and the rootfs to /floppy as explained here: http://maemo.org/maemowiki/HowTo_EASILY_Boot_From_MMC_card

The copy progress went good, except for that.


/tar-temp/bin/tar: ./etc/dbus-1/event.d: Cannot stat: No such file or directory
/tar-temp/bin/tar: ./etc/dbus-1: Cannot stat: No such file or directory
/tar-temp/bin/tar: ./etc/others-menu/1400_tana_fi_utilities: Cannot stat: No such file or directory
/tar-temp/bin/tar: ./etc/others-menu/extra_applications: Cannot stat: No such file or directory
/tar-temp/bin/tar: ./etc/others-menu/2100_tana_fi_games: Cannot stat: No such file or directory
/tar-temp/bin/tar: ./etc/others-menu: Cannot stat: No such file or directory
/tar-temp/bin/tar: ./etc/osso-af-init: Cannot stat: No such file or directory
/tar-temp/bin/tar: ./etc/rcS.d: Cannot stat: No such file or directory
/tar-temp/bin/tar: ./etc/rc6.d: Cannot stat: No such file or directory
/tar-temp/bin/tar: ./etc/rc5.d: Cannot stat: No such file or directory
/tar-temp/bin/tar: ./etc/rc4.d: Cannot stat: No such file or directory
/tar-temp/bin/tar: ./etc/rc3.d: Cannot stat: No such file or directory
/tar-temp/bin/tar: ./etc/rc2.d: Cannot stat: No such file or directory
/tar-temp/bin/tar: ./etc/rc1.d: Cannot stat: No such file or directory
/tar-temp/bin/tar: ./etc/rc0.d: Cannot stat: No such file or directory
/tar-temp/bin/tar: ./etc/fonts/conf.d: Cannot stat: No such file or directory
/tar-temp/bin/tar: ./etc/fonts: Cannot stat: No such file or directory
/tar-temp/bin/tar: ./etc/alternatives: Cannot stat: No such file or directory
/tar-temp/bin/tar: ./etc/osso-backup/restore.d/it2006: Cannot stat: No such file or directory
/tar-temp/bin/tar: ./etc/osso-backup/restore.d: Cannot stat: No such file or directory
/tar-temp/bin/tar: ./etc/osso-backup: Cannot stat: No such file or directory
/tar-temp/bin/tar: ./etc/udev/rules.d: Cannot stat: No such file or directory
/tar-temp/bin/tar: ./etc/udev: Cannot stat: No such file or directory
/tar-temp/bin/tar: ./etc/X11/xkb: Cannot stat: No such file or directory
/tar-temp/bin/tar: ./etc/X11: Cannot stat: No such file or directory
/tar-temp/bin/tar: .: implausibly old time stamp 1970-01-01 01:00:00
/tar-temp/bin/tar: Error exit delayed from previous errors


After that I checked /opt. The folders are all there, but etc , sys , boot, initrd and lib are empty. So, why everything goes wrong on my device :(

DCr33P
02-26-2007, 02:45 PM
AhhhhhhhhH! The ext2 filesystem is down again :mad:


/opt # ls
ls: ./lib: Input/output error
ls: ./proc: Input/output error
ls: ./sbin: Input/output error
ls: ./root: Input/output error
ls: ./media: Input/output error
ls: ./floppy: Input/output error
ls: ./initrd: Input/output error
ls: ./tar-temp: Input/output error
bin dev home mnt srv tmp var
boot etc lost+found opt sys usr



[ 295.921875] mmci-omap mmci-omap.1: card status error (CMD13)
[ 343.654205] omapfb omapfb: s1d1374x: setting update mode to disabled
[ 449.595886] EXT2-fs error (device mmcblk0p2): ext2_check_page: bad entry in directory #30529: rec_len is smaller than minimal - offset=0, inode=0, rec_len=0, name_len=0
[ 456.912719] mmci-omap mmci-omap.1: card status error (CMD13)
[ 482.362670] mmci-omap mmci-omap.1: card status error (CMD13)
[ 490.015686] mmci-omap mmci-omap.1: card status error (CMD13)
[ 493.506347] mmci-omap mmci-omap.1: card status error (CMD13)
[ 494.470550] mmci-omap mmci-omap.1: card status error (CMD13)
[ 564.211853] EAC mode: play enabled, rec enabled
[ 564.271484] omapfb omapfb: s1d1374x: setting update mode to manual
[ 566.719146] EAC mode: play disabled, rec disabled
[ 624.302612] omapfb omapfb: s1d1374x: setting update mode to disabled
[ 639.328521] mmci-omap mmci-omap.1: card status error (CMD13)
[ 704.752166] EXT2-fs error (device mmcblk0p2): ext2_readdir: bad page in #30529
[ 739.329101] mmci-omap mmci-omap.1: card status error (CMD13)
[ 807.463836] EXT2-fs error (device mmcblk0p2): ext2_readdir: bad page in #30529
[ 852.689422] EXT2-fs error (device mmcblk0p2): ext2_readdir: bad page in #30529
[ 855.145446] EXT2-fs error (device mmcblk0p2): ext2_readdir: bad page in #30529
[ 879.315307] mmci-omap mmci-omap.1: card status error (CMD13)
[ 914.327880] mmci-omap mmci-omap.1: card status error (CMD13)
[ 1144.328308] mmci-omap mmci-omap.1: card status error (CMD13)
[ 1273.524353] EAC mode: play enabled, rec enabled
[ 1273.599548] omapfb omapfb: s1d1374x: setting update mode to manual
[ 1276.023803] EAC mode: play disabled, rec disabled
[ 1333.615112] omapfb omapfb: s1d1374x: setting update mode to disabled
[ 1361.551879] EXT2-fs warning: mounting fs with errors, running e2fsck is recommended
[ 1416.477569] EAC mode: play enabled, rec enabled
[ 1416.544738] omapfb omapfb: s1d1374x: setting update mode to manual
[ 1418.976654] EAC mode: play disabled, rec disabled


and:


/ # e2fsck /dev/sdd2
e2fsck 1.37 (21-Mar-2005)
e2fsck: No such file or directory while trying to open /dev/sdd2

The superblock could not be read or does not describe a correct ext2
filesystem. If the device is valid and it really contains an ext2
filesystem (and not swap or ufs or something else), then the superblock
is corrupt, and you might try running e2fsck with an alternate superblock:
e2fsck -b 8193 <device>


OK, I am finished with that :mad: Now there still remains one question: What's faulty? My N800 or the SD Card? :confused:

schmots
02-26-2007, 03:57 PM
try
fsck -f /dev/mmcblk0p2 (or what ever partition you used)

DCr33P
02-26-2007, 04:09 PM
Already did that. But I can do that forever: 1)flush with dd 2)create partitions 3)format 4)copy rootfs with gnu-tar and then again the FS will be gone. I am going to send my 2gb Extrememory back to amazon. Can anyone recommend 4gb PNY sdhc(class 4) cards?

penguinbait
02-26-2007, 04:23 PM
newegg.com has 8gb sdhc for like 56$

DCr33P
02-26-2007, 04:44 PM
I am from Germany... I need *de sellers :)
Was thinking about that PNY 4gb SDHC card and 4gb Transcend 150X (non sdhc). Don't know what to get.

fanoush
02-26-2007, 04:47 PM
From the errors you posted it really looks like bad/incompatible card. There is no point in wasting time with it. Get a different card or wait, maybe this will get fixed in next firmware.


OK, I am finished with that :mad: Now there still remains one question: What's faulty? My N800 or the SD Card? :confused:

Try the card in other devices. Or simply return it if possible and get different one. Looks like n800 simply doesn't like it. In fact I have similar card myself. It it Transcend 4GB MMCplus card. I bought it in advance before getting n800. It was quite cheap but simply doesn't work in N800 and produce similar i/o errors. It does work in other devices - usb reader, Tapwave Zodiac, even in N770 with hacked kernel to accept full sized cards without closing doors, but so far it fails in N800. I hope it is software issue that can be fixed.

fanoush
02-26-2007, 04:51 PM
I am from Germany... I need *de sellers :)
Was thinking about that PNY 4gb SDHC card and 4gb Transcend 150X (non sdhc). Don't know what to get.
I'd go for the 150x one. There is no point in having 4GB SDHC card. 8GB yes because there is no choice, but 4GB not.

DCr33P
02-26-2007, 04:54 PM
Hmm, now I don't know if it's good to buy a Transcend 4gb SD 150X card, cause you had Problems with those MMCPlus Transcend cards. Ok, SD and MMC is not the same. Searching the forum, there are Transcend 4gb SD guys out there and those SD cards seem to work.

DCr33P
02-26-2007, 05:00 PM
Hmm.., you got the point. After 2 days of SD card bugging/debugging I have no power to play around with SDHC Kernel support. Just want them to work, so I can play around with much more usable N800 stuff ;)

Milhouse
02-26-2007, 08:57 PM
The SDHC kernel is very easy to apply (if you have Linux) and doesn't wipe any application data so you can revert back to the stock kernel if you wish all within a few minutes. I've been using the kernel from here (http://intr.overt.org/blog/?p=44) and this kernel may have several bug fixes for non-SDHC (ie. MMC and SD) cards as well. Worth a shot, you have nothing to lose. :)

freeman
02-27-2007, 02:01 AM
I got the A-DATA 8GB SDHC work w/patched kernel no problem. Like fanoush said, you probably have a incompat card. But also, I got a question. When you format and reformat(mkfs.ext2) the card, install and reinstall over and over, have you ever make the partition from scratch, or try format it from the PC instead? As, corrupt partition table could get you the same problem, regardless of how many time you reformat the card.

DCr33P
02-27-2007, 06:10 AM
Yes I did that a few times. I bought a card-reader on saturday. I made new a new partition table, too. I even did a complete dd if=/dev/zero wipeout and then again made an new table, partitions and filesystems.

freeman
02-27-2007, 01:52 PM
Yes I did that a few times. I bought a card-reader on saturday. I made new a new partition table, too. I even did a complete dd if=/dev/zero wipeout and then again made an new table, partitions and filesystems.

Then, it's definitely time for a new card. At this point, SDHC is cheap, and it look like you know what you are doing, more space=more power to you, 8GB SDHC price isn't that much more than the 4GB SD card.

richie
02-27-2007, 07:08 PM
Will bootmenu still work with the proposed new feature from Nokia, lockdown (http://www.gossamer-threads.com/lists/maemo/developers/17663)?

Presumably it wouldn't as it is just a metapackage? And if no problems, you could have the lockdown mode in flash, then use bootmenu with red pill mode to experiment?

Rich

fanoush
02-28-2007, 04:16 AM
Will bootmenu still work with the proposed new feature from Nokia, lockdown (http://www.gossamer-threads.com/lists/maemo/developers/17663)?
Rich
Yes, it is not related. The initfs flasher is not an installable package. Also all installed packages live in the rootfs but bootmenu itself is installed elsewhere so package management does not apply to it.

I am thinking about installable package but the bootmenu initfs modification does have serious impact on the way system boots so I think it is better that the procedure is a bit more complicated. That way people are aware that they must be a bit careful and have time to think if the really want to do this or not. Currently by the time you have the menu installed there is high chance you actually learned what it does and what are the implications :-)

sapporobaby
02-28-2007, 10:33 AM
Oh ok... didn't think of that because it was discussed in this thread ;)
Advantages:

- Backup system on flash. If you brick your OS you can use your backup system.
- Faster booting. Jffs2 uses compression, so there is a big overhead which results in slower transfer rates and cpu usage. The filesystem on on your SD card can be ext2/ext3 etc.
- Extends your rootfs and you can install more than 256mb of applications.
- Testing system. Install an application on sd and test it. If everything works you ca finally install it on flash. So you can have a cleaner OS.
- ...

Hey DCr33P,

I read and re-read this thread and tried to get as much as I could but I am still stuck on the advantages. If I were able to boot from the MMC, would this still be the same as booting normally and then using the apps loaded or does this boot me into a special mode? I would assume that the Bootloader would reside on the MMC and facilitate this booting. Is this correct? I heard somewhere, here I think that Nokia will release an upgrade to the current OS version in a few weeks. If so, I may try the "boot from MMC" option and this way, if I brick my N800, I have no worries, as I can just upgrade the system. Does this make sense? By the way, I am using a Mac so I am not sure if some of these tools are compatible, or do I need a Windows/Linux box to try this?

DCr33P
02-28-2007, 01:13 PM
Ok, I will try to answer as much as I can:


If I were able to boot from the MMC, would this still be the same as booting normally and then using the apps loaded or does this boot me into a special mode?


It's like having two different operating systes. The one OS (the original) is stored on the internal 256 flash memory of the device. The other one is the cloned system from your flash, stored on mmc/sd. From the moment on, you clone your original system from flash to the mmc/sd card, you will have two identical and seperated systems. Then you can choose from the menu of the bootloader which one you want to start. Changes on the first operating system do not affect anything on the other one. The other way around, too.
Installing an application on the OS on the card leaves the internal OS untouched. One can interprete that "special mode" is the abillity to install as many applications as you want(...and can fit on mmc/sd card), to have faster system and to have superior backup/restore possibilities.
Backup would be very easy:
- Put your card in a card reader and copy the whole ext2 partition to you desktop machine. When something went wrong, just copy it back.
OR:
- mount your rootfs on your card to a second mountpoint and copy the whole mountpoint via tar/rsync through a ssh connection(or smb share/ NFS) remotely to everywhere you want.



I would assume that the Bootloader would reside on the MMC and facilitate this booting. Is this correct?

The bootloader is not on the mmc card, it's stored on internal flash.
Is it stored on /dev/mtdblock0 ???


I heard somewhere, here I think that Nokia will release an upgrade to the current OS version in a few weeks. If so, I may try the "boot from MMC" option and this way, if I brick my N800, I have no worries, as I can just upgrade the system. Does this make sense?


You can't brick your system with this dualbooting story. IMHO, the worst thing that can happen is that the flashing process of the bootloader goes wrong. But then, you can always reflash with the standard bootloader, theoratically. You will not loose any data. If everything works and you boot from SD-OS, then even flashing is not nessecarily, since you can easilly recover the whole system if you broke your OS. The chances that you ever definitlely brick your device are very very very very very low, unless you mess up with one of the early "bootloaders" of the system. But I think nobody did this...
If you brick your OS on the flash, then you can simply reflash. If you brick your kernel, you can simply reflash just the kernel...
Have to admit that I have never done this, cause I have not bricked my device, so far. But I got it only for 2 Weeks... the time will come... but that should be no big deal :D


By the way, I am using a Mac so I am not sure if some of these tools are compatible, or do I need a Windows/Linux box to try this?


I am using linux all the time, so I don't know how those WIN/MAC tools behave. A Linux Live-CD can solve all you problems, if you don't like to install Linux AND DUALBOOT :D

I hope I could answer a few points, since I live in Germany and there are only basic school-english-skills left, I hope it's understandable :rolleyes:

DCr33P
03-02-2007, 06:38 PM
Juheeeeeeeeeeeeeeee! Finally, it worked! :D
So I definitely know, COS EXTREMEMORY ain't good for the n800!
There are still some "problems":
While copying with gnu-tar I got somekind of an error at the end.
Tar "said" there were files from date 01.01.1970. I don't know if tar just stopped copying then, or if this was just a warning. Booting works, but perhaps some files are not copied, after all? ... I got not input/output or dmesg errors, that's the important part.
Second subject... I can't connect via usb and got the message "[..] unable to connect via usb[..] Memory cards in use: internal memory card". Somehow it's logical, cause my ext2 partition is used as rootfs by the system and can't be unmountend due to the usb connection process. But what's with my first fat32 partition on the card? It doesn't show up on my PC :( Only the 128mb nokia card in external slot can be accessed from PC.
Any ideas, how to solve this?

fanoush
03-03-2007, 03:22 AM
Tar "said" there were files from date 01.01.1970. I don't know if tar just stopped copying then, or if this was just a warning. Booting works, but perhaps some files are not copied, after all?

That's just warning, everything was copied.


Second subject... I can't connect via usb and got the message "[..] unable to connect via usb[..] Memory cards in use: internal memory card". Somehow it's logical, cause my ext2 partition is used as rootfs by the system and can't be unmountend due to the usb connection process. But what's with my first fat32 partition on the card? It doesn't show up on my PC :( Only the 128mb nokia card in external slot can be accessed from PC.
Any ideas, how to solve this?
Hmm, yes. I still don't have dualboot on N800 since I also bought card which currently doesn't work but I've read about something related. Check maemo mailing lists. Someone had opposite problem when booted from flash. He noticed that if he mounts ext2 partiton from mmc card and attaches USB it is unmounted too together with first FAT one. Looks like IT2007 tries to unmount all partitions on the card and probably if it fails, usb storage doesn't work. Someone pointed him to the script that does the unmounting. It needs to be modified to either skip ex2 partition used for booting or changed back to unmount just the FAT one as it was in IT2006.

DCr33P
03-03-2007, 06:16 AM
Thanks fanoush, I will check out maemo and have a look on the system to find this script. I have hope, again ;)
I also hope that your card arrives soon...I do fear buggy cards, right now....

fanoush
03-04-2007, 05:27 PM
found today when searching for something else
http://maemo.org/pipermail/maemo-users/2007-February/003431.html

ascherjim
03-21-2007, 11:31 AM
I have been booting from my MMC on my 770 for a long time now. But the question arises for me now that I'm about to receive my N800 with its two card slots: Will I have the option to boot from either of the card slot locations, or am I restricted to the internal one? And carrying this query a bit further: can I boot from both? The basis of this last query is whether there is the possiblity of having separate operating systems employing different window mangagers, one on each of the memory cards and opting which one to load with a further hacked opening menu (similar to what is possible with Grub)?

lbattraw
03-21-2007, 11:36 AM
I have been booting from my MMC on my 770 for a long time now. But the question arises for me now that I'm about to receive my N800 with its two card slots: Will I have the option to boot from either of the card slot locations, or am I restricted to the internal one? And carrying this query a bit further: can I boot from both? The basis of this last query is whether there is the possiblity of having separate operating systems employing different window mangagers, one on each of the memory cards and opting which one to load with a further hacked opening menu (similar to what is possible with Grub)?

Booting from a different slot is just a matter of specifying a different device in the bootmenu config file. You can boot from whatever slot/partition you like.

Larry

ascherjim
03-21-2007, 12:48 PM
Larry: Thanks for your quick response, which is both interesting and reassuring. But now (naturally) I have a few follow-up questions.

1) Regarding modifying the bootmenu.config file, I've gone into my "bootmenu.sh" file in my "initfs_flasher" directory on my 770 (both in flash and mmc) and as an experiement commented-out menu items which I thought superfluous. However, when rebooting, the initial menu came up with the same original selections. My commented-out "deletions" hadn't apparently taken hold.

2) In following Fanoush's current wiki on booting from the mmc, how do I designate which of the two N800 card slots I want to act upon in that particular execution of his hack? Once I've gotten operating systems on cards in both slots, then it's my understanding from what you say that I can then appropriately add them to the bootmenu config file (which I today have not been able to modify successfully on my 770). Thanks and regards, Jim

lbattraw
03-21-2007, 01:14 PM
Larry: Thanks for your quick response, which is both interesting and reassuring. But now (naturally) I have a few follow-up questions.

1) Regarding modifying the bootmenu.config file, I've gone into my "bootmenu.sh" file in my "initfs_flasher" directory on my 770 (both in flash and mmc) and as an experiement commented-out menu items which I thought superfluous. However, when rebooting, the initial menu came up with the same original selections. My commented-out "deletions" hadn't apparently taken hold.

Make sure you have the latest version of the bootmenu and only edit the bootmenu.config. Previously you only edited the script itself which was a little risky since you could potentially create an error in the script, stopping everything from booting.


2) In following Fanoush's current wiki on booting from the mmc, how do I designate which of the two N800 card slots I want to act upon in that particular execution of his hack? Once I've gotten operating systems on cards in both slots, then it's my understanding from what you say that I can then appropriately add them to the bootmenu config file (which I today have not been able to modify successfully on my 770). Thanks and regards, Jim
It's just a matter of specifying whichever mounted partition you want as the destination. You'll need to manually mount the partition of course, but then you use that directory you mounted to as the destination for the rsync or tar command (preferably using GNU tar since fonts get garbled in Opera otherwise). Hope this makes sense as I haven't checked the wiki in a while.

Larry

ascherjim
03-21-2007, 01:24 PM
Larry, on your answer to my question 1), I believe that I do have the latest version of the bootmenu. Where do I find the bootmenu.config if the bootmenu.sh was not the one I should have been modifying? On my question 2), on further thought I believe that it's not relevant which memory card slot I designate in copying/installing the flash operating system onto a card as I can perform the operation in whichever card slot Fanoush's wiki affects and then when I've installed on two cards using the same slot, I can then put one of the cards into the other slot and modify the bootmenu to give me the choice of either to boot from. Is this clear, and correct? Thanks again, Jim

fanoush
03-21-2007, 03:28 PM
Well, try to download recent version of the flasher, there is README and example configurations, that may answer your questions.

Now you can have optional bootmenu.conf along with bootmenu.sh. Real versions which are used while booting reside in /mnt/initfs. Either you can create it in flasher directory and reflash or edit directly in /mnt/initfs (which may produce disk full errors on N770 if you do it multiple times, check the README)

ascherjim
03-21-2007, 05:18 PM
Fanoush: As I only a few days ago downloaded and am using your latest flasher, and the README and sample bootmenu files are there,I'm satisfied that I'm OK in that regard. Also, now that you've pointed me to the directory where the bootmenu.conf file resides -- I couldn't locate it -- as opposed to the bootmenu.sh file, I think I will opt to go the route of modifying that rather than reflashing. This is anyway only experimentation on my 770 until my N800 arrives. Thanks and best regards, Jim

ascherjim
03-21-2007, 06:08 PM
Fanoush: You are right (of course). The /mnt/initfs diectory was full. I have also (belatedly, of course) read the README file, and from what I have now learned I believe that, again, "discretion being the better part of valor," I'll not proceed any further with my experimentation in this regard with the 770. I take it that there is insufficient space in the /mnt/initfs directory for me to configure my own bootmenu.conf file to use in place of the bootmenu.sh file that's currently there. I am even more eagerly now looking forward to receipt of my N800, which I have regretted having to purchase. Regards, Jim

fanoush
03-21-2007, 06:08 PM
Also the README is not clear about it, for customization you need to copy example to file named bootmenu.conf
cp bootmenu.conf.n800.example bootmenu.conf
and then edit it to your liking (i.e add your own ID and other parameters). The ID you choose can be used as root device for cal-tool or nokia flasher so it is preselected as default choice.

initfs flashing script searches for bootmenu.conf in current directory. If found it asks you if it should be added to final initfs image.

fanoush
03-21-2007, 06:28 PM
The /mnt/initfs diectory was full.
Yes if you opted to not to remove extra stuff. But still you can prepare the file and let the flasher script include it in final image. That way it should fit even when not removing the extra stuff. You just can't modify it later (without reflashing initfs again). If extra stuff it removed (and it really is not so important and you can get it back from backup image or original firmware) then you can edit it directly in /mnt/initfs couple of times. With editing bootmenu.sh inplace (which is much larger) I think I did it like 5 times until I saw error and got the file truncated, bootmenu.conf is smaller so it should be better. I can no longer test this limit since I enlarged initfs partition and shrinked rootfs in some experiment and don't know how to get back to smaller size. I like bigger initfs partition but cannot test this 'initfs almost full' situation with n770 properly anymore.

ascherjim
03-21-2007, 08:04 PM
Fanoush: Thanks for the excellent advice in this matter, which I will be following up on. Two other matters:

1) Your README has a slight but possibly misleading typographical error:

ROOT DEVICE

"root device can be set either by linux flasher on PC over USB cable"

Shouldn't that "on" be "or"?

2) In your instructions for booting from MMC, you state:

"The first time I tried this on my N800 it led to continuous reboots 30-90 seconds after booting. Trying it a second time on a clean install (directly after flashing and erasing everything already on the device) worked fine."

Does this mean that you don't recommend installing various applications on the flash operating system (i.e., kbdd, fbreader) prior to copying it to the MMC, which would be a means of saving having to reinstall such applications second times in both (or more) operating systems?

SeRi@lDiE
03-21-2007, 09:32 PM
Fanoush:
2) In your instructions for booting from MMC, you state:

"The first time I tried this on my N800 it led to continuous reboots 30-90 seconds after booting. Trying it a second time on a clean install (directly after flashing and erasing everything already on the device) worked fine."

Does this mean that you don't recommend installing various applications on the flash operating system (i.e., kbdd, fbreader) prior to copying it to the MMC, which would be a means of saving having to reinstall such applications second times in both (or more) operating systems?

Yea I wanted to ask the same question... I am sort of experiencing the same issue... So that means I am going to need to reflash my device and recopy my fs...

SeRi@lDiE
03-21-2007, 09:56 PM
I also try to install applications and I was unable to it keept giving me errors... I am going to try a fresh install later today..

fanoush
03-22-2007, 04:51 AM
1) Your README has a slight but possibly misleading typographical error:

ROOT DEVICE

"root device can be set either by linux flasher on PC over USB cable"

Shouldn't that "on" be "or"?

no, linux flasher runs on the PC and uses USB cable to communicate with the tablet. Second option is cal-tool which runs directly on the tablet. Is using 'on' OK in this context or is using 'in' or something else better?

2) In your instructions for booting from MMC, you state:

"The first time I tried this on my N800 it led to continuous reboots 30-90 seconds after booting. Trying it a second time on a clean install (directly after flashing and erasing everything already on the device) worked fine."

In fact this sentence is not mine. This is Wiki, anyone can edit it including you. You can click 'Get Info' link on wiki page and then select versions and click 'Diff' to see who added what.


Does this mean that you don't recommend installing various applications on the flash operating system (i.e., kbdd, fbreader) prior to copying it to the MMC, which would be a means of saving having to reinstall such applications second times in both (or more) operating systems?
I haven't seen this issue on my device yet so I guess it is safe to clone the system anytime (and I do it like this). If the system boots OK from flash it should in theory boot also from mmc if the copy is exact (i.e. no mistake is made while cloning). This theory works for me on N770 both with IT2006 and also IT2007 (hacker edition) which is made from N800 firmware. I still don't have big card for my N800 so I'm not sure how cloned system works on real device. There may be differences due to two mmc slots (which is not same as N770 with IT2007).

I know some people reported this reboots after cloning but it can still be some mistake when doing it. Or it can be also some specific installed application which does this. I guess Canola does some funny things with the device but I never installed it so I don't know for sure. Maybe it is related to scanning mmc cards for media files after boot.

ascherjim
03-22-2007, 09:15 AM
Fanoush: You've provided us with lots of good information to think about, and act on as appropriate

1) "Is using 'on' OK in this context or is using 'in' or something else better?"

Thanks for the clarification here. Now that I understand it better, I believe that the issue does not concern whether "on", "or" or "in" would be better, but rather the use of the word "either." I assumed that you meant "or" because of the "either." Am I making myself sufficiently clear here?

2) "I haven't seen this issue on my device yet so I guess it is safe to clone the system anytime.... If the system boots OK from flash it should in theory boot also from mmc if the copy is exact (i.e. no mistake is made while cloning).... There may be differences due to two mmc slots...."

As you haven't had opportunity yet to pursue this issue of a large card and the N800's two slots, I will be experimenting with all this when I get my N800 and report back to you and the forum, and no doubt also seek further advice. From what I can make out from your README, I could possibly also have multi "distros" on just one card (if big enough) and boot to each of their separate ext2 partitions from your boot menu, and wouldn't even need to effect this with separate cards. Anyway, much to consider. Thanks again. Regards, Jim

fanoush
03-22-2007, 09:46 AM
Now that I understand it better, I believe that the issue does not concern whether "on", "or" or "in" would be better, but rather the use of the word "either." I assumed that you meant "or" because of the "either." Am I making myself sufficiently clear here?
There is "or" . The full sentence is
"root device can be set either by linux flasher on PC over USB cable <step how to do it> or directly on device via cal-tool command <step how to do it>"
Maybe it is just too long and complex for one sentence.

ascherjim
03-22-2007, 10:13 AM
Fanoush: I've looked again at the README file and discovered the reason for my confusion regarding use of the word "either." You quote the sentence as:

"root device can be set either by linux flasher on PC over USB cable <step how to do it> or directly on device via cal-tool command <step how to do it>"

The fact that the <step how to do it> instructions occur on separate lines caused me to not read the ROOT DEVICE instruction as an intregal sentence. Sorry.

Also, presumably while you were sleeping last night (and I have to assume that you do sleep, though it's not always apparent from your prompt responses on the forum), I did try out your clarified instructions for copying the "bootmenu.conf.n770.example" file to "bootmenu.conf," which I then customized and reflashed, and the whole process worked fine on my 770. It was quite easy. Thanks again.

DCr33P
03-23-2007, 10:04 AM
Guys, how can I flash a new image to my initfs on SD card and not on internal flash? Now, that the new firmware is out I want to flash only my SD card to test the new firmware, first. Flasher-3.0 has some options I guess could accomplish that: -set-root-device maybe? With this flag I can choose whether to boot from mmc or flash, independent of the bootloader. But actually, I have no idea :D

fanoush
03-23-2007, 10:30 AM
It is not possible. Was already asked and answered (maybe even it this thread). Reason is - you only have rootfs part on your SD/MMC card. bootloader,kernel and initfs is still in your flash.

In theory you can extract just the rootfs from the firmware and copy it to card but you'll miss changes in other parts of newer firmware (bootloader,kernel and initfs) and the result may not boot at all. In some special versions it can work (2006.39 and 2006.49 on N770 is sufficiently similar and work) but generally no.

ascherjim
03-23-2007, 05:41 PM
Fanoush: You may recall that earlier in this thread I queried you regarding the following quote from your Wiki on booting from MMC:

"The first time I tried this on my N800 it led to continuous reboots 30-90 seconds after booting. Trying it a second time on a clean install (directly after flashing and erasing everything already on the device) worked fine."

You subsequently informed me that this was not your cautionary observation but that of some later contributor to the Wiki.

I have now received my N800, loaded it up with all sorts of applications, books, etc., then following your Wiki attempted to transfer the whole kit-and-kaboodle to MMC2 – with complete success! (It was a process which I had already successfully implemented on several occasions with my 770.) The only divergence I had to make from your detailed instructions – and that was in a direction you anticipated might be necessary, which it was, to wit: “Altering the command involving N800 requires loading mbcache.ko before ext2.ko. Modules may be in some other folder than "current". Just look for it.” I was able to find it nearby and all then went well.

When I did all this on my N800, I had 2GB cards in both the internal and exterior slots. The card that was effected in the operation turned out to be the one in the internal slot. Now I need to ask what simple modifications to your Wiki instructions are required to do the same thing with the card in the external slot (which I believe is designated as mmc12)?

Specifically I need to know how to modify the following commands:

# apt-get install e2fsprogs
# umount /media/mmc1
# umount /media/mmc2 (for N800 only!)
# sfdisk /dev/mmcblk0
/dev/mmcblk0p1:1,15000,6
/dev/mmcblk0p2:15001,,
/dev/mmcblk0p3:
/dev/mmcblk0p4:

# mkdosfs /dev/mmcblk0p1
# shutdown -r now

# mke2fs /dev/mmcblk0p2
# shutdown -r now

# insmod /mnt/initfs/lib/modules/current/ext2.ko (preceded by the deviation I cite above)
# mount /dev/mmcblk0p2 /media/mmc2

This has proved to be a relatively easy and satisfying process and my earlier modifying of the bootmenu.config file, in follow-up to your instructions, also worked well. Anyway, again, many thanks. Jim

SeRi@lDiE
03-23-2007, 11:03 PM
Fanoush: You may recall that earlier in this thread I queried you regarding the following quote from your Wiki on booting from MMC:

"The first time I tried this on my N800 it led to continuous reboots 30-90 seconds after booting. Trying it a second time on a clean install (directly after flashing and erasing everything already on the device) worked fine."

You subsequently informed me that this was not your cautionary observation but that of some later contributor to the Wiki.

I have now received my N800, loaded it up with all sorts of applications, books, etc., then following your Wiki attempted to transfer the whole kit-and-kaboodle to MMC2 – with complete success! (It was a process which I had already successfully implemented on several occasions with my 770.) The only divergence I had to make from your detailed instructions – and that was in a direction you anticipated might be necessary, which it was, to wit: “Altering the command involving N800 requires loading mbcache.ko before ext2.ko. Modules may be in some other folder than "current". Just look for it.” I was able to find it nearby and all then went well.

When I did all this on my N800, I had 2GB cards in both the internal and exterior slots. The card that was effected in the operation turned out to be the one in the internal slot. Now I need to ask what simple modifications to your Wiki instructions are required to do the same thing with the card in the external slot (which I believe is designated as mmc12)?

Specifically I need to know how to modify the following commands:

# apt-get install e2fsprogs
# umount /media/mmc1
# umount /media/mmc2 (for N800 only!)
# sfdisk /dev/mmcblk0
/dev/mmcblk0p1:1,15000,6
/dev/mmcblk0p2:15001,,
/dev/mmcblk0p3:
/dev/mmcblk0p4:

# mkdosfs /dev/mmcblk0p1
# shutdown -r now

# mke2fs /dev/mmcblk0p2
# shutdown -r now

# insmod /mnt/initfs/lib/modules/current/ext2.ko (preceded by the deviation I cite above)
# mount /dev/mmcblk0p2 /media/mmc2

This has proved to be a relatively easy and satisfying process and my earlier modifying of the bootmenu.config file, in follow-up to your instructions, also worked well. Anyway, again, many thanks. Jim

Please let me know if you can install any new software from your back up?!?
I did manage to make a exact copy of my OS before with all the applications installed... But When I boot to the back up I try to install new software and it failed.... I replicated the issue 3 Times... Can you try it and see if you can install new applications.

Thank You.

ascherjim
03-24-2007, 01:12 AM
In response to your query, I have just installed Vim using the Application Manager on my MMC2 back-up with no problem at all. This seems to be working just as successfully as my similar MMC2 back-ups on my 770. I regret I can offer no insight to your difficulties, but hopefully some other member(s) of the forum can. Good luck. Jim

SeRi@lDiE
03-24-2007, 01:20 AM
Is ok I am not looking for a solution I just wanted to see what you did different and it seems to me there is nothing different.... I have a fresh tar that I am using and is working perfect for OPEN-ROX ;)

Thank You.

SeRi@lDiE
03-24-2007, 02:28 AM
fanoush is there going to be a update for for the new kernel?
TIA :)
Sorry I had to ask :P

fanoush
03-24-2007, 10:23 AM
Updated for 3.2007.10-7.

Yesterday I got 4GB card for my N800 so I have finally tried it too. I cloned older N800 firmware to mmc and then upgraded flash to latest one and updated bootmenu. Both systems boot now. Also experienced 'keys not working in menu' situation with older firmware. Now I cannot make it in newer one. Let's hope it is gone.

One nasty thing (at least in older firmware) is the 'metalayer-crawler' process which indexes mmc cards after each boot. This slows booting and make device less responsive couple of minutes after each boot (I have ~700MB of MP3 files on first FAT partiton). Maybe this background scanning also causes reboot issue some people reported. I hope it can be disabled somehow and run it only if I really add some new media files to my card.

penguinbait
03-24-2007, 11:23 AM
Fanoush, I added "exit 0" to the second line in metalayer crawler, alternately you only need to remove /etc/rc2.d/S99metalayer-crawler0

If you want to run it to actually index your files you can run

/etc/init.d/metalayer-crawler0 start

and

/etc/init.d/metalayer-crawler0 stop

to stop it. I agree there should be a setting in the media player to force a index when you update your file.

SeRi@lDiE
03-24-2007, 02:43 PM
Thanks! :)

richie
03-24-2007, 02:55 PM
Updated for 3.2007.10-7.
Also experienced 'keys not working in menu' situation with older firmware. Now I cannot make it in newer one. Let's hope it is gone.

Hi Fanoush

Thanks for the update. Sorry what do you mean "cannot make it in newer one" Do you mean it doesn't matter now if you touch the keys on booting, the menu will always work the new firmware? Or is there a new problem?

Cheers
Rich

SeRi@lDiE
03-24-2007, 03:04 PM
I fix the no key issue by setting it to "ask"

fanoush
03-24-2007, 03:27 PM
Do you mean it doesn't matter now if you touch the keys on booting, the menu will always work the new firmware?
Yes, works fine now. I can't make it to fail. Either it is gone or I was just lucky so far. Which keys triggered it, all ones? Tried some and it works.

fanoush
03-24-2007, 05:56 PM
I can't connect via usb and got the message "[..] unable to connect via usb[..] Memory cards in use: internal memory card". Somehow it's logical, cause my ext2 partition is used as rootfs by the system and can't be unmountend due to the usb connection process. But what's with my first fat32 partition on the card? It doesn't show up on my PC :( Only the 128mb nokia card in external slot can be accessed from PC.
Any ideas, how to solve this?

Now I got bitten by this too. Workaround is to edit file
/usr/sbin/osso-mmc-umount.sh (as already mentioned here http://www.internettablettalk.com/forums/showpost.php?p=37640&postcount=123 )
and change one line 'umount $mp 2> /dev/null' in this loop
for mp in $MPS; do
umount $mp 2> /dev/null
RC=$?
if [ $RC != 0 ]; then
echo "$0: could not unmount $mp"
exit $RC
fi
done

to be
for mp in $MPS; do
if [ "$mp" != "/" ] ; then umount $mp 2> /dev/null ; fi
RC=$?
if [ $RC != 0 ]; then
echo "$0: could not unmount $mp"
exit $RC
fi
done


Which means skip unmounting root filesystem. If you don't write to same filesystem (i.e the active linux partition) over usb, it is safe. Most probably you just want to write to first FAT partition anyway.

ascherjim
03-24-2007, 06:15 PM
Hey, I was just about also to raise this issue with you, as I've also just experienced the problem, with my immediate quick-and-dirty go-around being to boot from flash in order to access the internal card's fat16 partition rather than from MMC2. I'll certainly now implement your fix.

ascherjim
03-25-2007, 12:03 AM
Fanoush: As an experiment, I removed my bootable MMC2 card from the internal card slot and put it into the external slot and tried to boot from there using the bootmenu.config file which I'd copied from your bootmenu.config sample. But my N800 wouldn't boot from that slot. Is there a further modification I need to make to my bootmenu.config file, or is there something intrinsic to the configuration of the flash operating system on my MMC2 card which would only let it boot from the internal slot? I do want eventually to be able to also boot from the external slot. Is this actually possible?

fanoush
03-25-2007, 05:23 AM
This is some bug/feature of linux kernel. At boot time it assigns first nonempty slot as mmcblk0. This means that if you have only card in external slot then the 'first/internal' boot item works. If you have both card slots filled and the one to boot in in the external slot then use the 'second/external' item (not tried but I suppose it will work).

Most probably it is a real bug since when the system is booted naming of the slots is corrected i.e. when you boot from card in external slot named (wrongly) at boot time mmcblk0 the result printed by df is that you booted from mmcblk0p2 and have first FAT partition mounted called mmcblk1p1. But both partitions are on the same card :-) I guess it is just cosmetic issue but maybe it can confuse some parts of the system so the best is to avoid booting from external card when internal slot is empty.

ascherjim
03-25-2007, 07:35 AM
Fanoush: To clarify what I did: Having switched the cards, putting the bootable one in the external slot (and the unconfigured one in the internal slot), when the boot menu came up I chose the MMC12 item (which I'd adapted from your sample bootmenu.config), and it didn't work. If I were to partition the unconfigured card, following your wiki instructions, but change the MMC2 designation to MMC12 (and possibly the MMC1 to MMC11), could that make it work? (Of course, I'm way out of my depth here!) Regards, Jim

ascherjim
03-25-2007, 08:02 AM
Fanoush: I GOT IT TO WORK! I rechecked my bootmenu.conf file in /mnt/initfs and noted that I had inadvertently retained an ext3 designation from your example file when I adapted it. I changed that (second) designation to ext2, put my bootable card once again in the external slot, the unconfigured card in the internal slot, then when booting up I chose the external menu item, and it booted fine. Sorry to have troubled you. Now, when I format the unconfigured card, I'll do it from the internal slot, then switch it to the external slot when the configuration is entirely finished. I'm assuming that I'm not going to be able to configure it in the external slot (unless I leave the internal slot empty???). Thanks again, Jim.

Keyser.Soze
03-27-2007, 11:08 PM
It's my second week of owning the N800 and as much as l have grown to love it, I was a bit reluctant to try the bootmenu procedure because I haven't used Linux in so many years. After flashing the N800 with the latest OS that came out over the weekend, I finally spent some time last night to get it to boot from mmc. I used a Sandisk Ultra II 2GB card and followed the instructions. It took a while but it worked like a charm after the reboot. Now I have more than 1GB of free memory to use and it boots up fast! Faster than from flash as I remembered. The Sandisk Ultra II is not the fastest card around (I think around 60X or a bit more than that) and it's already giving me pretty impressive performance. I can imagine how it would be like using a 150X card. :)

SeRi@lDiE
03-27-2007, 11:45 PM
It's my second week of owning the N800 and as much as l have grown to love it, I was a bit reluctant to try the bootmenu procedure because I haven't used Linux in so many years. After flashing the N800 with the latest OS that came out over the weekend, I finally spent some time last night to get it to boot from mmc. I used a Sandisk Ultra II 2GB card and followed the instructions. It took a while but it worked like a charm after the reboot. Now I have more than 1GB of free memory to use and it boots up fast! Faster than from flash as I remembered. The Sandisk Ultra II is not the fastest card around (I think around 60X or a bit more than that) and it's already giving me pretty impressive performance. I can imagine how it would be like using a 150X card. :)

Is FAST!!! I cean hear it roaring!
LOL JJ :P
Any wais the bar goes about half way and the OS starts is ok...

Keyser.Soze
03-28-2007, 05:40 AM
Encountered the first problem since booting from mmc. The Application manager can't seem to refresh the application list now. When I launch the application manager I get a pop-up error saying "Operation failed". If I manually refresh the package list, it will give me "Unable to refresh list. Last refreshed list is shown." :(

Any suggestions? Can I restore partially from a previous backup?

BTW I booted from flash and the application manager works fine there.

Thanks in advance for any help!

Update: I tried "apt-get update" and got the following error:

E: Malformed line 21 in source list /etc/apt/sources.list (dist parse)

Update 2: I booted from flash, and copied the sources.list to the external SD card. Then I booted back to mmc and overwrote the file with the one I just copied to the SD card. Seems to be ok now. :)

jcostantino
03-28-2007, 12:31 PM
I'm stuck trying to get the new initfs flashed onto my N800.

I downloaded initfs_flasher.tgz on my SD card, opened up Osso-Xterm and unpacked the archive (initfs_flasher.tgz), changed to the initfs_flasher directory and tried to run the initfs_flash script but it gives me a Permission Denied error. So I did a "sudo gainroot," verified I was root, and got the same error. After that, I installed Dropbear server, SSHed in as root, ran the script again, and got "Permission Denied" again.

The only time I get a different result is when I just type "sudo ./initfs_flash" and no error message occurs, just a command prompt.

Am I doing something wrong? From what I gather, I've followed all the directions 100%.

It seems as though just typing "./" is causing the problem - I'm using the built in Busybox (v1.1.3) shell, is that correct? I've looked around and haven't found any information that says a different shell is necessary.

SeRi@lDiE
03-28-2007, 12:48 PM
First make sure you are running it in the user directory like /home/user/MyDocs/.documents/initfs_flasher and not your mmc... You can not run applications from mmc... If you are still having the problem do from xterm...

chmod +x initfs_flash

And no you dont need a different shell :)

jcostantino
03-28-2007, 01:21 PM
Doh, that's just me being stupid... can't run things from FAT partitions... :) I'd imagine this will work when I try it after lunch.

First make sure you are running it in the user directory like /home/user/MyDocs/.documents/initfs_flasher and not your mmc... You can not run applications from mmc... If you are still having the problem do from xterm...

chmod +x initfs_flash

And no you dont need a different shell :)

jcostantino
03-28-2007, 04:09 PM
Ok, after many pitfalls and my own personal Linux ignorance, I think I'm on my way here...

I had to really dig for this information, I think it should be added into the first post in this thread since it is VERY relevant:

Where the directions say "insmod /mnt/initfs/lib/modules/current/ext2.ko" I had to do the following:

a. insmod /mnt/initfs/lib/modules/2.6.18-omap1/mbcache.ko
b. insmod /mnt/initfs/lib/modules/2.6.18-omap1/ext2.ko

I screwed up and used the BusyBox tar instead of GNU tar. I got all the way through the copying of my almost full flash and got the reboot cycle, The GNU tar seems to be working better since the paths are in some cases two full terminal lines long.

I would never have done this if there wasn't an SSH client available! I love the N800, it's a great little piece of hardware - but it is miserable for text entry!

I made a swap partition when I did my SD card partitioning - is there a procedure to use that instead of the FAT partition? I sacrificed the size of the FAT volume (512) for my ext2 partition (the balance of 2 gb) and figured it would be good to use a swap partition instead of a swap file.

It's nice to see 826 megs free. Plus, it seems that Flash Video runs faster!

ascherjim
03-28-2007, 04:58 PM
I also had to resolve this issue when I myself performed this function, as I pointed out earlier in this thread:

[QUOTE= Where the directions say "insmod /mnt/initfs/lib/modules/current/ext2.ko" I had to do the following:

a. insmod /mnt/initfs/lib/modules/2.6.18-omap1/mbcache.ko
b. insmod /mnt/initfs/lib/modules/2.6.18-omap1/ext2.ko [/QUOTE]

However, to give credit to Fanoush, he pointed out that this might be necessary in his Partitioning wiki (cited in his Root/MMC wiki). This was apparently before he himself had a N800 and he wasn't certain if this would be required (as it was). I expect it might be useful for someone now to correct both wiki's, to save those who come after us the trouble of sorting it out afresh.

jcostantino
03-28-2007, 09:49 PM
I do believe your post is where I got the information from, just figured I'd repeat it to make it more likely to be seen.

I'm amazed that this tiny little thing can actually run KDE! I had to leave it at work because I was tired of looking at it today :) when I left, it was booting into the K desktop.

I was really nervous that I'd screw something up when reflashing the bootloader but everything came out great and I only had a couple minor "do-overs" to deal with. This forum is a huge help, especially since my Linux knowledge is the bare minimum! It amazes me that such a tiny device can do so much!

I also had to resolve this issue when I myself performed this function, as I pointed out earlier in this thread:



However, to give credit to Fanoush, he pointed out that this might be necessary in his Partitioning wiki (cited in his Root/MMC wiki). This was apparently before he himself had a N800 and he wasn't certain if this would be required (as it was). I expect it might be useful for someone now to correct both wiki's, to save those who come after us the trouble of sorting it out afresh.

ascherjim
03-28-2007, 10:19 PM
If you should find you have any trouble loading KDE, obviously refer to this site under Apps: KDE 3.5.6 Available. Good luck. Regards, Jim

fanoush
03-29-2007, 04:10 AM
However, to give credit to Fanoush, he pointed out that this might be necessary in his Partitioning wiki (cited in his Root/MMC wiki). This was apparently before he himself had a N800 and he wasn't certain if this would be required (as it was). I expect it might be useful for someone now to correct both wiki's, to save those who come after us the trouble of sorting it out afresh.
I think it is third time I'm mentioning this but this is a wiki so anyone can edit it and anyone in fact does. Two times before I also explained how to see who added what to the wiki so one can give proper credit if he wants. The sentence about mbcache and n800 in http://maemo.org/maemowiki/HowTo_BootRootFSFromMMC is not mine so the credit should go to someone else. Also feel free to fix it if you feel something is not clear enough and you know how to make it more clear. In fact this is what Sebastian did with his 'EASILY' guides like this http://maemo.org/maemowiki/HowTo_EASILY_Boot_From_MMC_card (also not mine :-).

ascherjim
03-29-2007, 10:35 AM
Fanoush: Sorry. Since both had your name at the bottom as the last person to edit, I made the (erroneous) assumption that you were the one primarily responsible and to whom to give primary credit. Didn't mean to offend, or slight another contributor. It won't happen again, at least from me.

tolou
05-09-2007, 04:11 AM
Well needless to say Iīve encountered the infamous endless reboot loop on that partition... :mad:
Is there a way to clear the lifeguard reset flag on a mmc partition?

fanoush
05-09-2007, 04:33 AM
Well needless to say Iīve encountered the infamous endless reboot loop on that partition... :mad:
Is there a way to clear the lifeguard reset flag on a mmc partition?
No it is not property of any partition, it is global flag. Also it can only be set via flasher over usb (i.e. not possible from device itself). You can still boot internal flash and fix mmc from the device or fix it with linux computer and card reader if you know what is broken. Or one can just backup data and start from scratch. Also if you use ext2, e2fsck might fix something.

How does your endless reboot loop look like i.e. when exactly it reboots and what is on the display?

tolou
05-09-2007, 05:05 AM
The progressbar is stopping at 1/4:th with the NOKIA splash screen. (I can hear a faint "fizzling" sound from the unit). Reboots after some 5 secs.

GeerGuy
05-12-2007, 02:33 PM
I read through this entire thread and all the info in the wiki, and basically everything worked out fine. It is faster. I do have a few questions though.

1) I have a 4GB (non-SDHC) in the internal slot, this is the only card. When I partitioned the card this is what I did:

# sfdisk /dev/mmcblk0
/dev/mmcblk0p1:1,100000,6
/dev/mmcblk0p2:100001,,
/dev/mmcblk0p3:
/dev/mmcblk0p4:

I expected to get a VFAT of 3.2GB and the rest for LINUX_83, but the VFAT maxed out at 2GB.

Is there a way that I can use the rest of the 4GB card? either make another VFAT partition, or better yet, increase the 2GB to the 3.2GB? I am not that familar with Linux and can not figure it out from the man pages. Is there a Windows util/prog that I could use for this?

2) I setup 128 MB of virtual mem in the VFAT partition. When I plug in the USB it says that "Unable to connect via USB. Memory card in use: Internal memory card" Is this normal when booting from MMC? The internal card is not accessible again until I reboot. I would like to be able to access the VFAT partition on this card with USB.

Thanks

GeerGuy
05-12-2007, 05:10 PM
I fixed my first problem by re-formating the VFAT partition to FAT32 in Windows. I now have 3.05GB of space to use.

After removing the .swap file, I still have the same problem outlined in 2) above. Once the USB cable is plugged in I lose access to the internal memory card. Since the removable card can not be accessed by USB it is kind of a pain to have to remove the internal memory card to put data on it.

Is this normal when booting from mmc?

Thanks...

fanoush
05-13-2007, 01:58 AM
Once the USB cable is plugged in I lose access to the internal memory card. Since the removable card can not be accessed by USB it is kind of a pain to have to remove the internal memory card to put data on it.

Is this normal when booting from mmc?

See post #154 two pages back for solution.

debernardis
05-14-2007, 06:38 AM
When at the tar step, I had no problem with a 2GB Kingston RS-MMC. When I try on a 4GB Transcend SD card, tar always stalls at a random point and I have brutely to reboot (extract battery). This won't likely be healthy for my device. Any hint?

EDIT: the last time I tried, it bricked by n800 and had to reflash :(

SOLVED: for some strange reason it has been necessary to avoid verbose output of the tar extracting part, so it works with "tar xf" instead of "tar xvf". :cool:

GeerGuy
05-25-2007, 10:14 AM
I following this thread and the informations in the wiki and got the booting from MMC working great. I have been using and setting up my device for the last few weeks and I have it just the way I want it.

If/when there is new firmware, will I have to go through this procedure again and start with a clean system or is it possible to upgrade and keep all the installed programs and setting?

torx
05-31-2007, 12:37 AM
Alright, i need some pointers here.

I followed the procedures and had everything set up properly. However, when i boot up using the MMC partion, it works fine for about 30s and reboots.

So this morning, i reflashed the firmware, installed dbserver and xterm, and followed the procedures again. Same thing, works fine for 30s and reboots.



Doubt this will make any difference, but i used the tar program that came along with the latest firmware. It was there by default, never had to install it despite what the instructions said.

fanoush
05-31-2007, 03:22 AM
Doubt this will make any difference, but i used the tar program that came along with the latest firmware. It was there by default, never had to install it despite what the instructions said.
Well there is a reason for using GNU tar and it is documented in the wiki. It it precisely because default tar makes incomplete copy and causes reboot like you described.

fanoush
05-31-2007, 03:40 AM
If/when there is new firmware, will I have to go through this procedure again and start with a clean system or is it possible to upgrade and keep all the installed programs and setting?
Yes, you need to start with clean system.

If newer firmware is similar to older one you can boot both systems and decide which one you keep, so far this was true with most (or all?) n and n+1 firmwares released but it is not rule or course. Also you can later recover data from older system if you forget to backup something. Personally I like the opportunity to start from scratch since my system accumulates some garbage over time.

In fact it would be relatively easy to copy over all user installed software from older system. I'm not sure it is always good idea but mostly it may be useful. It can be done by scanning things in /var/lib/dpkg on old system, reconstructing original packages (package details are in /var/lib/dpkg/info) and reinstalling automatically on new system.

torx
05-31-2007, 09:16 AM
Well there is a reason for using GNU tar and it is documented in the wiki. It it precisely because default tar makes incomplete copy and causes reboot like you described.

Damn right you are! I've got it working now after using GNU tar!

Many thanks for you help and your contribution to our community!

penguinbait
05-31-2007, 02:00 PM
Alright, i need some pointers here.

I followed the procedures and had everything set up properly. However, when i boot up using the MMC partion, it works fine for about 30s and reboots.

So this morning, i reflashed the firmware, installed dbserver and xterm, and followed the procedures again. Same thing, works fine for 30s and reboots.



Doubt this will make any difference, but i used the tar program that came along with the latest firmware. It was there by default, never had to install it despite what the instructions said.

Yes tar is there by default on all firmware, but it is busybox not genuine GNU tar. Follow the instruction completely ie: use GNU tar and see if that fixes your problem. busybox tar will not copy everything.....

re2st
06-27-2007, 12:47 PM
Hello,

So I've been enjoying dual boot from MMC Ext2 for the last couple of days. Today, my N800 died on me cause it was out of battery. When I plugged in the charger, it gave me the usual boot menu, and I chose MMC Ext2. But then, it keeps rebooting over and over again (with boot menu appears each time).

I then booted into Internal Flash, did the fsck -fy /dev/mmcblk0p2 thing, and rebooted. Now it doesn't give me the boot menu anymore! It boots right into my Internal Flash!

Any idea why? What should I do to fix it?

Thanks!

seattleweb
07-15-2007, 05:24 PM
Questions....

I have spent the last couple of hours trying to set up my N800 to boot from an external 1GB SD card following the instructions on this page: http://maemo.org/community/wiki/HowTo_EASILY_Boot_From_MMC_card

When I attempt to boot from the mmc it boots from flash (without informing me that it is booting from flash)

When I attempt to boot from 2nd partition on mmc ext2 it gives me an error and reverts to the flash boot.

The instructions on post #1 of this thread show the command prompt of an N770. I have had some problems with the directions as they aren't detailed (i.e. using the GNU tar... is one suppose to overwrite the tar in /bin/? ). Also, the syntax for vi'ing vi /mnt/initfs/bootmenu.sh are kind of sketch, as it instructs:

Change the line
GETKEY="evkey -u -t 1000 /dev/input/event1"
to
GETKEY="evkey -u -t 1000 /dev/input/event2"

The actual line in my bootmenu.sh reads:

GETKEY="evkey -u -t 1000 /dev/input/${EVNAME}" ... aparently a variable for event.

So the question I have is, which one of these tutorials is the correct one for booting from an mmc? This thread or the the actual Maemo wiki? And what things need to be done differently for an n800 setup on an EXTERNAL mmc (besides the obvious mmcblk1p1, etc)?

seattleweb
07-15-2007, 06:42 PM
Like an idiot, I had a typo in bootmenu.conf .... :eek:

(Thanks rwhitby on IRC for the help... Coopers Pale Ale it is)

bunanson
07-15-2007, 10:42 PM
Hello,

So I've been enjoying dual boot from MMC Ext2 for the last couple of days. Today, my N800 died on me cause it was out of battery. When I plugged in the charger, it gave me the usual boot menu, and I chose MMC Ext2. But then, it keeps rebooting over and over again (with boot menu appears each time).

I then booted into Internal Flash, did the fsck -fy /dev/mmcblk0p2 thing, and rebooted. Now it doesn't give me the boot menu anymore! It boots right into my Internal Flash!

Any idea why? What should I do to fix it?

Thanks!


Reboot with the N800 unplug.

Hope this helps.

bun:D

terrencegf
07-27-2007, 02:41 PM
Thought I'd add my 2 cents...

I just got an N800. I updated to the latest firmware (4.2007.26). I bought this A-Data 8gb SDHC (Class 6) card from newegg: http://www.newegg.com/Product/Product.aspx?Item=N82E16820211180

It worked just fine as a FAT32 card in either slot. I tried to use it to boot from mmc using the tutorial here (and elsewhere). I tried various partition sizes for the DOS and the ext2 partitions. I tried both FAT16 and FAT32 for the DOS partition. Nothing worked. I could copy the root filesystem over just fine, and even mount it and see the files. But when I tried to boot from it, it would fail and then boot to internal flash. I also tried updating the kernel to the patched version that allows for faster access to the mmc cards. No difference.

Then I tried this Transcend 4gb SD card from newegg: http://www.newegg.com/Product/Product.aspx?Item=N82E16820163159

I made the DOS and ext2 partitions the same size (approx 1.9G) and formatted the DOS partition FAT16. NOW I was able to successfully boot from the internal mmc card.

So, I don't know WHY the 8gb SDHC card didn't work. I think I saw one report of another user getting an A-Data 8gb SDHC to boot, but perhaps he/she had a different model (maybe Class 2?). Anyway, I'd be interested to hear if others have had success with other brands of 8gb SDHC cards. For now I guess I'll have to stick with the 4gb SD card.

re2st
07-27-2007, 03:34 PM
Here (http://cgi.ebay.com/ws/eBayISAPI.dll?ViewItem&rd=1&item=270142149584&ssPageName=STRK:MEWN:IT&ih=017)is where I got my 2 8GB SD cards.

I partitioned 2GB for FAT32 and the rest for FAT16.

All works fine, no problem whatsoever. I have done this several times (literally several times, reformat, repartition, reflash and so on). I have also tried both pre- and post- SDHC patch. The pre-SDHC patch did a little weird thing for me, at some point (after I installed and uninstalled a bunch of apps, I couldn't install and/or uninstall anything when I boot from the Ext2 ), hence I patched and re-flashed and did the whole dual boot thing all over again.

Works fine now, except that I notice a little "loss" on the capacity of the card (it says 5GB + 2 GB on my MMC2 now)

Hope that helps

fanoush
07-27-2007, 04:07 PM
I tried various partition sizes for the DOS and the ext2 partitions. I tried both FAT16 and FAT32 for the DOS partition. Nothing worked. I could copy the root filesystem over just fine, and even mount it and see the files. But when I tried to boot from it, it would fail and then boot to internal flash. I also tried updating the kernel to the patched version that allows for faster access to the mmc cards. No difference.

This is strange. It shouldn't be related to the card size at all. If you can mount the card and see the data, it should be same at boot time. Which partition you used for ext2, /dev/mmcblk0p2 or something higher like p4,p5..?

You can edit/create bootmenu.conf (not .sh) and add dmesg >/tmp/dmesg.out as a last line and after boot see if there is anything suspicious in kernel log early at boot time. You can also see kernel log after it failed and booted from flash but the beginning is cut off.

You may also try to test if it is some limitation/bug of uclibc system in initfs. As root you may run
chroot /mnt/initfs
this will switch to the system used at early boot time so you can try mounting the card there and see if everything works too.

terrencegf
07-27-2007, 06:22 PM
This is strange. It shouldn't be related to the card size at all. If you can mount the card and see the data, it should be same at boot time. Which partition you used for ext2, /dev/mmcblk0p2 or something higher like p4,p5..?


I did two partitions, /dev/mmcblk0p1 as FAT16 or FAT32 (depending on the size I chose) and /dev/mmcblk0p2 as ext2.


You can edit/create bootmenu.conf (not .sh) and add dmesg >/tmp/dmesg.out as a last line and after boot see if there is anything suspicious in kernel log early at boot time. You can also see kernel log after it failed and booted from flash but the beginning is cut off.


The resulting /tmp/dmesg.out file doesn't seem to show any errors. But I have noticed something I didn't see before. It tried to boot from mmc, failed and booted from flash; I then mounted /dev/mmcblk0p2 on /opt and did "ls", which gave me an "input/output" error on /opt/bin. So it looks like it tried to read from the mmc card's bin directory but failed, which created something bad in the filesystem. Doing "fsck /dev/mmcblk0p2" would fix any errors, but the errors would return upon next reboot.


You may also try to test if it is some limitation/bug of uclibc system in initfs. As root you may run
chroot /mnt/initfs
this will switch to the system used at early boot time so you can try mounting the card there and see if everything works too.

Doing this seems to generate zero errors. I'm thinking more and more it's a compatibility problem with the card itself. I'm going to order a different brand of 8gb SDHC card and see if it makes any difference.

ArnimS
07-29-2007, 08:18 PM
You can edit/create bootmenu.conf (not .sh) and add dmesg >/tmp/dmesg.out as a last line and after boot

This will be interesting to check out.

~thank you~ fanoush (and the guy who wrote the 'EASILY' howtos)!

It is wonderful to be able to make image backups and not go through system reconfig. It's so convenient now! For example,

To back up:
dd bs=1M if=/dev/mmcblk0p2 | gzip > /media/mmc1/images/IT2006_2.2_Working.gz

To restore:
gzip -dc /media/mmc1/images/IT2006_2.2_Working.gz | dd of=/dev/mmcblk0p2 obs=1M


It's uh, not super fast with a stock kernel :P

huck
08-07-2007, 02:03 PM
a note on booting from the MMC...at least with the FrogPad bluetooth keyboard...it breaks it...

boot the same system from the original flash on the n800 and it works...pairs and connects fine...

boot from the MMC and it pairs but does NOT connect...

Any thoughts on the cause of this?

tolou
08-09-2007, 09:53 AM
When I like current stable system in flash (after clean reflashing and tweaking it a bit) I boot from mmc and do a backup
mount -t jffs2 /dev/mtdblock4 /opt
./mkfs.jffs2 -r /opt -o /media/mmc1/rootfs.jffs2 -e 128 -l -n
umount /optthen when I want to restore system in flash I boot from mmc and do
./flash_eraseall -j /dev/mtd4
./nandwrite -a -p /dev/mtd4 /media/mmc1/rootfs.jffs2Be 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).

Iīm currently running the system on MMC only and wonder how I can restore the backup to the card instead, in case I will need this in the future. Whatīs the (short?)device name for the boot partition, /dev/mmcblk0p2 or what? :confused:

I also concerned about the different filesystems as I have the ext2 on the card. Having run the
mount /dev/mmcblk0p2 /opt
./mkfs.jffs2 -r /opt -o /media/mmc1/rootfs.jffs2 -e 128 -l -nproduced what seems to be a compressed image of my card. But can I really mix the system types like this? What happens when I want to restore the jff2 image to my ext2 card again?
Can I run something like this from the flash system then even though itīs ext2?
./flash_eraseall -j /dev/mmcblk0p2
./nandwrite -a -p /dev/mmcblk0p2 /media/mmc1/rootfs.jffs2:rolleyes:

fanoush
08-09-2007, 10:29 AM
Whatīs the (short?)device name for the boot partition, /dev/mmcblk0p2 or what? :confused:

Yes if you boot from second partition.


I also concerned about the different filesystems as I have the ext2 on the card. Having run the
mount /dev/mmcblk0p2 /opt
./mkfs.jffs2 -r /opt -o /media/mmc1/rootfs.jffs2 -e 128 -l -nproduced what seems to be a compressed image of my card. But can I really mix the system types like this? What happens when I want to restore the jff2 image to my ext2 card again?

mkfs.jffs2 is for creating flashable image suited for internal flash, you can do it like above but you can't restore the result to mmc card, only to internal flash (provided the result it is not too large to fit).

If you want to make backup suitable for extracting to mmc card later you can use GNU tar i.e. to make backup to FAT partition on mmc card run something like this
mount /dev/mmcblk0p2 /opt
cd /opt
/path/to/gnu/tar -zcvf /media/mmc1/backup.tar.gz .
then you can later restore it by formating mmc partition (mke2fs), mounting it and extracting via tar again
mount /dev/mmcblk0p2 /opt
cd /opt
/path/to/gnu/tar -zxvf /media/mmc1/backup.tar.gz



Can I run something like this from the flash system then even though itīs ext2?
./flash_eraseall -j /dev/mmcblk0p2
./nandwrite -a -p /dev/mmcblk0p2 /media/mmc1/rootfs.jffs2:rolleyes:
No.

sparkbox
09-21-2007, 03:45 AM
I am probably going to get scolded for this question but why does this tutorial set you up with 2 partitions to boot of the flash card?

I did a search but could not find answer for my question

Thanks in advance!

Milhouse
09-21-2007, 10:30 AM
The first parition is VFAT to ensure compatability with Windows - when you put your memory card in a Windows PC it only mounts the first partition and only understands FAT (possibly NTFS too). Creating and using a second partition means you can still use the memory card in your PC to copy music etc. If you only had a single ext2 partition on the card Windows would no longer recognise your card.

Having two partitionts isn't essential, but it does make life a little more convenient.

fanoush
09-21-2007, 11:12 AM
It is also for better compatibility with Nokia system. It expects first partition as vfat too so it is a bit confused when it is not there. The partition is mounted to /media/mmcX and shown as "Memory card" in File Manager. It is also exported over USB when you attach it to PC. And you can have swap file there too.

Moonshine
10-02-2007, 12:41 PM
Fanoush, we need your supreme skills again! :)

Any chance you could update initfs_flash for the new relase that came out today? (4.2007.38-2)

I'd be forever thankful...

fanoush
10-02-2007, 02:41 PM
You tried it and it didn't work? There is some chance it will work, initfs version may be same like in previous FW. If not, it wil tell you so and won't change anything.

Moonshine
10-02-2007, 03:06 PM
Yes.. After answering that I want to "remove the unneeded extra stuff" it starts processing things and fails with:


!!! unknown initfs version osso-RX-34.2007-38, cannot install bootmenu


Be glad to help with anything else you might need right after I get back from lunch here..

fanoush
10-02-2007, 03:12 PM
Oh, I see. Bad luck. I'll take a look at the firmware ASAP.

fanoush
10-02-2007, 04:30 PM
I have updated initfs_flasher.tgz (http://fanoush.wz.cz/maemo/initfs_flasher.tgz) with changes for this FW. It is untested but I hope it will work. There are no changes in linuxrc script which is the only thing that matters for bootmenu.sh script. USB recovery mode is also included but you may always answer no if you don't want it :-)

Please let me know if it works. I will probably update when Nokia releases new kernel source as I don't want to lose my private changes.

mlind
10-03-2007, 02:24 PM
@fanoush
thank you for your excellent work with inifs flasher! Going to update soonishly.

I dunno if this has been mentioned before, but if someone manages to screw up their initfs (like me), you can flash only the initfs part from the kernel image like this:


./flasher-3.0 --flash-only initfs -F RX-34_2007SE_4.2007.38-2_PR_COMBINED_MR0_ARM.bin -f

gLobster
10-03-2007, 03:03 PM
Soory, but I can't reflash initfs:
./initfs_flash: ./initfs_flash: 225: /home/user/MyDocs/.documents/initfs_flasher/mkfs.jffs2: not found
Cannot find initfs.bootmenu.jffs2, something failed, nothing flashed.

Moonshine
10-03-2007, 05:38 PM
Looks like you might not have copied the entire "initfs_flasher" directory, as it's complaining about portions being missing. (mkfs.jffs2 to start) Did you just copy over the initfs_flash script by itself by chance?

gLobster
10-04-2007, 02:44 AM
I try. But after I copy mkfs.jffs2 from old packet and flashing jffs may N800 is dead :-( Now I reflash original firmware.

fanoush
10-04-2007, 03:58 AM
Symptoms look like you run out of disk space. But it is really hard to tell what went wrong since you provided almost zero information.

Missing mkfs.jffs2 looks like you either did something by hand or there was no space to extract it. I have checked the download and mkfs.jffs2 is there.

When you fill internal flash completely and reboot, device becomes bricked since the boot process needs to write.

gLobster
10-04-2007, 06:14 AM
I had many free space on device.
I load initfs_flasher.tgz from post #204, unpacked its and run ./initfs_flash script. Say yes for backup, free space, ssh and after them scipt terminate abnormaly with errors.
After them I copy mkfs.jffs2 from previos initfs_flasher.tgz and rerun ./initfs_flash.

When script successful ended I reboot N800 by press enter :)
Tablet not loaded, freezed on "NOKIA" screen

fanoush
10-04-2007, 08:01 AM
I had many free space on device.
Ok, then I don't know.


I load initfs_flasher.tgz from post #204, unpacked its and run ./initfs_flash script. Say yes for backup, free space, ssh and after them script terminate abnormally with errors.
After them I copy mkfs.jffs2 from previous initfs_flasher.tgz and rerun ./initfs_flash.

Sadly for troubleshooting this, full output of shell session would be needed. Missing mkfs.jffs2 means something went seriously wrong with unpacking initfs_flasher.tgz archive. If you try this again after reflash and see errors, could you copy full output (including your commands) to clipboard and paste it here? You can even do it over ssh from desktop if it is easier for you to save screen output that way. You can also answer 'no' to last flashing question if the output looks strange. The final produced initfs.bootmenu.jffs2 image should be 1.6-1.9MB large (depends on your choices).

gLobster
10-04-2007, 09:33 AM
Ok. I try it today evening.

gLobster
10-04-2007, 03:33 PM
Sorry, I find my error:
tar: unexpected end of file
tar: short read Bad download :)

Airw0lf
10-22-2007, 03:39 AM
I am following the instructions here - http://maemo.org/community/wiki/howto_easily_boot_from_mmc_card/.

Everything looks good except that insmod /mnt/initfs/lib/modules/current/ext2.ko will not work for me. I have a N800 and I know I have to insmod /mnt/initfs/lib/modules/2.6.18-omap1/mbcache.ko first...

But it looks like I will have to install ext2.ko via /mnt/initfs/lib/modules/2.6.18-omap1/ext2.ko.

Is this safe to do? I've read (googled) that a few people have had the same problem...

fanoush
10-22-2007, 05:36 AM
But it looks like I will have to install ext2.ko via /mnt/initfs/lib/modules/2.6.18-omap1/ext2.ko.

Is this safe to do? I've read (googled) that a few people have had the same problem...
Yes, the 'current' part is simply broken on N800, you have to use 2.6.18-omap1.

Hmm, when thinking about this, it shouldn't be a problem to fix this 'current' link in bootmenu installation so people are less confused.

pearl62
11-15-2007, 02:29 AM
I have updated initfs_flasher.tgz (http://fanoush.wz.cz/maemo/initfs_flasher.tgz) with changes for this FW. It is untested but I hope it will work. There are no changes in linuxrc script which is the only thing that matters for bootmenu.sh script. USB recovery mode is also included but you may always answer no if you don't want it :-)

Please let me know if it works. I will probably update when Nokia releases new kernel source as I don't want to lose my private changes.

Yes, it seems to work fine. My N800 now has OS2008 in Flash and OS2007 on MMC2, and I can choose which one I want from the bootmenu.

Thanks!

rone
11-16-2007, 09:22 AM
Do the instructions in the first post work for the n800 with 2008? I know a new initfs_flasher has been released.

Has anybody successfully copied 2008 to a flash memory card and boot from it?

Any special work arounds needed?

fanoush
11-16-2007, 09:31 AM
Has anybody successfully copied 2008 to a flash memory card and boot from it?

Yes

Any special work arounds needed?
No but due to newer kernel there are issues with wlan and arrow keys so old system is not very usable. Please continue discussion here
http://www.internettablettalk.com/forums/showthread.php?t=11703

pauljohn32
01-11-2008, 01:27 AM
i am experienced with linux. I think the simplified nature of these instructions is perplexing.

1. Can i boot from the external SD card? (instructions seem to always assume internal)

2. Why do we need the vfat partiition on the front of the flash disk?

3. Why not create a more ordinary partition arrangement, as on a full linux system. Separate partition for /home, Especially. That would allow us to protect docs while replacing OS.

TIA

PJ

nhanquy
01-19-2008, 06:28 PM
i am experienced with linux. I think the simplified nature of these instructions is perplexing.

1. Can i boot from the external SD card? (instructions seem to always assume internal)

2. Why do we need the vfat partiition on the front of the flash disk?

3. Why not create a more ordinary partition arrangement, as on a full linux system. Separate partition for /home, Especially. That would allow us to protect docs while replacing OS.

TIA

PJ

1. yes you can ! Just add external SD (mmc1, mmcblk1p2) [clone it from the item for internal SD (mmc2, mmcblk0p2) ] to bootmenu.config before you flash the boot loader.

2. You don't need to just to make it work with windoze I think. Note that the above item could be different and no longer blk1p1 but maybe blk1p0. I am taking the N800 as an example here. I do not have a N810!

3. Yes. You can do that.

AbelMN
01-26-2008, 05:55 PM
220 posts on Rebooting from MMC.

Not very reassuring !

Question 5 (or so) already said it all: Why should I reboot from MMC ? :confused:

ghoonk
01-27-2008, 02:43 AM
Sorry, I find my error:
Bad download :)

Hang on, i got this error too.

Where do I get a 'good' download then?

fanoush
01-27-2008, 03:30 AM
Hang on, i got this error too.

Where do I get a 'good' download then?
Just try again.

mooler
01-29-2008, 01:41 AM
Anybody know why my boot menu has disappeared and it boots directly from my SD card? It boots in 12 seconds. Also I have noticed that my battery icon has disappeared only to reappear when i plug in the charger. the icon does not indicate charging but does show "charging" when i tap the icon

mooler
01-29-2008, 01:50 AM
well the menu reappeared. i unplugged the charger and rebooted again. does this have anything to do with it? I am also using fanoush's custom kernel with SD high speed

braveally
03-05-2008, 10:01 PM
Now I got bitten by this too. Workaround is to edit file
/usr/sbin/osso-mmc-umount.sh (as already mentioned here http://www.internettablettalk.com/forums/showpost.php?p=37640&postcount=123 )
and change one line 'umount $mp 2> /dev/null' in this loop
for mp in $MPS; do
umount $mp 2> /dev/null
RC=$?
if [ $RC != 0 ]; then
echo "$0: could not unmount $mp"
exit $RC
fi
done

to be
for mp in $MPS; do
if [ "$mp" != "/" ] ; then umount $mp 2> /dev/null ; fi
RC=$?
if [ $RC != 0 ]; then
echo "$0: could not unmount $mp"
exit $RC
fi
done


Which means skip unmounting root filesystem. If you don't write to same filesystem (i.e the active linux partition) over usb, it is safe. Most probably you just want to write to first FAT partition anyway.

how do i save the script back in place. I downloaded a 3rd party file manager just to find the file. I changed it but i am unable to replace it and the notes app (or regular file manager) refuses to let me replace the file.

rhkuo
03-07-2008, 04:43 PM
Are you logged in as root? You probably can't do it as default user.

iliaden
03-14-2008, 11:01 AM
either my search techniques are awful, or it isn't yet completely described:
how does one create an exact backup of the entire filesystem to mmc card?

what I have is :
#mount -t jffs2 /dev/mtdblock4 /opt
#./mkfs.jffs2 -r /opt -o /media/mmc2/rootfs.jffs2 -e 128 -l -n
/bin/sh: ./mkfs.jffs2: not found

I am running OS 2008 from an n800. any suggestions?

rhkuo
03-14-2008, 04:02 PM
I believe I had a similar problem... make sure that the downloaded initfs_flasher.tgz file extracted properly when you untar'ed it, with no error messages. It may be incomplete and you may have to redownload it. Alternatively you might need a different version of the tar program (the GNU tar on Penguinbait's site).

GeraldKo
03-14-2008, 04:04 PM
how does one create an exact backup of the entire filesystem to mmc card?


iliaden, since I'm not sure what your goal is, I'm not positive this (http://www.internettablettalk.com/forums/showthread.php?p=149807#post149807)will answer your question, but it might.

fanoush
03-14-2008, 04:13 PM
how does one create an exact backup of the entire filesystem to mmc card?

what I have is :
#mount -t jffs2 /dev/mtdblock4 /opt
#./mkfs.jffs2 -r /opt -o /media/mmc2/rootfs.jffs2 -e 128 -l -n
/bin/sh: ./mkfs.jffs2: not found

The './' part tells it to search for command in current directory. mkfs.jffs2 is inside initfs_flasher/ directory of initfs flasher (http://fanoush.wz.cz/maemo/initfs_flasher.tgz)


These steps will make jffs2 image directly flashable by linux flasher over usb or by mtd-utils (flash_eraseall, nandwrite) when running from device.

iliaden
03-15-2008, 01:06 PM
I feel embarassed...
I knew this, yet failed to think about it.
Thanks for reminding me.

jffs2 image created successfully :D

iliaden
03-17-2008, 11:11 PM
problem: mmc boot, no applets, no programs open works perfectly.

As soon as I insert a media card that has
1) ~2000 ID3-tagged mp3 files
2) 128Mb swap created when it was used as internal mmc
3) that's it

at this point, the cpu jumps to 100% for at least 30min (I'll leave it overnight; tell you the results in a few hours)
As far as I see it- the use of the information stored on this sd card is not available while booting from mmc.
Any reasons why and what I might do to solve this?

Thank you

Ilia

UPDATE: only 7 hours! after this the CPU went back to normal, and the card was recognized correctly.

smileyninja
03-19-2008, 04:46 PM
I have a question/problem and searching doesn't seem to provide any simple solution. I flashed my N800 from OS2007 to the latest OS2008 (51-3 version). Using the nupgrade.sh scripts everything seemed to work OK- until I finished. Everytime I reboot, I get a popup message stating memory card is corrupt. File manager complains the card is not formatted and offers to format it- when I do so it complains that it's unable to and that I should use File Manager to format the card. In OS2007 and the first OS2008, I was able to edit the /usr/sbin/osso-mmc-umount.sh file and "turn on" the DOS partition, but the script is different in the latest version.

Did I miss a step somewhere or is my card truly corrupted? Windows can't find anything wrong with the card.

fanoush
03-20-2008, 01:47 AM
As soon as I insert a media card that has
1) ~2000 ID3-tagged mp3 files
...
at this point, the cpu jumps to 100% for at least 30min (I'll leave it overnight; tell you the results in a few hours)
It looks like the metalayer-crawler media indexing daemon has tough time with your media files. How long it takes when you boot from interrnal flash and do same thing? Do you use ext2 or ext3 filesystem on mmc boot partition? This is latest OS2008 firmware or OS2007?

iliaden
03-20-2008, 07:10 AM
sorry for omitting that info.

n800, OS2008, 1gb SD card to boot from; booting from ext2.

I thought it was doing this, but when I boot from flas, hand ask the load appelet to show me what processes are running, it shows me metalayer-crawler uses about 30-40%, and the cpu bar isn't at 100%. Oh, and it runs for no more than 5-10 minutes.

why would the boot from the mmc be so different?

Ilia

p.s. what would be the difference in this case between ext2 and ext3? doesn't it come to the same result?

fanoush
03-21-2008, 05:33 AM
why would the boot from the mmc be so different?

I've seen something similar but don't have so much media files on my card. Hard to say why exactly but the simple answer is that metalayer crawler is badly written or not optimized/tested for running from ext2 filesystem. I guess the problem is that /home/user containing metalayer crawler database is now on MMC and scanned media too so metalayer-crawler both reads and writes (different or even same) mmc card at the same time and the performance is poor because of this concurrent access. 7 hours vs 10 minutes is really pathological and needs fixing. Either it is some real bug or simply bad programming style that does not hurt with internal flash. I guess better write caching when updating the database should help a lot.



p.s. what would be the difference in this case between ext2 and ext3? doesn't it come to the same result?
I guess ext3 could be much slower in this case than ext2 so I hoped you're using ext3 and got those 7 hours.

iliaden
03-24-2008, 08:45 PM
Thanks for the guidelines... guess when i'll be using my n800 as a media player, i'll be booting from internal flash ;)

I don't have any media files on internal flash card (except 3 mp3 tracks included into OS2008). Repeated the test with the same flash card - same result (~5-6 hours); tried with another card (~250 mp3 tracks); took me ~30-45 minutes.
Although, when the metalayer-crawler is working, I can play those media files (with canola at least)... so the process isn't mandatory. Yet when I kill it, it automatically restarts. Does any manual solution exist?

Thanks

Ilia

fanoush
03-25-2008, 05:34 AM
Although, when the metalayer-crawler is working, I can play those media files (with canola at least)... so the process isn't mandatory. Yet when I kill it, it automatically restarts. Does any manual solution exist?

You can disable it altogether if you don't use built-in media player. Search this forum for details, people do it for many reasons. You can remove or rename the /etc/rc2.d/S99metalayer-crawler0 startup script (as root) and reboot but beware that you won't see any media files in built-in player. You can still use it when opening files directly from File Manager.

BTW I have reported your experience in related bug here http://bugs.maemo.org/show_bug.cgi?id=1842

iliaden
03-25-2008, 06:17 AM
thanks.

Regarding the bug you submitted, I have a correction to add: the process does NOT consume extra RAM. Only CPU is drained to 100%; for the RAM, it reports a usage of ~ 3Mb. The device is not paralyzed, yet becomes incredibly slow.

Ilia

iliaden
03-25-2008, 09:36 AM
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

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.

sumtool -i rootfs.jffs2 -o rootfs.faster.jffs2 -e 128KiB -l -n




Any way to do the same procedure from mmc boot (i want to make an jffs2 of my mmc boot then reflash it to internal flash)

thanks

Ilia

fanoush
03-25-2008, 11:07 AM
Yes, it's the same, just replace parameters in first mount with -t ext2 /dev/mmcblkXpX. Then make sure final image still fits into internal flash (<=251 MB for N8x0). See exact size in /proc/mtd, rootfs is 0x0FB80000 = 263716864 bytes on my N810.

GeraldKo
03-25-2008, 01:07 PM
You can disable it altogether if you don't use built-in media player. Search this forum for details, people do it for many reasons. You can remove or rename the /etc/rc2.d/S99metalayer-crawler0 startup script (as root) and reboot but beware that you won't see any media files in built-in player. You can still use it when opening files directly from File Manager.[/url]

Do you know if Canola or mplayer rely on the built-in player? That is, if I were to disable metalayer-crawler, would Canola and mplayer still work fine?

qwerty12
03-25-2008, 01:09 PM
Do you know if Canola or mplayer rely on the built-in player? That is, if I were to disable metalayer-crawler, would Canola and mplayer still work fine?

mplayer is totally independent to the built in player. mplayer would still work, I guarantee it as I have it disabled and mplayer still works :P

metalayer is a process which indexes files, Canola uses its own indexer so canola still works.

iliaden
03-25-2008, 03:54 PM
Yes, it's the same, just replace parameters in first mount with -t ext2 /dev/mmcblkXpX.

I wish it was so easy...
# mount -t ext2 /dev/mmcblk0p2 /opt
mount: mounting /dev/mmcblk0p2 on /opt failed

# mount -t jffs2 /dev/mmcblk0p2 /opt
mount: mounting /dev/mmcblk0p2 on /opt failed

this was done booting from internal flash.

# mount /dev/mmcblk0p2 /opt
from mmc boot was sucessfull, yet I did not try to create the image since I feared that it would interfere with the fct that it is booting from mmc.

any suggestions?

Thanks

Ilia

fanoush
03-26-2008, 06:18 AM
I wish it was so easy...
# mount -t ext2 /dev/mmcblk0p2 /opt
mount: mounting /dev/mmcblk0p2 on /opt failed
this was done booting from internal flash.

you need to insert filesystem kernel modules, check the cloning guide. It is quite remarkable you got so far without tripping over multiple guides suggesting this ;-)

from mmc boot was sucessfull, yet I did not try to create the image since I feared that it would interfere with the fct that it is booting from mmc.

Yes, it is better to backup when booted from different device. When done with active device you may end with some extra runtime garbage in final image but it shouldn't hurt. Just keep the device quiet when doing it. Tablet is designed to recover from random reboots which may leave filesystem is similar (or worse) state. Next reboot will clean things up.

iliaden
03-27-2008, 12:24 AM
thanks... but I did have mbcache.ko and ext2.ko.
added ext3.ko and jbd.ko and the mount was sucessful.


# ./mkfs.jffs2 -r /floppy (I mounted there) -o /media/mmc1/flashboot.jffs2 -e 128 -l -n
mkfs.jffs2: /floppy/home/user/.osso/osso-notes/.g_keyfile: Input/output error
#


I tried to use mkfs.ext2 ... but I see 2 problems there:
1) I don't know the correct syntaxis
2) I have no clue how to convert ext2 to jffs2

help please?

thanks

Ilia

fanoush
03-27-2008, 06:20 PM
Looks like corrupted filesystem on mmc, file /floppy/home/user/.osso/osso-notes/.g_keyfile is probably not OK. See also kernel log (use dmesg command) after you see that i/o error. Maybe e2fsck could repair it (when booted from flash and that mmc partition is not mounted).

iliaden
03-27-2008, 07:59 PM
will try repairing it soon...

dmesg command returns about 100 lines saying


menelaus 1-0072: Setting voltage 'VMMC' to 3000 mV (reg 0x0a, val 0xb8)

somewhere in there, there are also ~50 lines saying

menelaus 1-0072: Setting voltage 'VDCDC3' to 2800 mV (reg 0x07, val 0x29)


this is all.

EDIT!!!!

when this procedure is repeated from flash, I have:

JFFS2 warning: (1251) jffs2_sum_write_sumnode: Not enough space for summary, padsize = -374
JFFS2 warning: (1251) jffs2_sum_write_sumnode: Not enough space for summary, padsize = -882
JFFS2 warning: (1251) jffs2_sum_write_sumnode: Not enough space for summary, padsize = -354
JFFS2 warning: (1251) jffs2_sum_write_sumnode: Not enough space for summary, padsize = -336
JFFS2 warning: (1251) jffs2_sum_write_sumnode: Not enough space for summary, padsize = -354


the rest of the log does not mention jffs2


EDIT2

SUCCESS!!!!!

after repairing the ext2, the entire process went perfectly.
time to reflash (size of file 213 mb)

EDIT3 (too lazy to create new posts)
new problem reported: after reboot, (not reflash), all the kernel modules disappear, and I need to reinsert all of them. Note: this problem is only noted on the flash.

any way to solve this, or do I need to create an automatic script?

thanks

Edit 4: reflashed successfully. thanks a lot for the help!

fanoush
03-31-2008, 03:58 AM
new problem reported: after reboot, (not reflash), all the kernel modules disappear, and I need to reinsert all of them. Note: this problem is only noted on the flash.
any way to solve this, or do I need to create an automatic script?

if you want ext2/ext3 modules (or any other modules residing in initfs) inserted even when booted from flash and don't want to create another script, you can tweak bootmenu.conf to insert it at boot time (just like with items that boot from mmc). For ext2 add
MENU_1_MODULES="mbcache ext2"
I'm not sure how useful it is, though.