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

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