RFC: enhancing the root mount logic

Poul-Henning Kamp phk at phk.freebsd.dk
Tue Aug 24 15:48:59 UTC 2010


In message <760A97A4-62D2-4900-915D-CA5D889855E1 at mac.com>, Marcel Moolenaar wri
tes:

>I'm perfectly happy to say that the ramdisk approach
>is the most generic and solution for desktop and
>server machines but I'm not at all ready to have it
>include embedded systems just yet. It's just too
>heavy weight...

I'm with Marcel here.

Except for one detail:

In deeply embedded applications the ramdisk is actually preferable,
because that saves you from providing a root filesystem any other
way.

Our solution for that is MD_PRELOADED which is quite a hack.

The bit missing for the ramdisk approach is the root-fs-swizzle, code.

There are two ways to do that, either a very magic mount-like system
call, or by pid==1 setting the name of the real rootfs with a sysctl
and exiting, which calls into the existing root-mount code again.

The latter is almost trivial to implement, just remember to start
the new /sbin/init with pid==1

Poul-Henning

-- 
Poul-Henning Kamp       | UNIX since Zilog Zeus 3.20
phk at FreeBSD.ORG         | TCP/IP since RFC 956
FreeBSD committer       | BSD since 4.3-tahoe    
Never attribute to malice what can adequately be explained by incompetence.


More information about the freebsd-arch mailing list