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

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