maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   Upgrading (https://talk.maemo.org/forumdisplay.php?f=8)
-   -   Booting from MMC on N800 Now Available!! (https://talk.maemo.org/showthread.php?t=4053)

iliaden 2008-03-25 13:36

Re: Booting from MMC on N800 Now Available!!
 
Quote:

Originally Posted by fanoush (Post 33348)
Yes, but not via flasher. You need to use mtd-utils. I did it few times. There is no simple way but you can use tools from initfs flasher. This is what I do:

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

Code:

mount -t jffs2 /dev/mtdblock4 /opt
./mkfs.jffs2 -r /opt -o /media/mmc1/rootfs.jffs2 -e 128 -l -n
umount /opt

There is also optional sumtool command that optimizes the image a bit for faster mounting.

Code:

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

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 2008-03-25 15:07

Re: Booting from MMC on N800 Now Available!!
 
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 2008-03-25 17:07

Re: Booting from MMC on N800 Now Available!!
 
Quote:

Originally Posted by fanoush (Post 159818)
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 2008-03-25 17:09

Re: Booting from MMC on N800 Now Available!!
 
Quote:

Originally Posted by GeraldKo (Post 159988)
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 2008-03-25 19:54

Re: Booting from MMC on N800 Now Available!!
 
Quote:

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 2008-03-26 10:18

Re: Booting from MMC on N800 Now Available!!
 
Quote:

Originally Posted by iliaden (Post 160082)
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 ;-)
Quote:

Originally Posted by iliaden (Post 160082)
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 2008-03-27 04:24

Re: Booting from MMC on N800 Now Available!!
 
thanks... but I did have mbcache.ko and ext2.ko.
added ext3.ko and jbd.ko and the mount was sucessful.

Code:

# ./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 2008-03-27 22:20

Re: Booting from MMC on N800 Now Available!!
 
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 2008-03-27 23:59

Re: Booting from MMC on N800 Now Available!!
 
will try repairing it soon...

dmesg command returns about 100 lines saying

Code:

menelaus 1-0072: Setting voltage 'VMMC' to 3000 mV (reg 0x0a, val 0xb8)
somewhere in there, there are also ~50 lines saying
Code:

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:
Code:

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 2008-03-31 07:58

Re: Booting from MMC on N800 Now Available!!
 
Quote:

Originally Posted by iliaden (Post 161220)
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
Code:

MENU_1_MODULES="mbcache ext2"
I'm not sure how useful it is, though.

fanoush 2008-04-01 14:25

Re: Booting from MMC on N800 Now Available!!
 
Quote:

Originally Posted by iliaden (Post 156662)
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.

If anyone wants to try workaround for this 'metalayer-crawler is slow' issue, check this
http://bugs.maemo.org/show_bug.cgi?id=1842#c18

It may even help when booting from internal flash. Currently I don't know how much.

Package is best to be installed via dpkg -i command as root.

iliaden 2008-04-16 00:11

Re: Booting from MMC on N800 Now Available!!
 
Code:

mount -t ext2 /dev/mmcblk0p2/opt
./mkfs.jffs2 -r /opt -o /media/mmc1/rootfs.jffs2 -e 128 -l -n
umount /opt

./flash_eraseall -j /dev/mmcblk0p2
./nandwrite -a -p /dev/mtd4 /media/mmc1/rootfs.jffs2

will the nandwrite successfully flash the memory card image onto another memory card (partition 2 for both)?
I presume I'll need to format the second partition before starting. Would Milhouse's script work if I go through all the steps until it flashes? I cannot do this operation through the device memory since the boot partition I have right now is running low on space, and I need to expand it from 450MB to ~1.3 GB

GeraldKo 2008-04-16 00:31

Re: Booting from MMC on N800 Now Available!!
 
I don't know the answer for doing it in Linux. (Doubtless you'll hear from some Linux heavyweight here soon.)

