[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Is it possible to pass a remote config file to a PXE booted instance

From: JZB
Subject: Re: Is it possible to pass a remote config file to a PXE booted instance of grub.efi
Date: Sat, 14 Mar 2020 17:22:23 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.2.2

On 2020-03-13 21:35, Rivard, Matthew T wrote:
> Is there a command line flag that allows you to pass a config file at launch 
> time of a PXE loaded copy of grub.efi ?  This would be a grub.efi made with 
> the makestandalone tool.
> Example would be grub.efi -c 
> http://server/that/makes/the/configfile/for/this/boot.scriptinglngextension?variables=&morevariables=<http://server/that/makes/the/configfile/for/this/boot.scriptextension?variables=&morevariables=>

Not to pick nits, but isn't "makestandalone" mutually exclusive with
loading a config. file dynamically?  If I understand you correctly, you
want to load a "grub.cfg" over the network after PXE-booting into grub
from an EFI BIOS?  If this is what you, I do pretty much the same thing,
but I don't load grub.efi, but rather core.efi via dhcp.conf, and I use
grub-mknetdir instead:

grub-mknetdir --net-directory=/tftproot --subdir=/grub -d

and in my dhcp.conf:

    if option architecture-type = 00:00 {
      option configfile "pxelinux.cfg/C0A801";
      option pathprefix "";
      filename "/grub/i386-pc/core.0";
    } elsif option architecture-type = 00:07 {
      option configfile "pxelinux.cfg/C0A801";
      option pathprefix "";
      filename "/grub/x86_64-efi/core.efi";

core.efi is smart enough to pull /grub/grub.cfg without any further
options.  I did not need option 209.  I didn't have to do anything more
but provide "/grub/grub.cfg" (at /tftproot/grub/grub.cfg).  You'll need
to inspect the results of the grub-mknetdir command to verify all this
on your system.  Note that this all rides over tftp, not http as you
requested above.  There are a few BIOS's that support NBP over http
directly (instead of tftp), and that might induce core.efi to request
/grub/grub.cfg over http as well, but I can't vouch for that, as tftp is
all I run, given how rare http for NBP is (there were some BIOS bugs
that only recently got fixed...).  As best I can tell, core.efi simply
uses the network port as configured by BIOS/PXE from dhcp server to
simply tftp /grub/grub.cfg and goes from there.  Appears to be default
behavior.  Seems if you _didn't_ want this, then you'd go with
grub-mkstandalone and embed grub.cfg into grub.efi.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]