public inbox for linuxppc-dev@ozlabs.org 
 help / color / mirror / Atom feed
* looking for a model for building CRAMFS(?)-based system
@ 2005-03-16 16:33 Robert P. J. Day
  2005-03-17 14:12 ` Pantelis Antoniou
  2005-03-17 14:59 ` Patrick Huesmann
  0 siblings, 2 replies; 9+ messages in thread
From: Robert P. J. Day @ 2005-03-16 16:33 UTC (permalink / raw)
  To: Embedded PPC Linux list


  i'm hoping someone has an example of the following that they're
willing to share.

  currently, the system i've built for our 850 board incorporates

	- boot loader (sadly, not u-boot, but i'm working on it)
	- standard zImage.initrd.bin kernel+initrd image
	... mountable JFFS2 filesystem with persistent stuff ...

  obviously, with this layout, it's kind of a nuisance to update
anything individually in the initrd portion of the system, so i'd like
to at least experiment with a layout that has separate

	- boot loader (ideally, u-boot)
	- kernel image
	- updateable (normally mounted read-only?) root filesystem
	... rest of stuff the same ...

  i'm going to start over at DENX with their docs since that seems to
be the canonical place to get the scoop on this but, in the meantime,
if anyone has built something like this and is willing to share, say,
their makefile so i can see how it goes together, i'd be thrilled.

  if your example happens to *require* u-boot, well, perhaps so much
the better since that will give me the incentive to switch. :-)

  thanks.

rday

^ permalink raw reply	[flat|nested] 9+ messages in thread
* RE: looking for a model for building CRAMFS(?)-based system
@ 2005-03-17 16:17 Fillod Stephane
  0 siblings, 0 replies; 9+ messages in thread
From: Fillod Stephane @ 2005-03-17 16:17 UTC (permalink / raw)
  To: Robert P. J. Day; +Cc: linuxppc-embedded

Robert P. J. Day wrote:
> now this is the sticky part.  imagine this system out in the field,
> where you need to make an update to something in the initrd in the
> root filesystem.

You could get away with mirrored partitions, having version N and N-1
in flash, so a rollback is possible. But static partitions suck,
they are either too big (space wasted), either too small (!!).

Here's an idea I'd enjoy having feedback from: why not dedicating
the whole flash to a jffs2 space, allowing a kind of "dynamic"=20
partitioning with the composing filesystems in image files accessed
trough
loop devices? For example, the base system (libc, busybox, startup=20
scripts, ..) would be packed as a cramfs/squashfs file, put in the jffs2
storage. This image file would be mounted as root fs in 2 steps through=20
a loop device, thanks to a small patch against linux/init/do_mounts.c.=20
I've named this idea "Initial loopback (initlo) support", patch's
available.
Choosing the rootfs image is done through kernel command line.=20
For example, let's say /dev/mtdblock0 is the jffs2 storage, and the real
rootfs is a cramfs image file "rev1/rootfs.img" (from base of
mtdblock0).
The command line would be:
		root=3D/dev/mtdblock0 lofile=3Drev1/rootfs.img
After bootup, the rootfs.img is the rootfs /, and the mtdblock0 space
is pivoted to /initlo, hence still accessible.
It's easy to have whatever number of rootfs versions, switching from=20
one another, and updating the kernel command line only when install
succeeded (=3Dno power fail,..).
During normal operation, the jffs2 storage is kept read-only for safety.

Only during install it is remounted read-write.
Applications can be packaged the same way (image file). jffs2 will be
happy
to store also configuration files/data and at least 2 kernel versions
(for=20
safe update). Great monitors like U-Boot are able to load the kernel
image
(and other firmwares) from jffs2. The jffs2 loader is portable.

Note: these filesystems in a filesystem look inefficient (read slow
startup),
but who cares, you're already relying on compression. Please note that
once
loaded in pagecache, the system runs at full speed. cramfs/squashfs are
at
advantage here over initrd, because only needed files make it into the
pagecache.

Comments welcome

--=20
Stephane

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2005-03-17 22:52 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-03-16 16:33 looking for a model for building CRAMFS(?)-based system Robert P. J. Day
2005-03-17 14:12 ` Pantelis Antoniou
2005-03-17 14:59 ` Patrick Huesmann
2005-03-17 15:14   ` Robert P. J. Day
2005-03-17 15:42     ` Patrick Huesmann
2005-03-17 16:32     ` Wolfgang Denk
2005-03-17 16:35       ` Robert P. J. Day
2005-03-17 22:52         ` Wolfgang Denk
  -- strict thread matches above, loose matches on Subject: below --
2005-03-17 16:17 Fillod Stephane

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox