Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 03 Aug 2015 12:40:13 -0600
From:      Ian Lepore <ian@freebsd.org>
To:        Ganael Laplanche <ganael.laplanche@corp.ovh.com>
Cc:        Eric McCorkle <emc2@metricspace.net>, freebsd-hackers@freebsd.org
Subject:   Re: Boot loader arguments (was: ZFS support for EFI)
Message-ID:  <1438627213.70393.19.camel@freebsd.org>
In-Reply-To: <201508031532.44478.ganael.laplanche@corp.ovh.com>
References:  <201508031532.44478.ganael.laplanche@corp.ovh.com>

next in thread | previous in thread | raw e-mail | index | archive | help
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





Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?1438627213.70393.19.camel>