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