Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1MzqIP-0002CK-Cb for mharc-grub-devel@gnu.org; Mon, 19 Oct 2009 07:21:01 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MzqIN-0002Ar-7I for grub-devel@gnu.org; Mon, 19 Oct 2009 07:20:59 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MzqII-000275-4K for grub-devel@gnu.org; Mon, 19 Oct 2009 07:20:58 -0400 Received: from [199.232.76.173] (port=35916 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MzqII-00026v-1A for grub-devel@gnu.org; Mon, 19 Oct 2009 07:20:54 -0400 Received: from max.feld.cvut.cz ([147.32.192.36]:47261) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MzqIH-00034z-FZ for grub-devel@gnu.org; Mon, 19 Oct 2009 07:20:53 -0400 Received: from localhost (unknown [192.168.200.4]) by max.feld.cvut.cz (Postfix) with ESMTP id 39C0A19F3381 for ; Mon, 19 Oct 2009 13:20:50 +0200 (CEST) X-Virus-Scanned: IMAP AMAVIS Received: from max.feld.cvut.cz ([192.168.200.1]) by localhost (styx.feld.cvut.cz [192.168.200.4]) (amavisd-new, port 10044) with ESMTP id CuN9T2a9PkXb for ; Mon, 19 Oct 2009 13:20:46 +0200 (CEST) Received: from imap.feld.cvut.cz (imap.feld.cvut.cz [147.32.192.34]) by max.feld.cvut.cz (Postfix) with ESMTP id E7C1619F3397 for ; Mon, 19 Oct 2009 13:20:45 +0200 (CEST) Received: from woodstock (lkspc1.felk.cvut.cz [147.32.86.51]) (Authenticated sender: kapical1) by imap.feld.cvut.cz (Postfix) with ESMTPSA id D611CFA004 for ; Mon, 19 Oct 2009 13:20:45 +0200 (CEST) Content-Type: text/plain; charset=utf-8; format=flowed; delsp=yes X-Sieve: CMU Sieve 2.3 Received: from viefep13-int.chello.at (viefep13-int.chello.at [62.179.121.33]) by max.feld.cvut.cz (Postfix) with ESMTP id 1532B19F338D for ; Fri, 16 Oct 2009 20:12:49 +0200 (CEST) Received: from edge01.upc.biz ([192.168.13.236]) by viefep13-int.chello.at (InterMail vM.7.09.01.00 201-2219-108-20080618) with ESMTP id <20091016181249.OSXQ28202.viefep13-int.chello.at@edge01.upc.biz>; Fri, 16 Oct 2009 20:12:49 +0200 Received: from baree.pikron.com ([62.24.72.246]) by edge01.upc.biz with edge id tWCo1c02c5JpFYE01WCp3x; Fri, 16 Oct 2009 20:12:49 +0200 X-SourceIP: 62.24.72.246 From: "Pavel Pisa" To: grub-devel@gnu.org Date: Fri, 16 Oct 2009 20:12:47 +0200 User-Agent: KMail/1.9.9 References: <4AD85FBB.6010507@gmail.com> In-Reply-To: <4AD85FBB.6010507@gmail.com> Message-ID: <200910162012.47463.pisa@cmp.felk.cvut.cz> Resent-To: "grub-devel@gnu.org" MIME-Version: 1.0 Resent-From: =?utf-8?B?QWxlxaEgS2FwaWNh?= Resent-Date: Mon, 19 Oct 2009 13:20:45 +0200 Resent-Message-ID: Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 3) Cc: Vladimir 'phcoder' Serbinenko , Seth Goldberg , =?utf-8?B?QWxlxaEgS2FwaWNh?= 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 11:20:59 -0000 Forwarding Pavel Pisa's e-mail to the subscribers only list. On Friday 16 October 2009 13:57:47 Vladimir 'phcoder' Serbinenko wrote: > Ale=C5=A1 Kapica wrote: > > Dear friends, Hello Vladimir and other GRUB2 developers, I am replying to your review as one of the patch authors. > > Nobody can't use options 150 from DHCP, because GRUB2 don't have any > > driver for network adapters. Network task are done only through > > adapters PXE firmware. PXE passes informations only about IP > > addresses, but no DHCP options. > > I let someone more familiar with PXE than me to answer this. The 150 option would be usesfull a lot, but I do not know PXE good enough to support that. The PXE firmware seems to be problematic (high probability of bugs and diversity) to me anyway so we want to use as small subset as possible. 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. The knowledge of own IP can be even win in other situations. We use same diskless bootup setup provided by single server from multiple networks connected through more VLANs. The server provids NFS root through direct connection to the more subnets behind local firewall and server IP is different for these subnets. The knowledge of pxe_sever_ip from DHCP provides a simple way to use same conjfiguration with Linux commandline adjusted for right server IP for each subnet direct connection. So I strongly vote for a way to be able to use server IP provided by DHCP/PXE. The implementation details are other story. I have almost no Grub programming experience and I am prepared to follow your suggestions. > > In current state these informations is possible only to list, that > > means that they aren't a part of the grubs environment. > > My patch solve this. Now is this possible to set PXE informations as > > grubs environment variables, and use in them in grub.cfg for > > identification of the booting machine. > > > > Is there any problem with adding of my patch? > > I've looked into your first patch. The idea is good however patch has > some problems: > 1) Don't hardcode array sizes. Use sizeof ("XXX.XXX.XXX.XXX") instead Yes, that a good idea, may it be add +1 or +2 for safety even that not required. > 2) Exporting variables shouldn't require user to run a command. Just > export them as soon as possible (e.g. on module load) I am not sure about module initialization order, if the module is integr= ated to the main grub image. Is it ensured, that internal PXE C variables are = set before any module is loaded? May it be, better solution would be to ensure unconditional variables setting if PXE base is used. But is the environment variables subsystem ready at that time? My knowledge is not deep enough to reply to these without longer analysis so I would take this safe approach. > 3) "your_ip" is problematic name. I would prefer "local_ip" and "remote= _ip" I agree that name is strange but I tried to follow names already used in the sources. My personal vote would be to have "station_ip" and "server_i= p" but I do not see this so much important. Feel free to modify or suggest names according your preferences. If you prefer to receive new patch version, we will prepare and test it in university labs and VLANs infrastructure on Monday. By the way we have experienced some troubles with actual kernel image load over PXE with our motherboards. Short files reading and typing over PXE has no problems. Has somebody this experience. Can that be PXE mainboard firmware bug? Thanks in advance, Pavel Pisa e-mail: pisa@cmp.felk.cvut.cz www: http://cmp.felk.cvut.cz/~pisa university: http://dce.felk.cvut.cz/ company: http://www.pikron.com/