|
|
b33a64 |
From 800b8bb56b983e00f2c95183d0ff226172545d35 Mon Sep 17 00:00:00 2001
|
|
|
b33a64 |
From: Pino Toscano <ptoscano@redhat.com>
|
|
|
b33a64 |
Date: Wed, 23 Oct 2019 11:35:57 +0200
|
|
|
b33a64 |
Subject: [PATCH] Grub: support '+' in kernel command line option names (#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 |
--
|
|
|
2ac116 |
2.29.2
|
|
|
b33a64 |
|