RFC: enhancing the root mount logic

mdf at FreeBSD.org mdf at FreeBSD.org
Mon Aug 23 22:07:32 UTC 2010


On Mon, Aug 23, 2010 at 2:30 PM, Marcel Moolenaar <marcelm at juniper.net> wrote:
> In embedded products, software is possibly installed as an image onto
> an actual storage device. This means that mounting the storage device
> as root is not enough to have a usable root file system. The rough
> draft below is an idea to enhance the root mount from having ad-hoc
> quirks to a well-defined and recursive mechanism to allow a wide-
> range of use cases.

I am not making any claims to the overall desirability of this, but as
a suggestion for the file format:

>   [devfs]      /.mount.conf:
>        ufs:/dev/da0
>        .ask
>        .wait 5
>        .onfail panic

To me, this should wait 0 seconds (or whatever the default is) until
after the .ask mount point has been tried.

I'd suggest something like:

   [devfs]      /.mount.conf:
        .wait 10
        ufs:/dev/da0
        # wait up to 10 seconds for ufs
        .wait 5
        .ask
        # wait up to 5 seconds for the prompt-returned filesystem
        .onfail panic

The two reasons for such a usage:

1) simplifies parsing, since the file only needs to be read to a mount
directive, not read in its entirety.
2) allows different timeouts for each root mount location

I could also imagine, instead, a .mount directive, so that all
"commands" start with a '.' which would be like:

.mount ufs:/dev/da0 8

which would be an 8 second timeout on the specified mount point.

Anyways, as a flexible mechanism this sounds reasonable.  I have no
idea how it compares to what other operating systems do, which is only
relevant insofar as making migration from another platform easier.

Thanks,
matthew


More information about the freebsd-arch mailing list