]> git.proxmox.com Git - grub2.git/blame - debian/patches/os-prober-Allow-initrd-to-contain-spaces.patch
Allow initrd to contain spaces. Closes: #838177, #820838
[grub2.git] / debian / patches / os-prober-Allow-initrd-to-contain-spaces.patch
CommitLineData
358e8faa
SM
1From 1f982e2a7c35e14d5a92c76db998afafd1bd9e87 Mon Sep 17 00:00:00 2001
2From: General Chaos <debianbugs@toeai.com>
3Date: Tue, 12 Apr 2016 22:28:52 +0000
4Subject: [PATCH] os-prober: Allow initrd to contain spaces
5
6linux-boot-prober produces structured output with newline-terminated rows
7representing kernels, each with colon-delimited columns. We translate
8this into a sequence of space-separated words representing kernels,
9each containing colon-delimited fields where spaces are represented by
10carets.
11
12When we parse each of those words into colon-delimited fields, if the
13field could conceivably contain spaces then we need to translate
14carets back into spaces. We did this for label and parameters, but not
15for the initrd.
16
17In particular, when CPU microcode is installed on Arch Linux or its
18derivatives, they write CPU microcode into one initrd archive and the
19rest of early user-space into another, instead of concatenating the
20archives into a single file like Debian derivatives do. To boot Arch
21successfully from the grub menu, we need to add all of their initrds
22to the grub menu entry (detecting this situation requires an os-prober
23patch, for which see <https://bugs.debian.org/820838>).
24
25[Commit message added by Simon McVittie <smcv@collabora.com>]
26
27Bug: https://savannah.gnu.org/bugs/index.php?47681
28Bug-Debian: https://bugs.debian.org/838177
29Forwarded: https://savannah.gnu.org/bugs/index.php?47681
30Closes: #838177
31---
32 util/grub.d/30_os-prober.in | 2 +-
33 1 file changed, 1 insertion(+), 1 deletion(-)
34
35diff --git a/util/grub.d/30_os-prober.in b/util/grub.d/30_os-prober.in
36index da5f28876..d0609d9a4 100644
37--- a/util/grub.d/30_os-prober.in
38+++ b/util/grub.d/30_os-prober.in
39@@ -243,7 +243,7 @@ EOF
40 LBOOT="`echo ${LINUX} | cut -d ':' -f 2`"
41 LLABEL="`echo ${LINUX} | cut -d ':' -f 3 | tr '^' ' '`"
42 LKERNEL="`echo ${LINUX} | cut -d ':' -f 4`"
43- LINITRD="`echo ${LINUX} | cut -d ':' -f 5`"
44+ LINITRD="`echo ${LINUX} | cut -d ':' -f 5 | tr '^' ' '`"
45 LPARAMS="`echo ${LINUX} | cut -d ':' -f 6- | tr '^' ' '`"
46
47 if [ -z "${LLABEL}" ] ; then
48--
492.32.0
50