grub2/0154-Skip-leading-spaces-on-BLS-field-values.patch
Javier Martinez Canillas 1f092caba7
Drop two efinet patches that were causing issues and a bunch of other fixes
Add comments and revert logic changes in 01_fallback_counting
Remove quotes when reading ID value from /etc/os-release
  Related: rhbz#1650706
blscfg: expand grub_users before passing to grub_normal_add_menu_entry()
  Resolves: rhbz#1650706
Drop buggy downstream patch "efinet: retransmit if our device is busy"
  Resolves: rhbz#1649048
Make the menu entry users option argument to be optional
  Related: rhbz#1652434
10_linux_bls: add missing menu entries options
  Resolves: rhbz#1652434
Drop "Be more aggro about actually using the *configured* network device."
  Resolves: rhbz#1654388
Fix menu entry selection based on title
  Resolves: rhbz#1654936

Signed-off-by: Javier Martinez Canillas <javierm@redhat.com>
2018-12-01 03:28:36 +01:00

56 lines
1.8 KiB
Diff

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Javier Martinez Canillas <javierm@redhat.com>
Date: Thu, 7 Jun 2018 00:44:51 +0200
Subject: [PATCH] Skip leading spaces on BLS field values
The GRUB 2 blscfg command doesn't parse correctly the BLS fields if these
have extra spaces before the field values. For example, the following BLS
fragment generates a wrong menu entry due using spaces to tabulate values:
title Fedora 28 (Twenty Eight)
version 4.16.13-300.fc28.x86_64
machine-id e5c131dfee3249cbb9891c2641d8e350
linux /vmlinuz-4.16.13-300.fc28.x86_64
initrd /initramfs-4.16.13-300.fc28.x86_64.img
options root=/dev/mapper/fedora-root ro
Wrong generated menu entry:
load_video
set gfx_payload=keep
insmod gzio
linux ($root) /vmlinuz-4.16.13-300.fc28.x86_64 root=/dev/mapper/fedora-root ro
initrd ($root) /initramfs-4.16.13-300.fc28.x86_64.img
Correct menu entry after the fix:
load_video
set gfx_payload=keep
insmod gzio
linux ($root)/vmlinuz-4.16.13-300.fc28.x86_64 root=/dev/mapper/fedora-root ro
initrd ($root)/initramfs-4.16.13-300.fc28.x86_64.img
Resolves: rhbz#1588184
Signed-off-by: Javier Martinez Canillas <javierm@redhat.com>
---
grub-core/commands/blscfg.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/grub-core/commands/blscfg.c b/grub-core/commands/blscfg.c
index fb08d8e4c12..831cdcaccdf 100644
--- a/grub-core/commands/blscfg.c
+++ b/grub-core/commands/blscfg.c
@@ -448,7 +448,11 @@ static int read_entry (
separator[0] = '\0';
- rc = bls_add_keyval (entry, buf, separator+1);
+ do {
+ separator++;
+ } while (*separator == ' ' || *separator == '\t');
+
+ rc = bls_add_keyval (entry, buf, separator);
grub_free (buf);
if (rc < 0)
break;