[patch] functional prototype of root mount enhancement

Marcel Moolenaar xcllnt at mac.com
Tue Sep 28 06:22:58 UTC 2010


All,

I prototyped the root mount enhancement previously discussed.
I would appreciate feedback and suggestions and bug reports
of course.

See:
http://docs.freebsd.org/cgi/getmsg.cgi?fetch=5942+0+current/freebsd-arch
http://docs.freebsd.org/cgi/getmsg.cgi?fetch=120899+0+archive/2010/freebsd-arch/20100829.freebsd-arch

The prototype supports all boot options that affect the root
mount. Those are: -a, -C, -r
When present, the initial root mount directives get adjusted
accordingly.

The prototype adds better support for mount options. Both the
interactive, as well has the compiled-in root mount option
(i.e. ROOTDEVNAME) can contain mount options.

Not implemented yet is the .onfail handling, as well as the
.timeout handling (previously called .wait). Also, the .init
directive is not implemented.

There's 1 bug under investigation: when a 2nd (non-devfs)
file system is mounted as root, the 1st (non-devfs) gets
moved under /.mount or /mnt under the new (=2nd) file
system. However, trying to access the file system results in
a WITNESS panic caused by a syscall leaving with the ufs
lock held.

The code has some debug output still, which is helpful to
see what's going on internally. From a boot (with a
/.mount.conf present on ufs:/dev/ad0s1a):

	:
WARNING: WITNESS option enabled, expect reduced performance.
Root mount waiting for: usbus1
Root mount waiting for: usbus1
uhub1: 6 ports with 6 removable, self powered
Root mount waiting for: usbus1
Root mount waiting for: usbus1
ugen1.2: <Apple Inc.> at usbus1
========
.onfail panic
.timeout 1
ufs:/dev/ad0s1a rw
.ask
========
Trying to mount root from ufs:/dev/ad0s1a [rw]...
XXX: vfs_mountroot_parse: error = 0, mpdevfs=0xc3fa3000, mp=0xc3fa2c94
========
.onfail continue
#ufs:/dev/da0a
.ask
========

Loader variables:
  vfs.root.mountfrom=ufs:/dev/ad0s1a
  vfs.root.mountfrom.options=rw

Manual root filesystem specification:
  <fstype>:<device> [options]
      Mount <device> using filesystem <fstype>
      and with the specified (optional) option list.

    eg. ufs:/dev/da0s1a
        cd9660:/dev/acd0 ro
          (which is equivalent to: mount -t cd9660 -o ro /dev/acd0 /

  ?                  List valid disk boot devices
  <empty line>       Abort manual input

mountroot> 
XXX: vfs_mountroot_parse: error = -1, mpdevfs=0xc3fa3000, mp=0
	:

In case the attachment gets eaten:
	http://www.xcllnt.net/~marcel/rootmount.diff

-- 
Marcel Moolenaar
xcllnt at mac.com


-------------- next part --------------
A non-text attachment was scrubbed...
Name: rootmount.diff
Type: application/octet-stream
Size: 42019 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/freebsd-arch/attachments/20100928/a1d58955/rootmount.obj


More information about the freebsd-arch mailing list