But if you can't do it in Linux and have access to Windows, Acronis True Image can back up a Linux partition to another MMC, and you can tell it to make the partition on the new MMC as large as you want. That is, it can accomplish exactly what you want. They offer a free 15-day trial if you don't want to buy it, and you only need to have it for a little time to accomplish your task. (Maybe there is an Acronis True Image for Linux, I don't know.)

iliaden 2008-04-16 03:06

Re: Booting from MMC on N800 Now Available!!
 
thanks... will try this soon.
small question though - since 16gb SDHC cards require low-level formatting, will Acronis True Image negate those effects and make the card unreadable in my n800, or will it work as promised?

GeraldKo 2008-04-16 03:25

Re: Booting from MMC on N800 Now Available!!
 
I don't know, but I don't see why you would need to low-level format it again. As I recall, it insists on building the partitions and formatting them from scratch (which Acronis does -- you just say OK), but I don't see how that's a problem.

(You'll also have a choice as to whether you're using its backup function or its clone-new-disk function -- I used the latter.)

iliaden 2008-04-19 03:59

Re: Booting from MMC on N800 Now Available!!
 
Grrr! I should learn to control myself better when EVERYTHING goes wrong:

1- in Acronis, I couldn't find the option to resize the partitions - where do I look
2- I discovered than insmod mbcache.ko must be entered BEFORE insmod ext2.ko.
3- creating a fs backup using the method described here. If by tomorrow, I will not have found the correct option in acronis, i'll just use nandwrite, no matter the consequences :(

iliaden 2008-04-19 18:01

Re: Booting from MMC on N800 Now Available!!
 
hi again,

my goal: copy a bootable partition from one sd card onto another one, enlarging it. original: 1gb mmc: mmcblk0p1: 500mb, fat16. mmcblk0p2: 450mb, ext2, bootable
destination: 16gb mmc (15gb actual): mmcblk0p1: 13500mb, fatXX. mmcblk0p2: 1500mb, ext2, bootable.

The loss of information from the fat16 partition is not a problem. I just need to keep the bootable partition as is, just adding free space.
Any solution is more than welcome.


1- Acronis true image: did not find any corresponding option. was able to copy the partitions without changing their size (Not what I need)
2- successfully created a jffs2 image of the original. still unable to copy it onto another SD card.
the original size is 396mb. when I created a jffs2, it was only 210mb. I am a bit reluctant to flash it onto the internal memory in case it would be too large.

Any suggestions? thank you.

GeraldKo 2008-04-19 18:06

Re: Booting from MMC on N800 Now Available!!
 
Acronis will change the partition sizes. I've changed my partition sizes when copying from one SD to another. Did you use Clone Disk in Hard Disk Utilities? Did you select "manual" or "custom" (or whatever Acronis calls it) instead of automatic?

iliaden 2008-04-19 19:20

Re: Booting from MMC on N800 Now Available!!
 
yes, I did all of this.

and I was able to flash correctly! I just mounted both the original (mmcblk0p2) and the destination (mmcblk1p2) on /opt and /floppy, and used ./tar cf - -C /floppy . | ./tar xvf - -C /opt. worked like a bliss!
I did format the card using sfdisk beforehand, and formatted mmcblk1p2 to ext2 before copying.

after this, I just switched cards, and all was perfect. I still didn't figure out how acronis worked... oh well!

thanks for assistance though.

GeraldKo 2008-04-19 19:44

Re: Booting from MMC on N800 Now Available!!
 
Quote:

Originally Posted by iliaden (Post 172061)
yes, I did all of this.

and I was able to flash correctly! I just mounted both the original (mmcblk0p2) and the destination (mmcblk1p2) on /opt and /floppy, and used ./tar cf - -C /floppy . | ./tar xvf - -C /opt. worked like a bliss!
I did format the card using sfdisk beforehand, and formatted mmcblk1p2 to ext2 before copying.

after this, I just switched cards, and all was perfect. I still didn't figure out how acronis worked... oh well!

thanks for assistance though.

Hey, if I could have figured out how to do that in Linux and, better yet, within the NIT, I wouldn't have bothered figuring out how Acronis worked. I'll have to give your method a try later. Thank you!

Natehunderd 2008-04-22 03:40

Re: Booting from MMC on N800 Now Available!!
 
Excellent, easy to follow guide. My compliments. Went smooth. Thanks

davos1 2008-04-28 05:55

Re: Booting from MMC on N800 Now Available!!
 
OK I did this and all of the USB hacks but when I connect the USB and try to go to the internal memory card (the one with the cloned OS. PERFECT PARTITIONING), the computer just says "Insert a disk in drive I:". Before it said on my N800 "Internal memory card busy" or something but I managed to fix it (thanks fanoush) but I cannot fix this. Please offer your support peoples :)

GeraldKo 2008-04-28 06:13

Re: Booting from MMC on N800 Now Available!!
 
Quote:

Originally Posted by davos1 (Post 175451)
OK I did this and all of the USB hacks but when I connect the USB and try to go to the internal memory card (the one with the cloned OS. PERFECT PARTITIONING), the computer just says "Insert a disk in drive I:". Before it said on my N800 "Internal memory card busy" or something but I managed to fix it (thanks fanoush) but I cannot fix this. Please offer your support peoples :)

