summaryrefslogtreecommitdiff
path: root/config/grub/xhci/patches/0012-don-t-print-error-if-module-not-found.patch
blob: 37f52e037d86cdaf956bd5d6df1d9ebb85ea7dc5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
From edb8208100c523b5776f2cb0712fdc0c9065e517 Mon Sep 17 00:00:00 2001
From: Leah Rowe <leah@libreboot.org>
Date: Sun, 5 Nov 2023 16:36:22 +0000
Subject: [PATCH 12/22] don't print error if module not found

still set grub_errno accordingly, and otherwise
behave the same. in libreboot, we remove a lot of
modules but then rely on loading a grub.cfg
provided by a distro; in almost all cases that works,
but also in almost all cases, that will try to load
a module we don't actually need, but then it prints
a message. this can annoy some users, so silence it.

Signed-off-by: Leah Rowe <leah@libreboot.org>
---
 grub-core/kern/dl.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/grub-core/kern/dl.c b/grub-core/kern/dl.c
index af3bd00d0..21d0cedb1 100644
--- a/grub-core/kern/dl.c
+++ b/grub-core/kern/dl.c
@@ -486,7 +486,7 @@ grub_dl_resolve_name (grub_dl_t mod, Elf_Ehdr *e)
 
   s = grub_dl_find_section (e, ".modname");
   if (!s)
-    return grub_error (GRUB_ERR_BAD_MODULE, "no module name found");
+    return (grub_errno = GRUB_ERR_BAD_MODULE);
 
   mod->name = grub_strdup ((char *) e + s->sh_offset);
   if (! mod->name)
-- 
2.39.2