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

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