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

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