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?