Blame SOURCES/0063-Track-configuration-modifications.patch

903092
From db71a9ef9363f9ce01ee1746c827f8a2feac73e7 Mon Sep 17 00:00:00 2001
903092
From: Robert Marshall <rmarshall@redhat.com>
903092
Date: Thu, 8 Dec 2016 16:52:45 -0500
903092
Subject: [PATCH 63/69] Track configuration modifications
903092
903092
The setDefaultImage function had a subtle dependency on being run before
903092
addNewKernel is invoked. Added the ability to track invocation to
903092
prevent them from being so tightly coupled.
903092
903092
Related: rhbz#1285601
903092
---
903092
 grubby.c | 7 ++++++-
903092
 1 file changed, 6 insertions(+), 1 deletion(-)
903092
903092
diff --git a/grubby.c b/grubby.c
903092
index bece23a..3929212 100644
903092
--- a/grubby.c
903092
+++ b/grubby.c
903092
@@ -671,6 +671,8 @@ struct grubConfig {
903092
 	int fallbackImage;	/* just like defaultImage */
903092
 	int flags;
903092
 	struct configFileInfo *cfi;
903092
+	int isModified;		/* assumes only one entry added
903092
+				   per invocation of grubby */
903092
 };
903092
 
903092
 blkid_cache blkid;
903092
@@ -1399,6 +1401,7 @@ static struct grubConfig *readConfig(const char *inName,
903092
 	cfg->theLines = NULL;
903092
 	cfg->entries = NULL;
903092
 	cfg->fallbackImage = 0;
903092
+	cfg->isModified = 0;
903092
 
903092
 	/* copy everything we have */
903092
 	while (*head) {
903092
@@ -4764,8 +4767,10 @@ int addNewKernel(struct grubConfig *config, struct singleEntry *template,
903092
 	}
903092
 
903092
 	if (updateImage(config, indexs, prefix, newKernelArgs, NULL,
903092
-			newMBKernelArgs, NULL))
903092
+			newMBKernelArgs, NULL)) {
903092
+		config->isModified = 1;
903092
 		return 1;
903092
+	}
903092
 
903092
 	return 0;
903092
 }
903092
-- 
903092
2.9.3
903092