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

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