Blame SOURCES/0042-Fix-info-for-s390x-s390-1285601.patch

cca0c4
From 8d81aeffcb1c2f9706dfe625a2f9f5e61f8a5c63 Mon Sep 17 00:00:00 2001
cca0c4
From: Robert Marshall <rmarshall@redhat.com>
cca0c4
Date: Tue, 14 Mar 2017 15:20:53 -0400
cca0c4
Subject: [PATCH 42/55] Fix --info for s390x/s390 (#1285601)
cca0c4
cca0c4
The --info flag for grubby on s390/s390x always returned (null). Fixed
cca0c4
codepath to use extractTitle where necessary and get the actual title.
cca0c4
cca0c4
Related: rhbz#1285601
cca0c4
---
cca0c4
 grubby.c | 15 +++++++++++----
cca0c4
 1 file changed, 11 insertions(+), 4 deletions(-)
cca0c4
cca0c4
diff --git a/grubby.c b/grubby.c
cca0c4
index 974b81c7864..9bf051dfed4 100644
cca0c4
--- a/grubby.c
cca0c4
+++ b/grubby.c
cca0c4
@@ -2684,7 +2684,7 @@ void setFallbackImage(struct grubConfig *config, int hasNew)
cca0c4
 	}
cca0c4
 }
cca0c4
 
cca0c4
-void displayEntry(struct singleEntry *entry, const char *prefix, int index)
cca0c4
+void displayEntry(struct grubConfig *config, struct singleEntry *entry, const char *prefix, int index)
cca0c4
 {
cca0c4
 	struct singleLine *line;
cca0c4
 	char *root = NULL;
cca0c4
@@ -2780,7 +2780,14 @@ void displayEntry(struct singleEntry *entry, const char *prefix, int index)
cca0c4
 
cca0c4
 	line = getLineByType(LT_TITLE, entry->lines);
cca0c4
 	if (line) {
cca0c4
-		printf("title=%s\n", line->elements[1].item);
cca0c4
+                char *entryTitle;
cca0c4
+                /* if we can extractTitle, then it's a zipl config and
cca0c4
+                 * if not then we go ahead with what's existed prior */
cca0c4
+                entryTitle = extractTitle(config, line);
cca0c4
+                if (!entryTitle) {
cca0c4
+                    entryTitle=line->elements[1].item;
cca0c4
+                }
cca0c4
+		printf("title=%s\n", entryTitle);
cca0c4
 	} else {
cca0c4
 		char *title;
cca0c4
 		line = getLineByType(LT_MENUENTRY, entry->lines);
cca0c4
@@ -3196,11 +3203,11 @@ int displayInfo(struct grubConfig *config, char *kernel, const char *prefix)
cca0c4
 			printf("lba\n");
cca0c4
 	}
cca0c4
 
cca0c4
-	displayEntry(entry, prefix, i);
cca0c4
+	displayEntry(config, entry, prefix, i);
cca0c4
 
cca0c4
 	i++;
cca0c4
 	while ((entry = findEntryByPath(config, kernel, prefix, &i))) {
cca0c4
-		displayEntry(entry, prefix, i);
cca0c4
+		displayEntry(config, entry, prefix, i);
cca0c4
 		i++;
cca0c4
 	}
cca0c4
 
cca0c4
-- 
cca0c4
2.17.1
cca0c4