[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Using network informations from PXE as grub2 enviroment variables
From: |
Vladimir 'phcoder' Serbinenko |
Subject: |
Re: Using network informations from PXE as grub2 enviroment variables |
Date: |
Mon, 19 Oct 2009 23:18:43 +0200 |
User-agent: |
Mozilla-Thunderbird 2.0.0.22 (X11/20090701) |
Brendan Trotter wrote:
> Hi,
>
> On Sat, Oct 17, 2009 at 4:42 AM, Pavel Pisa <address@hidden> 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
> address@hidden
> http://lists.gnu.org/mailman/listinfo/grub-devel
>
>
--
Regards
Vladimir 'phcoder' Serbinenko
Personal git repository: http://repo.or.cz/w/grub2/phcoder.git