From: Vladimir 'phcoder' Serbinenko <phcoder@gmail.com>
To: The development of GRUB 2 <grub-devel@gnu.org>
Subject: Re: Using network informations from PXE as grub2 enviroment variables
Date: Mon, 19 Oct 2009 23:18:43 +0200 [thread overview]
Message-ID: <4ADCD7B3.40207@gmail.com> (raw)
In-Reply-To: <b1ebdcad0910190748l7d1e95f9x650d0a251486e79@mail.gmail.com>
Brendan Trotter wrote:
> Hi,
>
> On Sat, Oct 17, 2009 at 4:42 AM, Pavel Pisa <pisa@cmp.felk.cvut.cz> wrote:
>
>> As for scalability, I agree, that use of single config file with checking
>> for each IP is horrible hack, but there is no problem to source
>> to another IP specific file (menu-xxx.xxx.xxx.xxx.lst) with separate
>> menu configuration when own IP is known and if file is not found
>> switch do default one.
>>
>
>
>> So I strongly vote for a way to be able to use server IP provided
>> by DHCP/PXE.
>>
>
> I vote for using the ethernet card's MAC address (which never changes)
> instead of whatever IP address the DHCP server felt like *dynamically*
> assigning...
>
> GRUB could (should?) download a configuration file from the TFTP
> server that's called "123456789ABC.cfg" or "123456789ABC/grub.cfg"
> (where "123456789ABC" is the ethernet card's MAC address) ; and if
> that's not found it should try something like "default.cfg".
>
>
As a free software project we should avoid hardcoding configuration. Let
sysadmin decide how he wants to configure his boot
> Putting the ethernet card's MAC address and the current IP address
> into an environment variable (e.g. for use in command line parameters)
> might be fun too.
>
Just exporting them and doing sth like
if [ test -f $prefix/grub.cfg.$pxe_mac ]; then
configfile $prefix/grub.cfg.$pxe_mac
else
configfile $prefix/grub.cfg.generic
fi
is enough
> Note 1: the easiest way to find the ethernet card's MAC address and
> the computer's IP address is to use the "GET_CACHED_INFO" function
> (opcode 7), with the Packet type field set to 2 (DHCP ACK from
> server); because you need to use this function to find the IP address
> of the TFTP server anyway.
>
> Note 2: the name "your_ip" probably came from the PXE specification.
>
>
> Cheers,
>
> Brendan
>
>
> _______________________________________________
> Grub-devel mailing list
> Grub-devel@gnu.org
> http://lists.gnu.org/mailman/listinfo/grub-devel
>
>
--
Regards
Vladimir 'phcoder' Serbinenko
Personal git repository: http://repo.or.cz/w/grub2/phcoder.git
prev parent reply other threads:[~2009-10-19 21:18 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-10-16 11:42 Using network informations from PXE as grub2 enviroment variables Aleš Kapica
2009-10-16 11:57 ` Vladimir 'phcoder' Serbinenko
2009-10-16 18:12 ` Pavel Pisa
2009-10-16 20:51 ` Seth Goldberg
2009-10-16 21:05 ` Vladimir 'phcoder' Serbinenko
2009-10-16 21:16 ` Seth Goldberg
2009-10-19 14:48 ` Brendan Trotter
2009-10-19 19:59 ` Seth Goldberg
2009-10-19 21:18 ` Vladimir 'phcoder' Serbinenko [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4ADCD7B3.40207@gmail.com \
--to=phcoder@gmail.com \
--cc=grub-devel@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.