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

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