SHA256
1
0
forked from pool/grub2

Accepting request 147490 from home:michael-chang:branches:Base:System

- add grub2-fix-unquoted-string-in-class.patch (bnc#788322)

OBS-URL: https://build.opensuse.org/request/show/147490
OBS-URL: https://build.opensuse.org/package/show/Base:System/grub2?expand=0&rev=5
This commit is contained in:
Jiri Slaby 2013-01-08 11:50:14 +00:00 committed by Git OBS Bridge
parent 45914f9cd9
commit d0f06793ea
3 changed files with 84 additions and 0 deletions

View File

@ -0,0 +1,77 @@
From 7c8906e0f3827322469655bb013247f7ce60fcd9 Mon Sep 17 00:00:00 2001
From: Michael Chang <mchang@suse.com>
Date: Tue, 4 Dec 2012 15:24:43 +0800
Subject: [PATCH] Fix unquoted string in --class
References: bnc#788322
Patch-Mainline: no
If GRUB_DISTRIBUTOR contains special character such as '$', it would
lead to syntax error by the grub2-script-check even though user
correctly quote them in single quotes.
The cause is that grub2 scripts use not quote the strings from
GRUB_DISTRIBUTOR in --class options thus keywords interpreted by the
script parser. The fix is to add single quote to the string.
---
util/grub.d/10_hurd.in | 2 +-
util/grub.d/10_kfreebsd.in | 2 +-
util/grub.d/10_linux.in | 2 +-
util/grub.d/20_linux_xen.in | 2 +-
4 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/util/grub.d/10_hurd.in b/util/grub.d/10_hurd.in
index 45f0ad3..5afc079 100644
--- a/util/grub.d/10_hurd.in
+++ b/util/grub.d/10_hurd.in
@@ -32,7 +32,7 @@ if [ "x${GRUB_DISTRIBUTOR}" = "x" ] ; then
OS=GNU
else
OS="${GRUB_DISTRIBUTOR} GNU/Hurd"
- CLASS="--class $(echo ${GRUB_DISTRIBUTOR} | tr 'A-Z' 'a-z' | cut -d' ' -f1) ${CLASS}"
+ CLASS="--class '$(echo ${GRUB_DISTRIBUTOR} | tr 'A-Z' 'a-z' | cut -d' ' -f1)' ${CLASS}"
fi
at_least_one=false
diff --git a/util/grub.d/10_kfreebsd.in b/util/grub.d/10_kfreebsd.in
index b0e84e2..4ec8d96 100644
--- a/util/grub.d/10_kfreebsd.in
+++ b/util/grub.d/10_kfreebsd.in
@@ -30,7 +30,7 @@ CLASS="--class os"
case "${GRUB_DISTRIBUTOR}" in
Debian)
OS="${GRUB_DISTRIBUTOR} GNU/kFreeBSD"
- CLASS="--class $(echo ${GRUB_DISTRIBUTOR} | tr 'A-Z' 'a-z' | cut -d' ' -f1) --class gnu-kfreebsd --class gnu ${CLASS}"
+ CLASS="--class '$(echo ${GRUB_DISTRIBUTOR} | tr 'A-Z' 'a-z' | cut -d' ' -f1)' --class gnu-kfreebsd --class gnu ${CLASS}"
;;
*)
OS="FreeBSD"
diff --git a/util/grub.d/10_linux.in b/util/grub.d/10_linux.in
index b2f65c0..40f8651 100644
--- a/util/grub.d/10_linux.in
+++ b/util/grub.d/10_linux.in
@@ -32,7 +32,7 @@ if [ "x${GRUB_DISTRIBUTOR}" = "x" ] ; then
OS=GNU/Linux
else
OS="${GRUB_DISTRIBUTOR}"
- CLASS="--class $(echo ${GRUB_DISTRIBUTOR} | tr 'A-Z' 'a-z' | cut -d' ' -f1) ${CLASS}"
+ CLASS="--class '$(echo ${GRUB_DISTRIBUTOR} | tr 'A-Z' 'a-z' | cut -d' ' -f1)' ${CLASS}"
fi
# loop-AES arranges things so that /dev/loop/X can be our root device, but
diff --git a/util/grub.d/20_linux_xen.in b/util/grub.d/20_linux_xen.in
index 29184c2..f1ce61e 100644
--- a/util/grub.d/20_linux_xen.in
+++ b/util/grub.d/20_linux_xen.in
@@ -32,7 +32,7 @@ if [ "x${GRUB_DISTRIBUTOR}" = "x" ] ; then
OS=GNU/Linux
else
OS="${GRUB_DISTRIBUTOR} GNU/Linux"
- CLASS="--class $(echo ${GRUB_DISTRIBUTOR} | tr 'A-Z' 'a-z' | cut -d' ' -f1) ${CLASS}"
+ CLASS="--class '$(echo ${GRUB_DISTRIBUTOR} | tr 'A-Z' 'a-z' | cut -d' ' -f1)' ${CLASS}"
fi
# loop-AES arranges things so that /dev/loop/X can be our root device, but
--
1.7.3.4

View File

@ -1,3 +1,8 @@
-------------------------------------------------------------------
Tue Jan 8 08:09:01 UTC 2013 - mchang@suse.com
- add grub2-fix-unquoted-string-in-class.patch (bnc#788322)
------------------------------------------------------------------- -------------------------------------------------------------------
Tue Jan 8 07:09:47 UTC 2013 - arvidjaar@gmail.com Tue Jan 8 07:09:47 UTC 2013 - arvidjaar@gmail.com

View File

@ -134,6 +134,7 @@ Patch24: grub2-secureboot-provide-linuxefi-config.patch
Patch25: 30_os-prober_UEFI_support.patch Patch25: 30_os-prober_UEFI_support.patch
Patch26: grub2-fix-enumeration-of-extended-partition.patch Patch26: grub2-fix-enumeration-of-extended-partition.patch
Patch27: grub2-add-device-to-os_prober-linux-menuentry.patch Patch27: grub2-add-device-to-os_prober-linux-menuentry.patch
Patch28: grub2-fix-unquoted-string-in-class.patch
PreReq: perl-Bootloader PreReq: perl-Bootloader
Requires: gettext-runtime Requires: gettext-runtime
%if 0%{?suse_version} >= 1140 %if 0%{?suse_version} >= 1140
@ -248,6 +249,7 @@ mv docs/grub.texi docs/grub2.texi
%patch25 -p1 %patch25 -p1
%patch26 -p1 %patch26 -p1
%patch27 -p1 %patch27 -p1
%patch28 -p1
cd .. cd ..
# README.openSUSE # README.openSUSE