grub-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [RESEND PATCH 1/1] loader/efi/chainloader: Enhance error messages in


From: Vladimir 'phcoder' Serbinenko
Subject: Re: [RESEND PATCH 1/1] loader/efi/chainloader: Enhance error messages in chainloader command
Date: Fri, 4 Apr 2025 16:51:23 +0300



Le ven. 4 avr. 2025, 00:25, khaliid caliy <khaliidcaliy@gmail.com> a écrit :
Well i apologies the error message were somehow bad on my previous
patch, and needed some improvement.

diff --git a/grub-core/loader/efi/chainloader.c
b/grub-core/loader/efi/chainloader.c
index 869307bf3..4fd46dfda 100644
--- a/grub-core/loader/efi/chainloader.c
+++ b/grub-core/loader/efi/chainloader.c
@@ -346,6 +346,12 @@ grub_cmd_chainloader (grub_command_t cmd
__attribute__ ((unused)),
    {
      if (status == GRUB_EFI_OUT_OF_RESOURCES)
       grub_error (GRUB_ERR_OUT_OF_MEMORY, "out of resources");
+      else if (status == GRUB_EFI_INVALID_PARAMETER)
+       grub_error (GRUB_ERR_BAD_ARGUMENT, "the image supplied
paramters are invalid");
Typo 
+      else if (status == GRUB_EFI_NOT_FOUND)
+       grub_error (GRUB_ERR_FILE_NOT_FOUND, "the image not found");
+      else if (status == GRUB_EFI_UNSUPPORTED)
+       grub_error (GRUB_ERR_BAD_OS, "grub doesn't support this image");
This has nothing to do with what GRUB supports. It's about what firmware supports. 

How did you choose which error codes to translate? Did you actually see them? Are those distinctions useful without knowing EFI spec? Maybe it's better to just print EFI error in hex?
      else
       grub_error (GRUB_ERR_BAD_OS, "cannot load image");

_______________________________________________
Grub-devel mailing list
Grub-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/grub-devel

reply via email to

[Prev in Thread] Current Thread [Next in Thread]