dcavalca / rpms / grub2

Forked from rpms/grub2 3 years ago
Clone

Blame SOURCES/0203-blscfg-fix-filename-in-no-linux-key-error.patch

d9d99f
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
d9d99f
From: Will Thompson <wjt@endlessm.com>
d9d99f
Date: Thu, 12 Jul 2018 10:38:27 +0100
d9d99f
Subject: [PATCH] blscfg: fix filename in "no 'linux' key" error
d9d99f
d9d99f
In find_entry(), 'filename' is either NULL or a directory in the ESP.
d9d99f
But previously it was passed to create_entry(), which uses it in an
d9d99f
error message as if it's the filename of the BLS entry in question.
d9d99f
d9d99f
Since bls_entry now has a 'filename' field, just use that.
d9d99f
d9d99f
Signed-off-by: Will Thompson <wjt@endlessm.com>
d9d99f
---
d9d99f
 grub-core/commands/blscfg.c | 6 +++---
d9d99f
 1 file changed, 3 insertions(+), 3 deletions(-)
d9d99f
d9d99f
diff --git a/grub-core/commands/blscfg.c b/grub-core/commands/blscfg.c
d9d99f
index bd78559ef68..a45f40fe67e 100644
d9d99f
--- a/grub-core/commands/blscfg.c
d9d99f
+++ b/grub-core/commands/blscfg.c
d9d99f
@@ -514,7 +514,7 @@ static char **bls_make_list (struct bls_entry *entry, const char *key, int *num)
d9d99f
   return list;
d9d99f
 }
d9d99f
 
d9d99f
-static void create_entry (struct bls_entry *entry, const char *cfgfile)
d9d99f
+static void create_entry (struct bls_entry *entry)
d9d99f
 {
d9d99f
   int argc = 0;
d9d99f
   const char **argv = NULL;
d9d99f
@@ -539,7 +539,7 @@ static void create_entry (struct bls_entry *entry, const char *cfgfile)
d9d99f
   clinux = bls_get_val (entry, "linux", NULL);
d9d99f
   if (!clinux)
d9d99f
     {
d9d99f
-      grub_dprintf ("blscfg", "Skipping file %s with no 'linux' key.\n", cfgfile);
d9d99f
+      grub_dprintf ("blscfg", "Skipping file %s with no 'linux' key.\n", entry->filename);
d9d99f
       goto finish;
d9d99f
     }
d9d99f
 
d9d99f
@@ -753,7 +753,7 @@ static int find_entry (const char *filename,
d9d99f
 
d9d99f
   grub_dprintf ("blscfg", "%s Creating %d entries from bls\n", __func__, nentries);
d9d99f
   for (r = nentries - 1; r >= 0; r--)
d9d99f
-      create_entry(entries[r], filename);
d9d99f
+      create_entry(entries[r]);
d9d99f
 
d9d99f
   for (r = 0; r < nentries; r++)
d9d99f
       bls_free_entry (entries[r]);