Brendan Trotter wrote: > Hi, > > On Sat, Oct 17, 2009 at 4:42 AM, Pavel Pisa <p...@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 _______________________________________________ Grub-devel mailing list Grub-devel@gnu.org http://lists.gnu.org/mailman/listinfo/grub-devel