Il 10/12/2016 16:01, Andrei Borzenkov ha scritto:
> No, that's OK. The error is EFI_INVALID_PARAMETER which is rather
> unexpected at this point.
> 
> Stab in the dark - could you try to change loading from
> 
>   status = efi_call_6 (b->load_image, 0, grub_efi_image_handle, file_path,
>                        boot_image, size,
>                        &image_handle);
> 
> 
> into
> 
> 
>   status = efi_call_6 (b->load_image, 0, grub_efi_image_handle, file_path,
>                        0, 0,
>                        &image_handle);
> 
> I understand that you are loading file from ESP, so it should be
> directly accessible by firmware.
> 
> And yes, please use PRIxGRUB_UINT64_T instead so code is printed in hex,
> it is more readable.
> 

So, changes were made, and the error become:
800000000000000e
I am adding the additional patch I've created for testing, just to be
sure I'm doing stuff properly.

-- 
Giovanni Santini
My blog: http://giovannisantini.tk
My code: https://git{hub,lab}.com/ItachiSan
My GPG: 2FADEBF5
>From a187b4c082d88ebe60c90916d6db5f92fe521c43 Mon Sep 17 00:00:00 2001
From: Giovanni Santini <[email protected]>
Date: Fri, 9 Dec 2016 14:38:43 +0100
Subject: [PATCH] Debugging GRUB Changes done: - Add error information to EFI
 chainloader command - Changing EFI file loading parameters

---
 grub-core/loader/efi/chainloader.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/grub-core/loader/efi/chainloader.c b/grub-core/loader/efi/chainloader.c
index 522a716..2a44462 100644
--- a/grub-core/loader/efi/chainloader.c
+++ b/grub-core/loader/efi/chainloader.c
@@ -327,14 +327,18 @@ grub_cmd_chainloader (grub_command_t cmd __attribute__ ((unused)),
 #endif
 
   status = efi_call_6 (b->load_image, 0, grub_efi_image_handle, file_path,
-		       boot_image, size,
+		       0, 0,
 		       &image_handle);
   if (status != GRUB_EFI_SUCCESS)
     {
       if (status == GRUB_EFI_OUT_OF_RESOURCES)
 	grub_error (GRUB_ERR_OUT_OF_MEMORY, "out of resources");
       else
-	grub_error (GRUB_ERR_BAD_OS, "cannot load image");
+	grub_error (
+		GRUB_ERR_BAD_OS,
+		"cannot load image: %08" PRIxGRUB_UINT64_T,
+		(grub_int64_t) status
+	);
 
       goto fail;
     }
-- 
2.10.2

_______________________________________________
Help-grub mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/help-grub

Reply via email to