From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1Mzzd3-0004Jd-U3 for mharc-grub-devel@gnu.org; Mon, 19 Oct 2009 17:18:57 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Mzzd1-0004II-Uj for grub-devel@gnu.org; Mon, 19 Oct 2009 17:18:55 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Mzzcw-0004FX-Nv for grub-devel@gnu.org; Mon, 19 Oct 2009 17:18:55 -0400 Received: from [199.232.76.173] (port=52476 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Mzzcw-0004FN-Gz for grub-devel@gnu.org; Mon, 19 Oct 2009 17:18:50 -0400 Received: from mail-bw0-f215.google.com ([209.85.218.215]:34959) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1Mzzcw-0005KA-3y for grub-devel@gnu.org; Mon, 19 Oct 2009 17:18:50 -0400 Received: by bwz7 with SMTP id 7so62163bwz.26 for ; Mon, 19 Oct 2009 14:18:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from :user-agent:mime-version:to:subject:references:in-reply-to :content-type:content-transfer-encoding; bh=WAFAzxVzM8+tmc5p3xm3EFNbyvdI0qTTHJ1JdPiA2h0=; b=nga5ycTmS1T9nVmyptftrtpEB3xY0PeDOXLBanZSjyctyfLU9QRhGSKZ+fxQWt4tIL yPIgRUsv1LOjQCbg96uvZhU0L9zc6UhEtIYzyvOooqWFpRjre4gVqXHGUQGd5dpx5hYz 9FIj/ykDoKxjosOPOrqLXbKb8qftwrwqjXp0I= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to:content-type:content-transfer-encoding; b=fzgmY+Lg9I+WKVPYoB0a2KKlqIL78dNGNXI1qI8atrZuwmkJ5QE3Hnb1kFnWAihdET igtRbCwBcOkh+RqwVlaYeJ+iO6ULvuP9VBCp9CBEH4jckOMQTJuobo1V9EFbW3UZHUXp kvuOk1K/Z8DYG1GVrZaLipvqcQjth8ueIgaLA= Received: by 10.204.25.5 with SMTP id x5mr5407855bkb.166.1255987128274; Mon, 19 Oct 2009 14:18:48 -0700 (PDT) Received: from debian.bg45.phnet (gprs01.swisscom-mobile.ch [193.247.250.1]) by mx.google.com with ESMTPS id 16sm21847bwz.11.2009.10.19.14.18.46 (version=TLSv1/SSLv3 cipher=RC4-MD5); Mon, 19 Oct 2009 14:18:46 -0700 (PDT) Message-ID: <4ADCD7B3.40207@gmail.com> Date: Mon, 19 Oct 2009 23:18:43 +0200 From: Vladimir 'phcoder' Serbinenko User-Agent: Mozilla-Thunderbird 2.0.0.22 (X11/20090701) MIME-Version: 1.0 To: The development of GRUB 2 References: <4AD85FBB.6010507@gmail.com> <200910162012.47463.pisa@cmp.felk.cvut.cz> In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 2) Subject: Re: Using network informations from PXE as grub2 enviroment variables X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: The development of GRUB 2 List-Id: The development of GRUB 2 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Oct 2009 21:18:56 -0000 Brendan Trotter wrote: > Hi, > > On Sat, Oct 17, 2009 at 4:42 AM, Pavel Pisa 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