nalika / rpms / grub2

Forked from rpms/grub2 2 years ago
Clone

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

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