0012-don-t-print-error-if-module-not-found.patch 1.1 KB

1234567891011121314151617181920212223242526272829303132333435
  1. From d58c6298f62e70084a14aabc6c46b31d61f28152 Mon Sep 17 00:00:00 2001
  2. From: Leah Rowe <leah@libreboot.org>
  3. Date: Sun, 5 Nov 2023 16:36:22 +0000
  4. Subject: [PATCH 12/14] don't print error if module not found
  5. still set grub_errno accordingly, and otherwise
  6. behave the same. in libreboot, we remove a lot of
  7. modules but then rely on loading a grub.cfg
  8. provided by a distro; in almost all cases that works,
  9. but also in almost all cases, that will try to load
  10. a module we don't actually need, but then it prints
  11. a message. this can annoy some users, so silence it.
  12. Signed-off-by: Leah Rowe <leah@libreboot.org>
  13. ---
  14. grub-core/kern/dl.c | 2 +-
  15. 1 file changed, 1 insertion(+), 1 deletion(-)
  16. diff --git a/grub-core/kern/dl.c b/grub-core/kern/dl.c
  17. index af3bd00d0..21d0cedb1 100644
  18. --- a/grub-core/kern/dl.c
  19. +++ b/grub-core/kern/dl.c
  20. @@ -486,7 +486,7 @@ grub_dl_resolve_name (grub_dl_t mod, Elf_Ehdr *e)
  21. s = grub_dl_find_section (e, ".modname");
  22. if (!s)
  23. - return grub_error (GRUB_ERR_BAD_MODULE, "no module name found");
  24. + return (grub_errno = GRUB_ERR_BAD_MODULE);
  25. mod->name = grub_strdup ((char *) e + s->sh_offset);
  26. if (! mod->name)
  27. --
  28. 2.39.2