Blame SOURCES/0023-Ensure-command-line-updates-also-honor-set-index.patch

cca0c4
From f88808a37044c323e35eda49dbc326dcf260439b Mon Sep 17 00:00:00 2001
cca0c4
From: Peter Jones <pjones@redhat.com>
cca0c4
Date: Fri, 24 Jun 2016 16:05:45 -0400
cca0c4
Subject: [PATCH 23/55] Ensure command line updates also honor --set-index
cca0c4
cca0c4
Related: rhbz#1285601
cca0c4
cca0c4
Signed-off-by: Peter Jones <pjones@redhat.com>
cca0c4
---
cca0c4
 grubby.c | 8 +++++++-
cca0c4
 1 file changed, 7 insertions(+), 1 deletion(-)
cca0c4
cca0c4
diff --git a/grubby.c b/grubby.c
cca0c4
index 54625e7da0a..d889399449b 100644
cca0c4
--- a/grubby.c
cca0c4
+++ b/grubby.c
cca0c4
@@ -4212,11 +4212,17 @@ int addNewKernel(struct grubConfig *config, struct singleEntry *template,
cca0c4
 	struct singleEntry *new, *entry, *prev = NULL;
cca0c4
 	struct singleLine *newLine = NULL, *tmplLine = NULL, *masterLine = NULL;
cca0c4
 	int needs;
cca0c4
+	char *indexs;
cca0c4
 	char *chptr;
cca0c4
+	int rc;
cca0c4
 
cca0c4
 	if (!newKernelPath)
cca0c4
 		return 0;
cca0c4
 
cca0c4
+	rc = asprintf(&indexs, "%d", newIndex);
cca0c4
+	if (rc < 0)
cca0c4
+		return 1;
cca0c4
+
cca0c4
 	/* if the newKernelTitle is too long silently munge it into something
cca0c4
 	 * we can live with. truncating is first check, then we'll just mess with
cca0c4
 	 * it until it looks better */
cca0c4
@@ -4715,7 +4721,7 @@ int addNewKernel(struct grubConfig *config, struct singleEntry *template,
cca0c4
 		abort();
cca0c4
 	}
cca0c4
 
cca0c4
-	if (updateImage(config, "0", prefix, newKernelArgs, NULL,
cca0c4
+	if (updateImage(config, indexs, prefix, newKernelArgs, NULL,
cca0c4
 			newMBKernelArgs, NULL))
cca0c4
 		return 1;
cca0c4
 
cca0c4
-- 
cca0c4
2.17.1
cca0c4