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

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