[PATCH 01/11] Support systems that do not have /boot as a separate filesystem

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



While testing grubby on systems with a root (/) filesystem that includes
the /boot directory, it was noticed that grubby displayed the prefix (/boot)
twice.  This patch prevents printing the prefix twice on kernel and initrd
lines.

This situation was found while testing the patch "Fix for grub on SuSE
systems: lba and boot information", so this fix is also covered by the
the test on patch "Fix for grub on SuSE systems: test lba and boot info".

Signed-off-by: Cleber Rosa <crosa@xxxxxxxxxx>
---
 grubby.c |   11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/grubby.c b/grubby.c
index fe8317d..754c684 100644
--- a/grubby.c
+++ b/grubby.c
@@ -1966,7 +1966,10 @@ void displayEntry(struct singleEntry * entry, const char * prefix, int index) {
         return;
     }
 
-    printf("kernel=%s%s\n", prefix, line->elements[1].item);
+    if (!strncmp(prefix, line->elements[1].item, strlen(prefix)))
+	printf("kernel=%s\n", line->elements[1].item);
+    else
+	printf("kernel=%s%s\n", prefix, line->elements[1].item);
 
     if (line->numElements >= 3) {
 	printf("args=\"");
@@ -2025,7 +2028,11 @@ void displayEntry(struct singleEntry * entry, const char * prefix, int index) {
     line = getLineByType(LT_INITRD, entry->lines);
 
     if (line && line->numElements >= 2) {
-	printf("initrd=%s", prefix);
+	if (!strncmp(prefix, line->elements[1].item, strlen(prefix)))
+	    printf("initrd=");
+	else
+	    printf("initrd=%s", prefix);
+
 	for (i = 1; i < line->numElements; i++)
 	    printf("%s%s", line->elements[i].item, line->elements[i].indent);
 	printf("\n");
-- 
1.7.10.2

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/anaconda-devel-list


[Index of Archives]     [Kickstart]     [Fedora Users]     [Fedora Legacy List]     [Fedora Maintainers]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]
  Powered by Linux