Received: from list by lists.gnu.org with archive (Exim 4.71) id 1cItxB-0006rw-G1 for mharc-grub-devel@gnu.org; Mon, 19 Dec 2016 04:09:53 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:34265) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cItx9-0006qJ-JX for grub-devel@gnu.org; Mon, 19 Dec 2016 04:09:52 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cItx5-0006nu-Ia for grub-devel@gnu.org; Mon, 19 Dec 2016 04:09:51 -0500 Received: from smtp.nue.novell.com ([195.135.221.5]:55809) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1cItx5-0006mC-92 for grub-devel@gnu.org; Mon, 19 Dec 2016 04:09:47 -0500 Received: from nwb-ext-pat.microfocus.com ([10.120.13.103]) by smtp.nue.novell.com with ESMTP (TLS encrypted); Mon, 19 Dec 2016 10:09:44 +0100 Received: from linux-9gqx.suse.de (nwb-a10-snat.microfocus.com [10.120.13.201]) by nwb-ext-pat.microfocus.com with ESMTP (TLS encrypted); Mon, 19 Dec 2016 09:09:11 +0000 Date: Mon, 19 Dec 2016 17:09:04 +0800 From: Michael Chang To: grub-devel@gnu.org Subject: [PATCH] Fix fwpath in efi netboot Message-ID: <20161219090904.GA21413@linux-9gqx.suse.de> Mail-Followup-To: grub-devel@gnu.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.24 (2015-08-30) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [fuzzy] X-Received-From: 195.135.221.5 X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: The development of GNU GRUB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Dec 2016 09:09:52 -0000 The path returned by grub_efi_net_config has already been stripped for the directory part extracted from cached bootp packet. We should just return the result to avoild it be stripped again. It fixed the problem that grub.efi as NBP image always looking for grub.cfg and platform directory in upper folder rather than current one it gets loaded while $prefix is empty. The behavior is inconsistent with other architecture and how we would expect empty $prefix going to be in general. The only exception to the general rule of empty $prefix is that when loaded from platform directory itself, the platform part is stripped thus upper folder is used for looking up files. It meets the case for how grub-mknetdir lay out the files under tftp root directory, but also hide away this issue to be identified as it appears to be just works. --- grub-core/kern/efi/init.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/grub-core/kern/efi/init.c b/grub-core/kern/efi/init.c index e9c85de..dfa35a2 100644 --- a/grub-core/kern/efi/init.c +++ b/grub-core/kern/efi/init.c @@ -61,7 +61,10 @@ grub_machine_get_bootlocation (char **device, char **path) *device = grub_efidisk_get_device_name (image->device_handle); *path = grub_efi_get_filename (image->file_path); if (!*device && grub_efi_net_config) - grub_efi_net_config (image->device_handle, device, path); + { + grub_efi_net_config (image->device_handle, device, path); + return; + } if (*path) { -- 2.6.6