Subject: Re: tell nfs_boot to ignore boottstatic
To: Martin Husemann <martin@duskware.de>
From: Manuel Bouyer <bouyer@antioche.eu.org>
List: tech-kern
Date: 07/02/2007 20:38:37
On Mon, Jul 02, 2007 at 12:25:48AM +0200, Martin Husemann wrote:
> On Sun, Jul 01, 2007 at 10:59:08PM +0200, Manuel Bouyer wrote:
> > Hi,
> > currently, if NFS_BOOT_BOOTSTATIC is defined, it will be tried first and
> > other methods will be tried only if nfs_bootstatic() returns an error.
> > There's no real way to tell from *nfs_bootstatic_callback() that we don't
> > want BOOTSTATIC (we could return something that would cause
> > nfs_boot_setaddress() to return an error but it's not a real solution.
> 
> Can you give a bit more background?
> 
> NFS_BOOT_BOOTSTATIC seems to be undocumented and only used in xen. I see from
> the code what it does from the nfs point of view, but I don't understand why
> you would want it to fail (not understanding the existing xen part, esp. where
> it gets it's config info from).

No, NFS_BOOT_BOOTSTATIC is available for any system with an ethernet adapter
(even if it was added for Xen). The fact that is't undocumented is a
separate issue :)

With NFS_BOOT_BOOTSTATIC, you can use NFS_BOOTSTATIC_MYIP, NFS_BOOTSTATIC_MASK,
NFS_BOOTSTATIC_SERVADDR, etc ... options to define at compile time
the NFS root to be used. Alternatively MD code can register a callback
which can provide this information from another source (command line,
ROM, ...). Xen is using this callback to get the information from
the command line, but I think it should be easy to add this functionality
to multiboot(8) too.

The issue here is that when NFS_BOOT_BOOTSTATIC is defined in kernel config
file, it's called first and DHCP or BOOTPARAM won't be tried (unless something
went really wrong). This mean we can't have a kernel which can do
either static config or dhcp/bootparam config depending on the command
line. I propose to add a way for the callback to say "no, we won't do
bootstatic this time".

-- 
Manuel Bouyer <bouyer@antioche.eu.org>
     NetBSD: 26 ans d'experience feront toujours la difference
--