Blame SOURCES/0001-Grub-support-in-kernel-command-line-option-names-647.patch

b3507f
From 800b8bb56b983e00f2c95183d0ff226172545d35 Mon Sep 17 00:00:00 2001
b3507f
From: Pino Toscano <ptoscano@redhat.com>
b3507f
Date: Wed, 23 Oct 2019 11:35:57 +0200
b3507f
Subject: [PATCH] Grub: support '+' in kernel command line option names (#647)
b3507f
b3507f
This way it is possible to parse files that pass options with '+' in the
b3507f
name to the kernel.
b3507f
b3507f
(cherry picked from commit 2ba77589baee1bf2d43d3a49f8e6f3eb522e5bba)
b3507f
---
b3507f
 lenses/grub.aug            |  2 +-
b3507f
 lenses/tests/test_grub.aug | 17 +++++++++++++++++
b3507f
 2 files changed, 18 insertions(+), 1 deletion(-)
b3507f
b3507f
diff --git a/lenses/grub.aug b/lenses/grub.aug
b3507f
index 24ad39bc..82c1c37a 100644
b3507f
--- a/lenses/grub.aug
b3507f
+++ b/lenses/grub.aug
b3507f
@@ -196,7 +196,7 @@ module Grub =
b3507f
     (* View: kernel_args
b3507f
         Parse the file name and args on a kernel or module line. *)
b3507f
     let kernel_args =
b3507f
-      let arg = /[A-Za-z0-9_.$-]+/ - /type|no-mem-option/  in
b3507f
+      let arg = /[A-Za-z0-9_.$\+-]+/ - /type|no-mem-option/  in
b3507f
       store /(\([a-z0-9,]+\))?\/[^ \t\n]*/ .
b3507f
             (spc . multiboot_arg)? .
b3507f
             (spc . [ key arg . (eq. store /([^ \t\n])*/)?])* . eol
b3507f
diff --git a/lenses/tests/test_grub.aug b/lenses/tests/test_grub.aug
b3507f
index 75657203..e50bdc4f 100644
b3507f
--- a/lenses/tests/test_grub.aug
b3507f
+++ b/lenses/tests/test_grub.aug
b3507f
@@ -258,6 +258,23 @@ password --encrypted ^9^32kwzzX./3WISQ0C /boot/grub/custom.lst
b3507f
       { "md5" }
b3507f
     } }
b3507f
 
b3507f
+    (* Test kernel options with different special characters. *)
b3507f
+    test Grub.lns get "title Fedora (2.6.24.4-64.fc8)
b3507f
+        root (hd0,0)
b3507f
+        kernel /vmlinuz-2.6.24.4-64.fc8 ro root=/dev/vg00/lv00 with.dot=1 with-dash=1 with_underscore=1 with+plus=1
b3507f
+        initrd /initrd-2.6.24.4-64.fc8.img\n" =
b3507f
+  { "title" = "Fedora (2.6.24.4-64.fc8)"
b3507f
+    { "root" = "(hd0,0)" }
b3507f
+    { "kernel" = "/vmlinuz-2.6.24.4-64.fc8"
b3507f
+      { "ro" }
b3507f
+      { "root" = "/dev/vg00/lv00" }
b3507f
+      { "with.dot" = "1" }
b3507f
+      { "with-dash" = "1" }
b3507f
+      { "with_underscore" = "1" }
b3507f
+      { "with+plus" = "1" }
b3507f
+    }
b3507f
+    { "initrd" = "/initrd-2.6.24.4-64.fc8.img" } }
b3507f
+
b3507f
   (* Test parsing of invalid entries via menu_error *)
b3507f
   test Grub.lns get "default=0\ncrud=no\n" =
b3507f
   { "default" = "0" }
b3507f
-- 
3c78df
2.29.2
b3507f