From owner-svn-src-head@freebsd.org Fri Apr 8 03:38:12 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 80C7FB08662; Fri, 8 Apr 2016 03:38:12 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail110.syd.optusnet.com.au (mail110.syd.optusnet.com.au [211.29.132.97]) by mx1.freebsd.org (Postfix) with ESMTP id 14277182C; Fri, 8 Apr 2016 03:38:11 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from c110-21-41-193.carlnfd1.nsw.optusnet.com.au (c110-21-41-193.carlnfd1.nsw.optusnet.com.au [110.21.41.193]) by mail110.syd.optusnet.com.au (Postfix) with ESMTPS id 4DB88780BAB; Fri, 8 Apr 2016 13:38:03 +1000 (AEST) Date: Fri, 8 Apr 2016 13:38:01 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Maxim Sobolev cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r297690 - head/sys/boot/forth In-Reply-To: <201604080024.u380OL4Q087516@repo.freebsd.org> Message-ID: <20160408121934.H1779@besplex.bde.org> References: <201604080024.u380OL4Q087516@repo.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.1 cv=KvuwojiN c=1 sm=1 tr=0 a=73JWPhLeruqQCjN69UNZtQ==:117 a=L9H7d07YOLsA:10 a=9cW_t1CCXrUA:10 a=s5jvgZ67dGcA:10 a=kj9zAlcOel0A:10 a=9sqBlyX0pr8N2FYJr5AA:9 a=CjuIK1q_8ugA:10 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Apr 2016 03:38:12 -0000 On Fri, 8 Apr 2016, Maxim Sobolev wrote: > Log: > Document vfs.root.mountfrom. > > Reviewed by: imp, wblock The format of this variable is still undocumented, except in the source code. > Modified: head/sys/boot/forth/loader.conf.5 > ============================================================================== > --- head/sys/boot/forth/loader.conf.5 Fri Apr 8 00:01:19 2016 (r297689) > +++ head/sys/boot/forth/loader.conf.5 Fri Apr 8 00:24:21 2016 (r297690) This variable is (partly) documented in a different wrong file than the source file. It isn't a loader option. It is a kernel tunable. No other kernel tunables are documented in loader.conf.5. Some of them are documented in loader.8 (not really the right place --- loader is just 1 way of setting them, and isn't a way of reading or interpreting them). loader.8 also documents most loader options as BUILTIN ENVIRONMENT VARIABLES. It does this much better than loader.conf.5. It documents 30 such options and only has a couple of ordering errors in the list, whie loader.conf.5 documents 15 such options in random order. About half of the 15 are in both, and their descriptions give quite different details in a quite different style (too much double quoting in loader.conf.5). loader.8 documents only 16 tunables, with more ordering errors that for options. > @@ -112,6 +112,31 @@ The name must be a subdirectory of > that contains a kernel. > .It Ar kernel_options > Flags to be passed to the kernel. > +.It Ar vfs.root.mountfrom > +Specify the root partition to mount. > +For example: > +.Pp > +.Dl vfs.root.mountfrom="ufs:/dev/da0s1a" The source code gives the details needed to actually use this variable without guessing from a single example. It gives both an informal and formal description: X /* X * The root filesystem is detailed in the kernel environment variable X * vfs.root.mountfrom, which is expected to be in the general format X * X * :[][ :[] ...] X * vfsname := the name of a VFS known to the kernel and capable X * of being mounted as root X * path := disk device name or other data used by the filesystem X * to locate its physical store X * X * If the environment variable vfs.root.mountfrom is a space separated list, X * each list element is tried in turn and the root filesystem will be mounted X * from the first one that suceeds. X * X * The environment variable vfs.root.mountfrom.options is a comma delimited X * set of string mount options. These mount options must be parseable X * by nmount() in the kernel. X */ I thought that these careful descriptions were broken using sbufs which accidentally (?) changed the separator from space to newline. However, I can' find any trace of this in my config files -- they now just use a space. I might have just been confused by old kernels not supporting lists. I mainly use this feaature to work around the renaming of ad to ada and loss of the compatibility support for this. My lists look like "ufs:ad4s3a ufs:ada0s3a ufs:ad0s2a". Old kernels don't support lists, but they also don't support ada; they use the first entry and this works although the documentation says it shouldn't (the comment says that the format is :[] and doesn't mention field separators or trailing garbage). FreeBSD-11 doesn't supprt ad, but it supports lists; so it uses the second entry. This works on 2 systems with similar disk numbering. The third entry is for another system with different disk numbering an no ad4. This almost never works -- with old kernels, the list doesn't work, and with new kernels the list works and ada0 exists and ada0s3a exists, but it is not the right boot partition. This works with intermediate kernels with lists but no ada0, so that the third entry is used. Bruce