Steve Chandler wrote:
> Hello!
>
> The equipment that sends messages to the pager watch is being upgraded
> to a Linux based embedded computer.
>
> I implemented the ramdisk root filesystem technique as described in Paul
> Moody's embedded mini HOWTO at:
> http://users.bigpond.com/paulmoody/Mhow11c.html on a Radisys EPC-33 and
> a 40M Sandisk flash drive.
>
> >From the HOWTO:
>
> > The kernel loads an initial ram disk initrd.img and mounts it as root.
> > linuxrc script is executed. This script mounts /dev/hda1 ( the flash
> device )
> > and uncompresses a compressed 40 Mb root file system image stored as
> > a conventional file hda1 into a 40Mb ram disk (dev/ram).
> > The flash device ( /dev/hda1 ) is unmounted.
> > When linuxrc terminates the initial ramdisk is unmounted and /dev/ram
> > is mounted as root.
> > The system now boots as per a normal boot sequence as though it was
> > booting from a normal drive.
>
> My question:
>
> Is there any good reason not to just use the compressed 40M root
> filesystem as the initrd.img and forget about the linuxrc step?
No reason at all, in fact my early implementation did do this however
there are a number of benefits that may be derived from this linuxrc
"bootstrap" process.
1. The initial boot linuxrc script can manipulate the ram disk root system
BEFORE it actually becomes root. For example at the moment I have only a
skeleton or default /etc in the compressed 40 Mb image and the linuxrc boot
script copies my actual /etc over the skeleton /etc in the ram disk before
mounting it as root. Other wise you are stuck with whatever passwd , rc.d
and network scripts you have in the compressed image. You cannot overwrite
the whole /etc in a 'live' system during boot (well not if you are
executing scripts from it ).Since I am putting this system into many boxes,
I have a 'generic' compressed initrd and after loading this into the
ramdisk linuxrc 'customises' it by writing in whatever /etc /bin etc etc is
required before mounting the ramdisk as root and running the startup
scripts.
2. Another configuration I use has the kernel / linuxrc stored in EPROM (
approx 1.2 Mb ) for absolute data security ( well more absolute than flash
). The linuxrc in this case though can load from a number of compressed 40
Mb images stored in flash. ( ie a choice ) The EPROMed initrd has a basic
limp mode that can signal an alarm ( via the network ) in the event of
flash failure.
3. If you have a directory called /initrd in the ramdisk image that
linuxrc uncompresses then instead of unmounting the initial 'linuxrc' root
system it will be mounted here ( last thing that happens when linuxrc
terminates ). This allows the linuxrc script and whatever else you might
have in linuxrc boot to be available to the final root system . This is
sometimes very handy to capture restart scripts / data etc.
However you are right, you can just initrd the 40 mb ( or whatever )
filesystem I just found it more elegant use a generic compressed image and
let linuxrc do the configuration work.
>
>
> Steve Chandler <[EMAIL PROTECTED]>
> Seiko Communications Systems, Inc.
> http://www.messagewatch.com