Fstab file path

Alexander Yerenkow yerenkow at gmail.com
Sat Jul 14 22:00:20 UTC 2012


Hello all.
I'm trying to get single-world in read-only and multi-userland media
and I get difficulties with path "/etc/fstab" been hardcoded and there
is no way for override it.
I'm talking about getrootmount in
sys/boot/common/boot.c:315

Could we elaborate a bit this moment?
What I'm trying to do is to get one single partition, with installed
world+kernel;
let's call it rootPT
and also I have few partitions for mount to /usr/local and to /var,
like localA, varA, localB, varB, etc.
Main difficulty is that "fstab" path is hardcoded, and it searched in
subdir of root partition, and I can't specify it in any way in stock
FreeBSD.

How about have one more env with path to fstab (like
vfs.root.mountfrom, but with vfs.fstab.filepath, which checks, and if
it's null falling back to default hard-coded one)? Note, that this
will not change some default standards or behaviors, it will just add
some flexibility.
Currently, to make media as I need, I would need several absolutely
same filesystems on different partitions, just to separate fstabs (As
a result - duplication of world/kernel, or I end up with complex root
system with many links).
With ability to set path to fstab, I would need only edit loader.conf
and restart system into new setup.

Also, I noticed that fstab.c is implemented way for specifying
different fstab (maybe just for editing?...). But there's also
relatively lot of other scripts which used hardcoded fstab path too.
Now I'm thinking that I'll end up with writing handy script which will
override /etc/fstab just before reboot :)
I just thought that lack of flexibility in this point could be
interesting for someone.

-- 
Regards,
Alexander Yerenkow


More information about the freebsd-current mailing list