Received: from list by lists.gnu.org with archive (Exim 4.71) id 1agAhk-0005cx-NS for mharc-grub-devel@gnu.org; Wed, 16 Mar 2016 08:37:36 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:40539) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ag9CT-0004fd-Hb for grub-devel@gnu.org; Wed, 16 Mar 2016 07:01:14 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ag9CQ-0006Xg-RP for grub-devel@gnu.org; Wed, 16 Mar 2016 07:01:13 -0400 Received: from e23smtp09.au.ibm.com ([202.81.31.142]:32828) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ag9CQ-0006XG-7b for grub-devel@gnu.org; Wed, 16 Mar 2016 07:01:10 -0400 Received: from localhost by e23smtp09.au.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Wed, 16 Mar 2016 21:01:05 +1000 Received: from d23dlp03.au.ibm.com (202.81.31.214) by e23smtp09.au.ibm.com (202.81.31.206) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Wed, 16 Mar 2016 21:01:04 +1000 X-IBM-Helo: d23dlp03.au.ibm.com X-IBM-MailFrom: nikunj@linux.vnet.ibm.com X-IBM-RcptTo: grub-devel@gnu.org Received: from d23relay06.au.ibm.com (d23relay06.au.ibm.com [9.185.63.219]) by d23dlp03.au.ibm.com (Postfix) with ESMTP id 6CA05357805E for ; Wed, 16 Mar 2016 22:00:59 +1100 (EST) Received: from d23av03.au.ibm.com (d23av03.au.ibm.com [9.190.234.97]) by d23relay06.au.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id u2GB0p5h17891508 for ; Wed, 16 Mar 2016 22:00:59 +1100 Received: from d23av03.au.ibm.com (localhost [127.0.0.1]) by d23av03.au.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id u2GB0Qo6002299 for ; Wed, 16 Mar 2016 22:00:27 +1100 Received: from abhimanyu.in.ibm.com.vnet.linux.ibm.com (abhimanyu.in.ibm.com [9.124.35.126] (may be forged)) by d23av03.au.ibm.com (8.14.4/8.14.4/NCO v10.0 AVin) with ESMTP id u2GB0OXG001420 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Wed, 16 Mar 2016 22:00:25 +1100 From: Nikunj A Dadhania To: Andrei Borzenkov , The development of GNU GRUB Subject: Re: [PATCH] bootp: set is_def while processing dhcp ack In-Reply-To: References: <1458117324-5685-1-git-send-email-nikunj@linux.vnet.ibm.com> <87h9g63ey5.fsf@abhimanyu.in.ibm.com> User-Agent: Notmuch/0.21 (http://notmuchmail.org) Emacs/24.5.1 (x86_64-redhat-linux-gnu) Date: Wed, 16 Mar 2016 16:30:00 +0530 Message-ID: <87egba3cy7.fsf@abhimanyu.in.ibm.com> MIME-Version: 1.0 Content-Type: text/plain X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 16031611-0033-0000-0000-0000034200FB X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 202.81.31.142 Cc: mpe@ellerman.id.au X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list Reply-To: The development of GNU GRUB List-Id: The development of GNU GRUB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Mar 2016 12:37:34 -0000 Andrei Borzenkov writes: > On Wed, Mar 16, 2016 at 1:16 PM, Nikunj A Dadhania > wrote: >> Hi Andrei, >> >> Thanks for a quick review. >> >> Andrei Borzenkov writes: >>> On Wed, Mar 16, 2016 at 11:35 AM, Nikunj A Dadhania >>> wrote: >>>> While testing netboot on ppc64, found that the grub_net_default_server >>>> is not set even when the dhcp response has sent the server IP. This would >>>> result in a failure during netbooting with following error: >>>> >>>> error: no server is specified. >>>> >>>> This patch sets the is_def variable which would result in setting the >>>> grub_net_default_server and then netboot from the server. >>>> >>>> Signed-off-by: Nikunj A Dadhania >>>> --- >>>> grub-core/net/bootp.c | 2 +- >>>> 1 file changed, 1 insertion(+), 1 deletion(-) >>>> >>>> diff --git a/grub-core/net/bootp.c b/grub-core/net/bootp.c >>>> index a088244..74b8b79 100644 >>>> --- a/grub-core/net/bootp.c >>>> +++ b/grub-core/net/bootp.c >>>> @@ -278,7 +278,7 @@ grub_net_process_dhcp (struct grub_net_buff *nb, >>>> } >>>> grub_net_configure_by_dhcp_ack (name, card, >>>> 0, (const struct grub_net_bootp_packet *) nb->data, >>>> - (nb->tail - nb->data), 0, 0, 0); >>>> + (nb->tail - nb->data), 1, 0, 0); >>> >>> That's wrong, sorry. "is default" is intended to be used from initial >>> configuration based on information from firmware (i.e. - firmware does >>> PXE boot and we configure interface based on PXE packet firmware made >>> available for us). >> >>> If you call net_bootp manually, >> >> Thats what we are using in this current case, booting from the disk, >> and the grub.cfg has a netboot entry. >> >> menuentry 'Linux dev netboot' --class os { >> insmod net >> insmod ofnet >> insmod tftp >> >> net_bootp >> >> echo 'Network status: ' >> net_ls_cards >> net_ls_addr >> net_ls_routes >> >> echo 'Loading Linux ...' >> linux (tftp)/ubuntu-installer/ppc64el/vmlinux tasks=standard pkgsel/language-pack-patterns= pkgsel/install-language-support=false --- quiet >> initrd (tftp)/ubuntu-installer/ppc64el/initrd.gz >> } >> > > OK, so you attempt to configure everything. The first obvious question > is - *which* interface should now become default? In this case I only had one interface. So thats the default. > Your patch would make them compete, whoever is the last would win. Oh ok. Will "net_bootp" try all the interfaces ? > We would need to define some mechanism to designate interface as "default" here. > >>> server is stored in environment variable net__dhcp_server_name; >>> you are free to use it as needed, e.g. set $root and $prefix. >>> > > You can already fetch this information from environment. Something like > > for i in 0 1 2 3 4 5; do > eval "set ip=\$net_ofnet${i}_dhcp_server" > if [ -n "$ip" ]; then > set boot_from=tftp,$ip > break > fi > done > Thanks, will try this out. > And later use ($boot_from) everywhere. Regards Nikunj