Is initrd enough?`

Hi,

I am currently setting up a system to be used on small form-factor x86-ba= sed machines as data-collection terminals. They will be connected to custom hardware on site and to the internet (via standard ethernet) and communic= ate with a central server.

The boxes have 128MB of RAM and are supposed to boot off Compact Flash me= dia. Other than that they are really just PCs and not very embedded at all. So=

Space and Performance are not that much at premium as in hard embedded scenarios. That is why I am currently going for the 2.6 kernel series.

I have been reading up on Linux boot sequences, initramfs, initrd, how a "real" root-fs can get mounted later, pivot_root and so on. As a simple user of desktop- and server-Linux this has set my head spinning :-).

But I really want to learn and set up my own build instead of just customizing the likes of DSL or Puppy Linux. If only to have done it once.

I understand the need for separate initrd and a "real root" when the real=

root-fs is not accessible to the naked kernel but requires hardware probi= ng, the loading of modules or extra setup. Like RAIDs, network-filesystems et= c..

In my case all of that does not apply. I boot off IDE (CF accessed as /dev/hda). My Kernel can access the boot media and file-system fine witho= ut any extra processing. Any modules I do want (networking most likely) I ca= n load after that.

I also want to run from RAM only and never write to the system-image part=

on the CF card. That is every boot is to be clean from the deployed syste= m. Maybe with the odd write of small bits of information to the rest of the CF card outside of the system.

In that scenario would it not suffice to pack everything I need in a ramfs- or ext2-image file, specify that as initrd, boot directly into init, minit or such, not via linuxrd, and never switch root?

Or is that not a good idea? If not, why not?

I could still mount /dev/hda1 later and read configuration (which will be per-device while the system-image should be uniform across all machines) from the CF, right?

I want my rootfs-image separate from the kernel, not linked into it. Mainly for reasons of easy of building it. So what would be consideration= s pro/con initramfs as opposed to initrd in /dev/ram0?

Pointers to more reading are appreciated as is direct discussion.

Ciao, MM

--=20 Marian Aldenh=F6vel, Rosenhain 23, 53123 Bonn

formatting link
"Success is the happy feeling you get between the time you do something and the time you tell a woman what you did."

Reply to
Marian Aldenhövel
Loading thread data ...

Hi,

check out

formatting link

Reply to
Jim Jackson

Hi,

Thank you, I started reading that before I posted and am still at it.

Ciao, MM

--=20 Marian Aldenh=F6vel, Rosenhain 23, 53123 Bonn

formatting link
"Success is the happy feeling you get between the time you do something and the time you tell a woman what you did."

Reply to
Marian Aldenhövel

I'm not sure whether you know of or have considered using the PXE protocol to boot your client nodes. Most modern Ethernet NICs allow you to boot off a central server using the TFTP protocol. For smallish applications you don't really need a hard disk (or cf disk). If you have bigger space requirements you could potentially NFS mount a shared directory structure from the central server.

You first assemble a target root filesystem (rootfs) with your OS and application, which you will eventually package as an initrd image. You then compile a light-weight kernel according to your needs and ensure that it has initrd support enabled. Both the kernel and rootfs are shared from the central controller and each client accesses them from the PXE environment. Your whole OS exists in RAM and is cleaned on every boot (you can save files either onto a local cf disk or NFS mount).

If you need more information, search for "TinyGentoo" using Google.

Reply to
Andrew Symington

Hi,

Yes I did.

These machines are going to be connected most of the time, and/or in most installation. They have to be able to boot without net connectivity as well, though. And their local environment (is there a server on the same LAN? etc.) is not very well-defined.

So network-boot is not an option for me.

As an update to my oldish post:

Yes, not only is it perfectly acceptable to not switch roots if your system does not require it. It works, too. And it is not even against any law :-).

I now have a system that boots from CF using SysLinux. Then loads an initramfs-image from said CF and uses that as final root-fs. It then goes on initializing using minit and in that process loads modules for network and the FAT-filesystem the CF is formatted as. Finally it mounts said CF again unter /mnt to read per-device configuration and allow a bit of persistent storage. It is also possible to update the little thingies in the field by supplying a fresh kernel and/or initramfs to the mounted FAT-fs over SCP (as the rootfs-image has been loaded into RAM and is not mounted in itself) and then reboot them.

I built that system using T2

formatting link
Without any special aggressive tuning measures it is very full-featured based on a current kernel and weighs in at about 7MB Kernel+gzipped initramfs. After boot 18MB of RAM are used.

Ciao, MM

--=20 Marian Aldenh=C3=B6vel, Rosenhain 23, 53123 Bonn

formatting link
"Success is the happy feeling you get between the time you do something and the time you tell a woman what you did."

Reply to
Marian Aldenhövel

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.