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