Take a look at this post/thread.

davos1 2008-04-28 06:33

Re: Booting from MMC on N800 Now Available!!
 
That's what I did from the start. It also never mentions the error that I'm getting.

qole 2009-02-10 01:19

Re: Booting from MMC on N800 Now Available!!
 
Quote:

Originally Posted by fanoush (Post 33348)
Yes, but not via flasher. You need to use mtd-utils. I did it few times. There is no simple way but you can use tools from initfs flasher. This is what I do:

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

Code:

mount -t jffs2 /dev/mtdblock4 /opt
./mkfs.jffs2 -r /opt -o /media/mmc1/rootfs.jffs2 -e 128 -l -n
umount /opt

There is also optional sumtool command that optimizes the image a bit for faster mounting.

Code:

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

Sorry to dredge up an old thread. How do I mount the rootfs.jffs2 image file that is created using this technique?

Is there some modification of this method that is still valid for the N8x0 tablets?

How do you mount a jffs2 image on a loop device?

fanoush 2009-02-10 08:02

Re: Booting from MMC on N800 Now Available!!
 
Quote:

Originally Posted by qole (Post 263321)
Is there some modification of this method that is still valid for the N8x0 tablets?

How do you mount a jffs2 image on a loop device?

Well, did not try but it should work. You just need losetup and block2mtd kernel module. Not sure about losetup but you can get the module from http://fanoush.wz.cz/maemo/modules-d...2maemo1.tar.gz in drivers/mtd/devices

here is mounting script that worked for me on Ubuntu PC
Code:

if [ `id -u` != 0 ] ; then
    echo "run this as root"
    exit
fi
if [ $# -lt 2 ] ; then
    echo $0 image.jffs2 directory
    exit
fi
LOOPDEV=`losetup -f`
losetup $LOOPDEV $1 #rootfs.jffs2
modprobe block2mtd block2mtd=$LOOPDEV,131072
modprobe jffs2
modprobe mtdblock
sleep 1
[ -d $2 ] || mkdir $2
mount -t jffs2 -o ro /dev/mtdblock0 $2

/dev/mtdblock0 is definitely wrong choice on the tablet. Do not even try, it may trash the bootloader, I think someone complained here it did. Most probably the right choice is /dev/mtdblock5.

Let us know how it went :-)

qwerty12 2009-02-10 08:05

Re: Booting from MMC on N800 Now Available!!
 
Quote:

Originally Posted by qole (Post 263321)
Is there some modification of this method that is still valid for the N8x0 tablets?

You should look at the article on the current wiki, I've been updating it to be a bit more current as to how the image is made etc.

fanoush 2009-02-10 08:17

Re: Booting from MMC on N800 Now Available!!
 
Quote:

Originally Posted by qole (Post 263321)
that is still valid for the N8x0 tablets?

Hmm, I was thinking you want to run it directly on the tablet (to look into created backup and maybe recover one file?) but maybe you just meant to do it on regular PC? Then the wiki page may indeed help.

qole 2009-02-10 18:58

Re: Booting from MMC on N800 Now Available!!
 
Quote:

Originally Posted by fanoush (Post 263379)
Hmm, I was thinking you want to run it directly on the tablet (to look into created backup and maybe recover one file?)

Yes, I want to be able to open these image files on the tablet.

I have slightly bigger ambitions than recovering files from a backup, however... I was hoping to be able to chroot into this image and run applications from within the image...

We'll see how it goes. Thanks so much for your help, guys!

fanoush 2009-02-12 07:43

Re: Booting from MMC on N800 Now Available!!
 
Quote:

Originally Posted by qole (Post 263545)
I was hoping to be able to chroot into this image and run applications from within the image...

Yes, this should work. One issue is that you should mount it read only to be on the safe side (and the jffs2 image is made 100% full anyway) so stuff that tries to write there fails but it shouldn't be real problem as you can mount /tmp etc. over it.

qole 2009-02-12 17:03

Re: Booting from MMC on N800 Now Available!!
 
I've discovered that it is effectively read-only anyway. Any time I try to do anything to a file in the mounted rootfs.jffs2 I get an error along the lines of "no more space in file system." I get this error even if I try to delete a file.

Also, the access speeds in the mounted image file are terribly slow. A simple "ls" takes a few seconds.

It was interesting as an experiment, and I now know that it can be done on the tablet, but not useful for running applications. It looks like ext2/ext3 are still the filesystems of choice for that.


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

vBulletin® Version 3.8.8