Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1MztXP-0006AD-Fp for mharc-grub-devel@gnu.org; Mon, 19 Oct 2009 10:48:43 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MztXM-00068k-Rq for grub-devel@gnu.org; Mon, 19 Oct 2009 10:48:40 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MztXI-00066x-3W for grub-devel@gnu.org; Mon, 19 Oct 2009 10:48:40 -0400 Received: from [199.232.76.173] (port=49040 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MztXI-00066u-0H for grub-devel@gnu.org; Mon, 19 Oct 2009 10:48:36 -0400 Received: from mail-yw0-f194.google.com ([209.85.211.194]:51808) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MztXH-0007J8-Kt for grub-devel@gnu.org; Mon, 19 Oct 2009 10:48:35 -0400 Received: by ywh32 with SMTP id 32so3776940ywh.14 for ; Mon, 19 Oct 2009 07:48:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=QtTPSXtX3IumgbyRgpadMi5mLqMm0qtPD0Lo0LOLA70=; b=afnrfCOzU9WuNt8klaqNmd+YywAUAt25gVieeBPyCPuQE0NPw+2sEBhlCEudLz1icJ yOU4L+hDvy9/a2ZpX2YWACqclGyW9MuOImNh7yiKNzKl28UxLGd+y/e3/m2lkwntYv1Z VtGYcY+fzAEGaa0PFpSeqjfTBaGw8unWo49kM= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=gGfmRybXsw4uiHg/F8IcwF+H2K8pt09aHCiZLeDP62aK2z1rxp9PGv6ksltZmQl6M8 o+y5N7XuW38OLn4rRyKAytwwAvIVgLuude2W/czvlG2LRHb8t1QCYCEwR1Zl3mSg/DY1 oANDlm2j8dNAd9A2cmvSZFPJLw4SiEQFMvosY= MIME-Version: 1.0 Received: by 10.150.239.1 with SMTP id m1mr8265136ybh.152.1255963713408; Mon, 19 Oct 2009 07:48:33 -0700 (PDT) In-Reply-To: <200910162012.47463.pisa@cmp.felk.cvut.cz> References: <4AD85FBB.6010507@gmail.com> <200910162012.47463.pisa@cmp.felk.cvut.cz> Date: Tue, 20 Oct 2009 01:18:33 +1030 Message-ID: From: Brendan Trotter To: The development of GRUB 2 Content-Type: text/plain; charset=ISO-8859-1 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 14:48:41 -0000 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". 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. 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