On 03/20/2012 05:18 PM, Peter Jones wrote:
On 03/20/2012 02:55 PM, Cleber Rosa wrote:
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.
Signed-off-by: Cleber Rosa<crosa@xxxxxxxxxx>
This needs a test case as well.
Actually, test/grub.12 is a file that captures the configuration of such
a system. Without this patch, the "GRUB lba and root information on SuSE
systems" test fails (showing /boot twice), so I considered this patch
was already covered by a test.
If you think we need another, more explicit and separate test, please
let me know.
Thanks!
CR.
---
grubby.c | 11 +++++++++--
1 files changed, 9 insertions(+), 2 deletions(-)
diff --git a/grubby.c b/grubby.c
index 601ba8d..bf5fb37 100644
--- a/grubby.c
+++ b/grubby.c
@@ -1861,7 +1861,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=\"");
@@ -1920,7 +1923,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");
_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/anaconda-devel-list