All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] [PATCH] efi_loader: Revert device_handle to disk after net boot
@ 2016-10-18 13:49 Alexander Graf
  2016-10-18 18:05 ` [U-Boot] " Alexander Graf
  0 siblings, 1 reply; 2+ messages in thread
From: Alexander Graf @ 2016-10-18 13:49 UTC (permalink / raw)
  To: u-boot

When you boot an efi payload from network, then exit that payload
and load another payload from disk afterwords, the disk payload will
currently see the network device as its boot path.

This breaks grub2 for example which tries to find its modules based
on the path it was loaded from.

This patch fixes that issue by always reverting to disk paths if we're
not in the network boot. That way the data structures after a network
boot look the same as before.

Signed-off-by: Alexander Graf <agraf@suse.de>
---
 cmd/bootefi.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/cmd/bootefi.c b/cmd/bootefi.c
index 32148d7..a9910d7 100644
--- a/cmd/bootefi.c
+++ b/cmd/bootefi.c
@@ -207,6 +207,8 @@ static unsigned long do_bootefi_exec(void *efi, void *fdt)
 
 	if (!memcmp(bootefi_device_path[0].str, "N\0e\0t", 6))
 		loaded_image_info.device_handle = nethandle;
+	else
+		loaded_image_info.device_handle = bootefi_device_path;
 #endif
 #ifdef CONFIG_GENERATE_SMBIOS_TABLE
 	efi_smbios_register();
-- 
1.8.5.6

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* [U-Boot] efi_loader: Revert device_handle to disk after net boot
  2016-10-18 13:49 [U-Boot] [PATCH] efi_loader: Revert device_handle to disk after net boot Alexander Graf
@ 2016-10-18 18:05 ` Alexander Graf
  0 siblings, 0 replies; 2+ messages in thread
From: Alexander Graf @ 2016-10-18 18:05 UTC (permalink / raw)
  To: u-boot

> When you boot an efi payload from network, then exit that payload
> and load another payload from disk afterwords, the disk payload will
> currently see the network device as its boot path.
> 
> This breaks grub2 for example which tries to find its modules based
> on the path it was loaded from.
> 
> This patch fixes that issue by always reverting to disk paths if we're
> not in the network boot. That way the data structures after a network
> boot look the same as before.
> 
> Signed-off-by: Alexander Graf <agraf@suse.de>

Thanks, applied to efi-next

Alex

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2016-10-18 18:05 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-10-18 13:49 [U-Boot] [PATCH] efi_loader: Revert device_handle to disk after net boot Alexander Graf
2016-10-18 18:05 ` [U-Boot] " Alexander Graf

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.