[prev in list] [next in list] [prev in thread] [next in thread] 

List:       familiar
Subject:    Re: [Familiar] save root & load root not working
From:       Toby Gray <toby.gray () analyticoutcomes ! com>
Date:       2003-06-30 8:08:40
Message-ID: 200306301808.40604.toby.gray () analyticoutcomes ! com
[Download RAW message or body]

On Mon, 30 Jun 2003 02:43 pm, Andrea Tasso wrote:
> I will do what you suggest, but no way to save a smaller image ?

You might be able to get a smaller image by re-creating the jffs2 filesystem 
"from scratch". I haven't actually done this in quite the way I'm about to 
describe, so I don't know for sure that it will work (I will try it out when 
I get home).
You need some non-standard kernel bits for this, so if you're not into 
re-compiling your kernel, this is probably not for you (in which case, see 
what I wrote after step 6 below). I think these bits can all be compiled as 
modules, so a "complete"  kernel rebuild may not be required.
First, you need loopback device support. This is fairly common in "standard" 
kernels. Try step 2 below. If it works, you have loopback device support 
already. If you use menuconfig or xconfig to configure your kernel, you'll 
find the loopback device option under "Block devices".
Next, you need Memory Technology Device (MTD) support. This is rarely used in 
desktop machines. MTD support has it's own section in menuconfig and xconfig. 
You need to have "Memory Technology Device (MTD) support" (obviously), 
"Caching block device access to MTD devices" (mtdblock), and "MTD emulation 
using block device" (blkmtd), which is under "Self-contained MTD device 
drivers". This last one MUST be a module.
You also need 'mkfs.jffs2'. In Debian (the Linux distro I use on my desktop 
machine), this is in a package called mtd-tools.

1. Load up the kernel modules you need, if necessary. Some or all of these 
might load automatically as you go along.
# modprobe loop
# modprobe mtdblock

2. Set up a loopback device on your existing jffs2 file. You might want to 
make a backup of the jffs2 file beforehand, just in case.
# losetup /dev/loop0 /path/to/jffs2/file.jffs2
Replace '/dev/loop0' with '/dev/loop/0' if you are using devfs. Replace 
'/path/to/jffs2/file.jffs2' with the path to your existing jffs2 file. If 
this doesn't work, you probably don't have loopback device support in your 
kernel.

3. Emulate an MTD device on the loopback device
# insmod blkmtd erasesz=256 device=/dev/loop0
again, replace '/dev/loop0' with '/dev/loop/0' if you're using devfs.

4. Mount the MTD device
# mount /dev/mtdblock0 /mnt
Replace '/dev/mtdblock0' with '/dev/mtdblcok/0' for devfs. Replace '/mnt' with 
a suitable mount point in your filesystem. If you don't have a /dev/mtdblock0 
(or a /dev/mtdblock/0), create it with this command
# mknod /dev/mtdblock0 b 31 0
then retry the 'mount' command above.

5. Create a new jffs2 filesystem from the old one
# mkfs.jffs2 --root=/mnt --eraseblock=262144 --pad 
--output=/where/to/save/new.jffs2
Replace '/mnt' with a suitable mount point in your filesystem. Replace 
'/where/to/save/new.jffs2' with the path to where you want your re-created 
jffs2 file saved.

6. Undo all these layers
# umount /mnt
# rmmod blkmtd
# losetup -d /dev/loop0
If you loaded them in step 1, unload the other kernel modules
# rmmod loop
# rmmod mtdblock
# rmmod mtdcore

If step 5 worked, you will now have a new jffs2 file, hopefully smaller than 
your old one.

If all this is too much for you, I'd be happy to do it for you (my machine is 
all setup for this, as I've done similar things for myself - just not 
directly operating on an old jffs2 file). This would mean you'd have to email 
me your current jffs2 file, which obviously means I'd have access the files 
in it, so I'll understand if you don't want to do this.


> If the original jfss2 image I installed on ipaq is small (or even smaller
> if I use the boostrap one), why should I get a big 30 mb when I save it
> back ? I installed nothing, so no real increase.

I suspect that bootldr dumps the entire memory block containing the jffs2 
filesystem, including any "unused" blocks.


> On Mon, Jun 23, 2003 at 07:28:01AM +0100 or thereabouts, Philip Blundell 
wrote:
> > On Mon, 2003-06-23 at 04:17, Andrea Tasso wrote:
> > > The save root makes a big jfss2 on the pc (33554432 bytes), while the
> > > original (ann not modified with additional package installations) size
> > > is 10747904 bytes. Load root ends normally, then I press enter and I
> > > see a few lines of numbers, and nothing works anymore. So I have to
> > > hard reset the ipaq turning it off, and I still have the old unmodified
> > > partition.
> > > I searched some handhelds.org lists but I found no answers.
> >
> > The file you're trying to send is probably too large for bootldr to
> > digest all in one go.  It has a fixed-size receive buffer in memory, and
> > really large files can run off the end of the buffer and overwrite the
> > running bootldr image.
> >
> > We should try to fix this, I guess, since more people seem to be running
> > into it lately.  Perhaps you could file a report in handhelds.org
> > bugzilla about the problem.  In the meantime, you can try breaking the
> > file into two pieces and sending them individually via "load flash
> > <addr>".
> >
> > p.
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic