From owner-freebsd-hackers@freebsd.org Mon Aug 3 18:40:17 2015 Return-Path: Delivered-To: freebsd-hackers@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 01D269B2C42 for ; Mon, 3 Aug 2015 18:40:17 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from outbound1b.ore.mailhop.org (outbound1b.ore.mailhop.org [54.200.247.200]) by mx1.freebsd.org (Postfix) with SMTP id D824D1196 for ; Mon, 3 Aug 2015 18:40:16 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from ilsoft.org (unknown [73.34.117.227]) by outbound1.ore.mailhop.org (Halon Mail Gateway) with ESMTPSA; Mon, 3 Aug 2015 18:40:23 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.14.9/8.14.9) with ESMTP id t73IeDFn016331; Mon, 3 Aug 2015 12:40:14 -0600 (MDT) (envelope-from ian@freebsd.org) Message-ID: <1438627213.70393.19.camel@freebsd.org> Subject: Re: Boot loader arguments (was: ZFS support for EFI) From: Ian Lepore To: Ganael Laplanche Cc: Eric McCorkle , freebsd-hackers@freebsd.org Date: Mon, 03 Aug 2015 12:40:13 -0600 In-Reply-To: <201508031532.44478.ganael.laplanche@corp.ovh.com> References: <201508031532.44478.ganael.laplanche@corp.ovh.com> Content-Type: text/plain; charset="us-ascii" X-Mailer: Evolution 3.12.10 FreeBSD GNOME Team Port Mime-Version: 1.0 Content-Transfer-Encoding: 7bit X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Aug 2015 18:40:17 -0000 On Mon, 2015-08-03 at 15:32 +0200, Ganael Laplanche wrote: > Hi Eric, > > I am replying to this -quite old now- post : > > https://lists.freebsd.org/pipermail/freebsd-hackers/2015-March/047486.html > > > More importantly, the EFI loader doesn't seem to make use of its > > command-line arguments at all. But a ZFS-enabled loader would really > > need the ability to take arguments from boot1 (or grub, or whatever > > else). > > where you were suggesting it would be interesting for the EFI loader to make > use of its arguments, which is still not the case. > > We've faced a similar problem here, where we needed the EFI loader be able to > locally override the root-path offered through BOOTP. A quick fix would have > been to hardcode the root-path but instead we chose to pass it through an > argument to the loader (which then sets a new environment variable : > dhcp.root-path.override). > > Find attached the two -simple- patches that allow such an operation. I don't > know if they can be interesting for you or for upstream inclusion (though they > are probably *not* ready for direct inclusion yet). > > Best regards, > It looks like your patches got scrubbed off somehow. I recently tweaked loader(8) to make it easier for the data normally gathered from bootp/dhcp to be provided "from the environment" -- whatever that may mean for a given flavor of loader. The network code already had some provisions for setting the required variables before the first attempt to do network access, my changes just shuffled things around a bit to make it easier to parse a "rootpath" var formatted as "rootserverip:/path/stuff" into the existing global vars. See r283062 for those changes, and r283066 for an example of obtaining the values from "somewhere" (in this case the u-boot environment) and setting the corresponding global vars for netbooting. The comments in r283066 might be a useful guide to implementing the same kind of thing based on parsing an EFI command line. It may be that my changes didn't cover all situations and more tweaking is needed, especially if the situation is that some data should come from bootp/dhcp and other data should be overridden from the command line. -- Ian