From owner-freebsd-current@FreeBSD.ORG Sun Jun 2 00:28:59 2013 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 488FF8B4 for ; Sun, 2 Jun 2013 00:28:59 +0000 (UTC) (envelope-from rmacklem@uoguelph.ca) Received: from esa-annu.net.uoguelph.ca (esa-annu.mail.uoguelph.ca [131.104.91.36]) by mx1.freebsd.org (Postfix) with ESMTP id 117286A1 for ; Sun, 2 Jun 2013 00:28:58 +0000 (UTC) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AqIEAACRqlGDaFvO/2dsb2JhbABagzmDPLtHgRN0giMBAQEDAQEBASAEJyALGxgCAg0ZAikBCSYGCAcEARwEh2YGDKgjkH6BJoxPfjQHgkSBFAOUeoJEgSmQF4MrIDKBAzY X-IronPort-AV: E=Sophos;i="4.87,785,1363147200"; d="scan'208";a="30932890" Received: from erie.cs.uoguelph.ca (HELO zcs3.mail.uoguelph.ca) ([131.104.91.206]) by esa-annu.net.uoguelph.ca with ESMTP; 01 Jun 2013 20:28:51 -0400 Received: from zcs3.mail.uoguelph.ca (localhost.localdomain [127.0.0.1]) by zcs3.mail.uoguelph.ca (Postfix) with ESMTP id 87093B4092; Sat, 1 Jun 2013 20:28:51 -0400 (EDT) Date: Sat, 1 Jun 2013 20:28:51 -0400 (EDT) From: Rick Macklem To: Lars Eggert Message-ID: <30016244.120440.1370132931499.JavaMail.root@erie.cs.uoguelph.ca> In-Reply-To: <375AA8A5-E385-4528-A460-D4B8FCB9497B@netapp.com> Subject: Re: mounting root from NFS via ROOTDEVNAME MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Originating-IP: [172.17.91.203] X-Mailer: Zimbra 6.0.10_GA_2692 (ZimbraWebClient - FF3.0 (Win)/6.0.10_GA_2692) Cc: Craig Rodrigues , freebsd-current X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Jun 2013 00:28:59 -0000 Lars Eggert wrote: > Hi, > > to conclude this thread, the patch below allows one to specify an nfs > rootfs via the ROOTDEVNAME kernel option, which will be mounted when > BOOTP does not return a root-path option. > > Lars > My only concern with this (mainly because I don't understand the rules applied to boot alternatives well enough) is that a few arm configs have both BOOTP, BOOTP_NFSROOT and ROOTDEVNAME specified, where ROOTDEVNAME is set to "ufs:...". I don't think this patch will break them, since I think they'll use NFS and ignore the ROOTDEVNAME, but I'm not completely sure. Does someone else know how HL201 boots, for example? Lars, if you have a src commit, you can consider this reviewed by me. If not, maybe Craig can review it and then I'll commit it. Thanks for doing this, rick > > diff --git a/sys/nfs/bootp_subr.c b/sys/nfs/bootp_subr.c > index 2c57a91..972fb12 100644 > --- a/sys/nfs/bootp_subr.c > +++ b/sys/nfs/bootp_subr.c > @@ -45,6 +45,7 @@ __FBSDID("$FreeBSD$"); > > #include "opt_bootp.h" > #include "opt_nfs.h" > +#include "opt_rootdevname.h" > > #include > #include > @@ -870,8 +871,20 @@ bootpc_call(struct bootpc_globalcontext *gctx, > struct thread *td) > rtimo = time_second + > BOOTP_SETTLE_DELAY; > printf(" (got root path)"); > - } else > + } else { > printf(" (no root path)"); > +#ifdef ROOTDEVNAME > + /* > + * If we'll mount rootfs from > + * ROOTDEVNAME, we can accept > + * offers without root paths. > + */ > + gotrootpath = 1; > + rtimo = time_second + > + BOOTP_SETTLE_DELAY; > + printf(" (ROOTDEVNAME)"); > +#endif > + } > printf("\n"); > } > } /* while secs */ > @@ -1440,6 +1453,16 @@ bootpc_decode_reply(struct nfsv3_diskless *nd, > struct bootpc_ifcontext *ifctx, > > p = bootpc_tag(&gctx->tag, &ifctx->reply, ifctx->replylen, > TAG_ROOT); > +#ifdef ROOTDEVNAME > + /* > + * If there was no root path in BOOTP, use the one in ROOTDEVNAME. > + */ > + if (p == NULL) { > + p = strdup(ROOTDEVNAME, M_TEMP); > + if (strcmp(strsep(&p, ":"), "nfs") != 0) > + panic("ROOTDEVNAME is not an NFS mount point"); > + } > +#endif > if (p != NULL) { > if (gctx->setrootfs != NULL) { > printf("rootfs %s (ignored) ", p); > > _______________________________________________ > freebsd-current@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-current > To unsubscribe, send any mail to > "freebsd-current-unsubscribe@freebsd.org"