Subject: tell nfs_boot to ignore boottstatic
To: None <tech-kern@netbsd.org>
From: Manuel Bouyer <bouyer@antioche.eu.org>
List: tech-kern
Date: 07/01/2007 22:59:08
--ZGiS0Q5IWpPtfppv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
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.
the attached patch adds a new flag, NFS_BOOTSTATIC_NOSTATIC, that a callback
can set. If set, nfs_bootstatic() immediatly exists with EOPNOTSUPP,
amd nfs_boot_init() will continue with the next configured method.
Does anyone object to this ?
--
Manuel Bouyer <bouyer@antioche.eu.org>
NetBSD: 26 ans d'experience feront toujours la difference
--
--ZGiS0Q5IWpPtfppv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=diff
Index: nfs_bootstatic.c
===================================================================
RCS file: /cvsroot/src/sys/nfs/nfs_bootstatic.c,v
retrieving revision 1.4
diff -u -r1.4 nfs_bootstatic.c
--- nfs_bootstatic.c 4 Mar 2007 06:03:36 -0000 1.4
+++ nfs_bootstatic.c 1 Jul 2007 20:45:42 -0000
@@ -78,6 +78,9 @@
else
flags = 0;
+ if (flags & NFS_BOOTSTATIC_NOSTATIC)
+ return EOPNOTSUPP;
+
if (flags == 0) {
#ifdef NFS_BOOTSTATIC_MYIP
nd->nd_myip.s_addr = inet_addr(NFS_BOOTSTATIC_MYIP);
Index: nfsdiskless.h
===================================================================
RCS file: /cvsroot/src/sys/nfs/nfsdiskless.h,v
retrieving revision 1.25
diff -u -r1.25 nfsdiskless.h
--- nfsdiskless.h 8 May 2007 06:10:28 -0000 1.25
+++ nfsdiskless.h 1 Jul 2007 20:45:42 -0000
@@ -98,6 +98,7 @@
#define NFS_BOOTSTATIC_HAS_MASK 0x04
#define NFS_BOOTSTATIC_HAS_SERVADDR 0x08
#define NFS_BOOTSTATIC_HAS_SERVER 0x10
+#define NFS_BOOTSTATIC_NOSTATIC 0x20
#endif /* _KERNEL */
#endif /* _NFS_NFSDISKLESS_H_ */
--ZGiS0Q5IWpPtfppv--