loader/efi/chainloader: Enhance error message of chainloader command
v3 cover loader/efi/chainloader: Enhance error message of chainloader command
From: khaalid <[email protected]>
Well, i think the hex option is simpler in terms of code. Or maybe we need to have centralized function for all UEFI error messages, however this will complicate things a little bit as it requires modifications.
Just thought maybe we can extract high bit and treat like integer, thus align close as the way spec documented.
--- grub-core/loader/efi/chainloader.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-)
grub-core/loader/efi/chainloader.c +2 -6
@@ -91,7 +91,7 @@ grub_chainloader_boot (void *context) } }else -grub_error (GRUB_ERR_BAD_OS ,"unknown error" ); +grub_error (GRUB_ERR_BAD_OS ,"cannot start image 0x%lx" , status); }if (exit_data)
@@ -344,11 +344,7 @@ grub_cmd_chainloader (grub_command_t cmd __attribute__ ((unused)), &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 0x%lx" ,status); goto fail; }
Signature · 7 lines
2.49.0 _______________________________________________ Grub-devel mailing list [email protected] https://lists.gnu.org/mailman/listinfo/grub-devel
Quoted 10 lines · khaalid cali
From: khaalid <[email protected]>
Well, i think the hex option is simpler in terms of code. Or maybe we need to have centralized function for all UEFI error messages, however this will complicate things a little bit as it requires modifications.
Just thought maybe we can extract high bit and treat like integer, thus align close as the way spec documented.
Signed-off-by Khalid Ali<[email protected]>
Missing space before "<".
Quoted 9 lines
--- grub-core/loader/efi/chainloader.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-)grub-core/loader/efi/chainloader.c +0
-0
grub-core/loader/efi/chainloader.c grub_chainloader_boot (void *context) · line 94
Quoted 5 lines
grub-core/loader/efi/chainloader.c +1
-1@@ -91,7 +91,7 @@ grub_chainloader_boot (void *context) } }else -grub_error (GRUB_ERR_BAD_OS ,"unknown error" ); +grub_error (GRUB_ERR_BAD_OS ,"cannot start image 0x%lx" , status);
This is not portable. Please use relevant PRI* macros from include/grub/efi/api.h.
grub-core/loader/efi/chainloader.c grub_cmd_chainloader (grub_command_t cmd __attribute__ ((unused)), · line 347
Quoted 13 lines
grub-core/loader/efi/chainloader.c +1
-5}if (exit_data)@@ -344,11 +344,7 @@ grub_cmd_chainloader (grub_command_t cmd __attribute__ ((unused)), &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 0x%lx" ,status);
Ditto. Same for other patches...
Daniel
_______________________________________________
Grub-devel mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/grub-devel