Merge ~ubuntu-core-dev/grub/+git/ubuntu:feature/initrd-less-boot-with-fallback-cleanup into ~ubuntu-core-dev/grub/+git/ubuntu:ubuntu

Proposed by Steve Langasek
Status: Rejected
Rejected by: Mathieu Trudel-Lapierre
Proposed branch: ~ubuntu-core-dev/grub/+git/ubuntu:feature/initrd-less-boot-with-fallback-cleanup
Merge into: ~ubuntu-core-dev/grub/+git/ubuntu:ubuntu
Diff against target: 454 lines (+263/-27)
15 files modified
Makefile.am (+3/-0)
configure.ac (+10/-0)
debian/.git-dpm (+2/-2)
debian/changelog (+7/-0)
debian/control (+1/-0)
debian/grub-common.install.linux.in (+1/-0)
debian/patches/add-initrd-less-boot-fallback.patch (+158/-0)
debian/patches/series (+1/-0)
debian/rules (+1/-1)
docs/grub.info (+0/-5)
docs/grub.texi (+0/-5)
grub-initrd-fallback.service (+13/-0)
util/grub-mkconfig.in (+1/-2)
util/grub.d/00_header.in (+27/-0)
util/grub.d/10_linux.in (+38/-12)
Reviewer Review Type Date Requested Status
Mathieu Trudel-Lapierre Needs Fixing
Chris Glass (community) Approve
Review via email: mp+341272@code.launchpad.net

Description of the change

Support for automatically trying to boot Linux without an initramfs, and automatically falling back to a boot with initramfs, in cases that we can detect that the kernel may not need an initramfs in order to resolve the root disk name.

To post a comment you must log in.
Revision history for this message
Chris Glass (tribaal) wrote :

Looks good. +1

(This was pair programmed between vorlon and I during a sprint "coding day" last week)

review: Approve
Revision history for this message
Mathieu Trudel-Lapierre (cyphermox) wrote :

As mentioned on IRC, this is broken, looks like the original support_initrdless_ patch was mangled in the process -- merge shows 'GRUB_DISABLE_INITRD' dropped, but the patch itself seems unchanged in the tree.

review: Needs Fixing
Revision history for this message
Ɓukasz Zemczak (sil2100) wrote :
Revision history for this message
Mathieu Trudel-Lapierre (cyphermox) wrote :

Marking superseded.

Unmerged commits

c1aa0eb... by Steve Langasek

merge patched-feature/initrd-less-boot-with-fallback into feature/initrd-less-boot-with-fallback

4f00c0e... by Chris Glass

Added initrd-less boot capabilities.

In case the kernel fails to boot without an initrd, grub will fallback
to trying to boot the kernel with an initrd.

Signed-off-by: Steve Langasek <email address hidden>

Patch-Name: add-initrd-less-boot-fallback.patch

0765223... by Steve Langasek

use dh_systemd to enable the initrd fallback handling unit

440d191... by Steve Langasek

Install our new systemd unit in grub-common.

0784830... by phcoder

yylex: Explicilty cast fprintf to void.

It's needed to avoid warning on recent GCC.

Patch-Name: yylex-explicitly_cast_fprintf_to_void.patch

bc78a6b... by Mathieu Trudel-Lapierre

video: skip 'text' gfxpayload if not supported, to fallback to default

On UEFI, 'text' gfxpayload is not supported, but we still reach parse_modespec
with it, which will obviously fail. Fortunately, whatever gfxpayload is set,
we still still have the 'auto' default to fall back to. Allow getting to this
fallback by not trying to parse 'text' as a modespec.

This is because 'text' correctly doesn't parse as a modespec, and ought to have
been ignored before we got to that point, just like it is immediately picked if
we're running on a system where 'text' is a supported video mode.

Signed-off-by: Mathieu Trudel-Lapierre <email address hidden>

Patch-Name: skip_text_gfxpayload_where_not_supported.patch

f66f180... by Julian Andres Klode

Show only upstream version, hide rest in package_version variable

The complete package version can get a bit long, so only show the
upstream version in the menu and on the top of the console, and
hide the complete version in a package_version variable.

Bug-Ubuntu: https://bugs.launchpad.net/bugs/1723434
Last-Updated: 2018-02-08

Patch-Name: shorter_version_info.patch

29e9d76... by Steve Langasek

Don't use arbitrary file sizes as block sizes in bufio

When grub_bufio_open() is called with a buffer size greater than the size
of the file being buffered, it clamps the buffer size to the file size.
This seems sensible on the surface to avoid over-allocating memory, but
grub_bufio_read() also assumes that ~(block_size-1) gives a sensible
mask value... which is only true for power of 2 block sizes, not for
random file sizes.
If the file we're buffering is on tftp, we get particularly pathological
results because we wind up seeking backwards which requires re-requesting
the file from the tftp server - even though the whole file fit in a single
udp packet much smaller than the default buffer size.

Signed-off-by: Mathieu Trudel-Lapierre <email address hidden>

Author: Steve Langasek <email address hidden>
Forwarded: no
Last-Update: 2016-11-01
Bug-Ubuntu: https://bugs.launchpad.net/bugs/1743249
Patch-Name: bufio_sensible_block_sizes.patch

d80aabd... by David Box

tsc: Change default tsc calibration method to pmtimer on EFI systems

On efi systems, make pmtimer based tsc calibration the default over the
pit. This prevents Grub from hanging on Intel SoC systems that power gate
the pit.

Signed-off-by: David E. Box <email address hidden>
Reviewed-by: Daniel Kiper <email address hidden>

Origin: upstream, https://git.savannah.gnu.org/cgit/grub.git/commit/?id=446794de8da4329ea532cbee4ca877bcafd0e534
Bug-Debian: https://bugs.debian.org/883193
Last-Update: 2017-12-01

Patch-Name: tsc_efi_default_to_pmtimer.patch

6b8dd59... by Mathieu Trudel-Lapierre

Don't fail build on some warnings we know might show up building linuxefi

Specifically:
  -Wno-error=format=
  -Wno-error=cast-align
  -Wno-error=int-to-pointer-cast
  -Wno-error=pointer-to-int-cast
  -Wno-error=unused-parameter

There are a few cases where we legitimately cast to memory that is bigger
than we need when building on one arch, because on a different arch it will
be just right. For example, grub_status_t can be int32 or int64, depending
on the size of void*.

Signed-off-by: Mathieu Trudel-Lapierre <email address hidden>

Forwarded: no
Last-Updated: 2017-11-01
Patch-Name: dont-fail-efi-warnings.patch

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/Makefile.am b/Makefile.am
2index f0ab1ad..aaf2bbf 100644
3--- a/Makefile.am
4+++ b/Makefile.am
5@@ -472,4 +472,7 @@ ChangeLog: FORCE
6 touch $@; \
7 fi
8
9+systemdsystemunit_DATA = \
10+ grub-initrd-fallback.service
11+
12 EXTRA_DIST += ChangeLog ChangeLog-2015
13diff --git a/configure.ac b/configure.ac
14index cd1f498..e3a951c 100644
15--- a/configure.ac
16+++ b/configure.ac
17@@ -287,6 +287,16 @@ AC_SUBST(grubdirname)
18 AC_DEFINE_UNQUOTED(GRUB_DIR_NAME, "$grubdirname",
19 [Default grub directory name])
20
21+##### systemd unit files
22+AC_ARG_WITH([systemdsystemunitdir],
23+ AS_HELP_STRING([--with-systemdsystemunitdir=DIR], [Directory for systemd service files]),
24+ [],
25+ [with_systemdsystemunitdir=/usr/lib/systemd/system],
26+ [with_systemdsystemunitdir=no])
27+if test "x$with_systemdsystemunitdir" != xno; then
28+ AC_SUBST([systemdsystemunitdir], [$with_systemdsystemunitdir])
29+fi
30+
31 #
32 # Checks for build programs.
33 #
34diff --git a/debian/.git-dpm b/debian/.git-dpm
35index a6e25a6..c468c72 100644
36--- a/debian/.git-dpm
37+++ b/debian/.git-dpm
38@@ -1,6 +1,6 @@
39 # see git-dpm(1) from git-dpm package
40-4a2879d2ea9e6179ac0f45d7196b9d905fcab0f6
41-4a2879d2ea9e6179ac0f45d7196b9d905fcab0f6
42+4f00c0e8a2e97169a1b83cdc294cea26f135cf04
43+4f00c0e8a2e97169a1b83cdc294cea26f135cf04
44 0992ffbac6a1b4c97c350d12e5301e0067daa0d6
45 0992ffbac6a1b4c97c350d12e5301e0067daa0d6
46 grub2_2.02.orig.tar.xz
47diff --git a/debian/changelog b/debian/changelog
48index 2e7a56d..80e2c87 100644
49--- a/debian/changelog
50+++ b/debian/changelog
51@@ -1,3 +1,10 @@
52+grub2 (2.02-2ubuntu9) UNRELEASED; urgency=medium
53+
54+ * Add support for initrd-less boot, with fallback to "normal" boot in case
55+ initrd-less boot failed.
56+
57+ -- Christopher Glass (Canonical) <christopher.glass@canonical.com> Thu, 08 Mar 2018 16:18:48 +0100
58+
59 grub2 (2.02-2ubuntu8) bionic; urgency=medium
60
61 * Drop debian/patches/mkconfig_keep_native_term_active.patch, which can
62diff --git a/debian/control b/debian/control
63index 0cd1001..59323d0 100644
64--- a/debian/control
65+++ b/debian/control
66@@ -7,6 +7,7 @@ Uploaders: Felix Zielcke <fzielcke@z-51.de>, Jordi Mallach <jordi@debian.org>, C
67 Build-Depends: debhelper (>= 7.4.2~),
68 patchutils,
69 dh-autoreconf,
70+ dh-systemd,
71 automake,
72 python,
73 flex,
74diff --git a/debian/grub-common.install.linux.in b/debian/grub-common.install.linux.in
75index a1fc71c..9c28f46 100644
76--- a/debian/grub-common.install.linux.in
77+++ b/debian/grub-common.install.linux.in
78@@ -1,2 +1,3 @@
79 usr/bin/grub-mount
80 usr/share/man/man1/grub-mount.1
81+usr/lib/systemd/system/grub-initrd-fallback.service /lib/systemd/system
82diff --git a/debian/patches/add-initrd-less-boot-fallback.patch b/debian/patches/add-initrd-less-boot-fallback.patch
83new file mode 100644
84index 0000000..465a84e
85--- /dev/null
86+++ b/debian/patches/add-initrd-less-boot-fallback.patch
87@@ -0,0 +1,158 @@
88+From cd2faacd63595b746ece084aa17d054a843a4ff8 Mon Sep 17 00:00:00 2001
89+From: Chris Glass <chris.glass@canonical.com>
90+Date: Thu, 8 Mar 2018 16:16:55 +0100
91+Subject: Added initrd-less boot capabilities.
92+
93+In case the kernel fails to boot without an initrd, grub will fallback
94+to trying to boot the kernel with an initrd.
95+
96+Patch-Name: add-initrd-less-boot-fallback.patch
97+---
98+ grub-common.grub-initrd-fallback.service | 13 ++++++++
99+ util/grub.d/00_header.in | 27 ++++++++++++++++
100+ util/grub.d/10_linux.in | 53 +++++++++++++++++++++++---------
101+ 3 files changed, 79 insertions(+), 14 deletions(-)
102+ create mode 100644 grub-common.grub-initrd-fallback.service
103+
104+diff --git a/grub-common.grub-initrd-fallback.service b/grub-common.grub-initrd-fallback.service
105+new file mode 100644
106+index 000000000..258853800
107+--- /dev/null
108++++ b/grub-common.grub-initrd-fallback.service
109+@@ -0,0 +1,13 @@
110++[Unit]
111++Description=GRUB failed boot detection
112++DefaultDependencies=no
113++After=local-fs.target
114++
115++[Service]
116++Type=oneshot
117++ExecStart=/usr/bin/grub-editenv /boot/grub/grubenv unset initrdfail
118++ExecStart=/usr/bin/grub-editenv /boot/grub/grubenv unset prev_entry
119++TimeoutSec=0
120++
121++[Install]
122++WantedBy=sysinit.target
123+diff --git a/util/grub.d/00_header.in b/util/grub.d/00_header.in
124+index 674a76140..23322458a 100644
125+--- a/util/grub.d/00_header.in
126++++ b/util/grub.d/00_header.in
127+@@ -50,6 +50,18 @@ if [ -s \$prefix/grubenv ]; then
128+ load_env
129+ fi
130+ EOF
131++cat <<EOF
132++if [ "\${initrdfail}" = 2 ]; then
133++ set initrdfail=
134++elif [ "\${initrdfail}" = 1 ]; then
135++ set next_entry="\${prev_entry}"
136++ set prev_entry=
137++ save_env prev_entry
138++ if [ "\${next_entry}" ]; then
139++ set initrdfail=2
140++ fi
141++fi
142++EOF
143+ if [ "x$GRUB_BUTTON_CMOS_ADDRESS" != "x" ]; then
144+ cat <<EOF
145+ if cmostest $GRUB_BUTTON_CMOS_ADDRESS ; then
146+@@ -101,6 +113,21 @@ function savedefault {
147+ }
148+ EOF
149+
150++cat <<"EOF"
151++function initrdfail {
152++ if [ -n "${have_grubenv}" ]; then if [ -n "${partuuid}" ]; then
153++ if [ -z "${initrdfail}" ]; then
154++ set initrdfail=1
155++ if [ -n "${boot_once}" ]; then
156++ set prev_entry="${default}"
157++ save_env prev_entry
158++ fi
159++ fi
160++ save_env initrdfail
161++ fi; fi
162++}
163++EOF
164++
165+ if [ "$quick_boot" = 1 ]; then
166+ cat <<EOF
167+ function recordfail {
168+diff --git a/util/grub.d/10_linux.in b/util/grub.d/10_linux.in
169+index 76d4f31bf..8590704a3 100644
170+--- a/util/grub.d/10_linux.in
171++++ b/util/grub.d/10_linux.in
172+@@ -104,6 +104,10 @@ if [ "$vt_handoff" = 1 ]; then
173+ done
174+ fi
175+
176++if [ x"$GRUB_FORCE_PARTUUID" != x ]; then
177++ echo "set partuuid=${GRUB_FORCE_PARTUUID}"
178++fi
179++
180+ linux_entry ()
181+ {
182+ os="$1"
183+@@ -179,27 +183,48 @@ EOF
184+ linux ${rel_dirname}/${basename}.efi.signed root=${linux_root_device_thisversion} ro ${args}
185+ EOF
186+ else
187+- if [ x"$GRUB_FORCE_PARTUUID" = x ]; then
188++ # We have initrd and PARTUUID is set - we try to boot without initrd, and fallback to using it
189++ # if it fails.
190++ # "panic=-1" means "on panic reboot immediately". "panic=0" disables the reboot behavior.
191++ if [ x"$GRUB_FORCE_PARTUUID" != x ]; then
192++ linux_root_device_thisversion="PARTUUID=${GRUB_FORCE_PARTUUID}"
193++ fi
194++ if test -n "${initrd}" && [ x"$GRUB_FORCE_PARTUUID" != x ]; then
195+ sed "s/^/$submenu_indentation/" << EOF
196+- linux ${rel_dirname}/${basename} root=${linux_root_device_thisversion} ro ${args}
197++ if [ "\${initrdfail}" = 1 ]; then
198++ linux ${rel_dirname}/${basename} root=${linux_root_device_thisversion} ro ${args}
199++EOF
200++ if [ x"$quiet_boot" = x0 ] || [ x"$type" != xsimple ]; then
201++ message="$(gettext_printf "Loading initial ramdisk ...")"
202++ echo " ${message}"
203++ fi
204++
205++ sed "s/^/$submenu_indentation/" << EOF
206++ initrd ${rel_dirname}/${initrd}
207++ else
208++ linux ${rel_dirname}/${basename} root=${linux_root_device_thisversion} ro ${args} panic=-1
209++ fi
210++ initrdfail
211+ EOF
212+ else
213++ # We don't have initrd or we don't want to set PARTUUID. Don't try initrd-less boot with fallback.
214+ sed "s/^/$submenu_indentation/" << EOF
215+- linux ${rel_dirname}/${basename} root=PARTUUID=${GRUB_FORCE_PARTUUID} ro ${args}
216++ linux ${rel_dirname}/${basename} root=${linux_root_device_thisversion} ro ${args}
217+ EOF
218+- fi
219+- fi
220+- if test -n "${initrd}" && [ x"$GRUB_DISABLE_INITRD" != xtrue ]; then
221+- # TRANSLATORS: ramdisk isn't identifier. Should be translated.
222+- if [ x"$quiet_boot" = x0 ] || [ x"$type" != xsimple ]; then
223+- message="$(gettext_printf "Loading initial ramdisk ...")"
224+- sed "s/^/$submenu_indentation/" << EOF
225+- echo '$(echo "$message" | grub_quote)'
226++ if test -n "${initrd}"; then
227++ # We do have initrd - let's use it at boot.
228++ # TRANSLATORS: ramdisk isn't identifier. Should be translated.
229++ if [ x"$quiet_boot" = x0 ] || [ x"$type" != xsimple ]; then
230++ message="$(gettext_printf "Loading initial ramdisk ...")"
231++ sed "s/^/$submenu_indentation/" << EOF
232++ echo '$(echo "$message" | grub_quote)'
233+ EOF
234+- fi
235+- sed "s/^/$submenu_indentation/" << EOF
236+- initrd ${rel_dirname}/${initrd}
237++ fi
238++ sed "s/^/$submenu_indentation/" << EOF
239++ initrd ${rel_dirname}/${initrd}
240+ EOF
241++ fi
242++ fi
243+ fi
244+ sed "s/^/$submenu_indentation/" << EOF
245+ }
246diff --git a/debian/patches/series b/debian/patches/series
247index 47ad08d..29e74ae 100644
248--- a/debian/patches/series
249+++ b/debian/patches/series
250@@ -75,3 +75,4 @@ bufio_sensible_block_sizes.patch
251 shorter_version_info.patch
252 skip_text_gfxpayload_where_not_supported.patch
253 yylex-explicitly_cast_fprintf_to_void.patch
254+add-initrd-less-boot-fallback.patch
255diff --git a/debian/rules b/debian/rules
256index 8c73042..683425e 100755
257--- a/debian/rules
258+++ b/debian/rules
259@@ -114,7 +114,7 @@ endif
260 endif
261
262 %:
263- dh $@ --parallel
264+ dh $@ --parallel --with systemd
265
266 override_dh_auto_configure: $(patsubst %,configure/%,$(BUILD_PACKAGES))
267
268diff --git a/docs/grub.info b/docs/grub.info
269index b850016..5ec19fa 100644
270--- a/docs/grub.info
271+++ b/docs/grub.info
272@@ -1412,11 +1412,6 @@ it must be quoted. For example:
273 Setting this option to '12345678-01' will produce:
274 root=PARTUUID=12345678-01
275
276-'GRUB_DISABLE_INITRD'
277- Then set to 'true', this option prevents an initrd to be used at
278- boot time, regardless of whether one is detected or not.
279- grub-mkconfig will therefore not generate any initrd lines.
280-
281 The following options are still accepted for compatibility with
282 existing configurations, but have better replacements:
283
284diff --git a/docs/grub.texi b/docs/grub.texi
285index e5dbc63..3bb83ac 100644
286--- a/docs/grub.texi
287+++ b/docs/grub.texi
288@@ -1517,11 +1517,6 @@ will be, for example in virtual machine images.
289 Setting this option to @samp{12345678-01} will produce:
290 root=PARTUUID=12345678-01
291
292-@item GRUB_DISABLE_INITRD
293-Then set to @samp{true}, this option prevents an initrd to be used at boot
294-time, regardless of whether one is detected or not. @command{grub-mkconfig}
295-will therefore not generate any initrd lines.
296-
297 @end table
298
299 The following options are still accepted for compatibility with existing
300diff --git a/grub-initrd-fallback.service b/grub-initrd-fallback.service
301new file mode 100644
302index 0000000..2588538
303--- /dev/null
304+++ b/grub-initrd-fallback.service
305@@ -0,0 +1,13 @@
306+[Unit]
307+Description=GRUB failed boot detection
308+DefaultDependencies=no
309+After=local-fs.target
310+
311+[Service]
312+Type=oneshot
313+ExecStart=/usr/bin/grub-editenv /boot/grub/grubenv unset initrdfail
314+ExecStart=/usr/bin/grub-editenv /boot/grub/grubenv unset prev_entry
315+TimeoutSec=0
316+
317+[Install]
318+WantedBy=sysinit.target
319diff --git a/util/grub-mkconfig.in b/util/grub-mkconfig.in
320index 9fca8cd..c88c46f 100644
321--- a/util/grub-mkconfig.in
322+++ b/util/grub-mkconfig.in
323@@ -246,8 +246,7 @@ export GRUB_DEFAULT \
324 GRUB_DISABLE_SUBMENU \
325 GRUB_RECORDFAIL_TIMEOUT \
326 GRUB_RECOVERY_TITLE \
327- GRUB_FORCE_PARTUUID \
328- GRUB_DISABLE_INITRD
329+ GRUB_FORCE_PARTUUID
330
331 if test "x${grub_cfg}" != "x"; then
332 rm -f "${grub_cfg}.new"
333diff --git a/util/grub.d/00_header.in b/util/grub.d/00_header.in
334index 674a761..2332245 100644
335--- a/util/grub.d/00_header.in
336+++ b/util/grub.d/00_header.in
337@@ -50,6 +50,18 @@ if [ -s \$prefix/grubenv ]; then
338 load_env
339 fi
340 EOF
341+cat <<EOF
342+if [ "\${initrdfail}" = 2 ]; then
343+ set initrdfail=
344+elif [ "\${initrdfail}" = 1 ]; then
345+ set next_entry="\${prev_entry}"
346+ set prev_entry=
347+ save_env prev_entry
348+ if [ "\${next_entry}" ]; then
349+ set initrdfail=2
350+ fi
351+fi
352+EOF
353 if [ "x$GRUB_BUTTON_CMOS_ADDRESS" != "x" ]; then
354 cat <<EOF
355 if cmostest $GRUB_BUTTON_CMOS_ADDRESS ; then
356@@ -101,6 +113,21 @@ function savedefault {
357 }
358 EOF
359
360+cat <<"EOF"
361+function initrdfail {
362+ if [ -n "${have_grubenv}" ]; then if [ -n "${partuuid}" ]; then
363+ if [ -z "${initrdfail}" ]; then
364+ set initrdfail=1
365+ if [ -n "${boot_once}" ]; then
366+ set prev_entry="${default}"
367+ save_env prev_entry
368+ fi
369+ fi
370+ save_env initrdfail
371+ fi; fi
372+}
373+EOF
374+
375 if [ "$quick_boot" = 1 ]; then
376 cat <<EOF
377 function recordfail {
378diff --git a/util/grub.d/10_linux.in b/util/grub.d/10_linux.in
379index 76d4f31..01d96f5 100644
380--- a/util/grub.d/10_linux.in
381+++ b/util/grub.d/10_linux.in
382@@ -104,6 +104,10 @@ if [ "$vt_handoff" = 1 ]; then
383 done
384 fi
385
386+if [ x"$GRUB_FORCE_PARTUUID" != x ]; then
387+ echo "set partuuid=${GRUB_FORCE_PARTUUID}"
388+fi
389+
390 linux_entry ()
391 {
392 os="$1"
393@@ -179,27 +183,49 @@ EOF
394 linux ${rel_dirname}/${basename}.efi.signed root=${linux_root_device_thisversion} ro ${args}
395 EOF
396 else
397- if [ x"$GRUB_FORCE_PARTUUID" = x ]; then
398+ # We have initrd and PARTUUID is set - we try to boot without initrd, and fallback to using it
399+ # if it fails.
400+ # "panic=-1" means "on panic reboot immediately". "panic=0" disables the reboot behavior.
401+ if [ x"$GRUB_FORCE_PARTUUID" != x ]; then
402+ linux_root_device_thisversion="PARTUUID=${GRUB_FORCE_PARTUUID}"
403+ fi
404+ message="$(gettext_printf "Loading initial ramdisk ...")"
405+ if test -n "${initrd}" && [ x"$GRUB_FORCE_PARTUUID" != x ]; then
406+ sed "s/^/$submenu_indentation/" << EOF
407+ if [ "\${initrdfail}" = 1 ]; then
408+ linux ${rel_dirname}/${basename} root=${linux_root_device_thisversion} ro ${args}
409+EOF
410+ if [ x"$quiet_boot" = x0 ] || [ x"$type" != xsimple ]; then
411+ sed "s/^/$submenu_indentation/" << EOF
412+ echo '$(echo "$message" | grub_quote)'
413+EOF
414+ fi
415+
416 sed "s/^/$submenu_indentation/" << EOF
417- linux ${rel_dirname}/${basename} root=${linux_root_device_thisversion} ro ${args}
418+ initrd ${rel_dirname}/${initrd}
419+ else
420+ linux ${rel_dirname}/${basename} root=${linux_root_device_thisversion} ro ${args} panic=-1
421+ fi
422+ initrdfail
423 EOF
424 else
425+ # We don't have initrd or we don't want to set PARTUUID. Don't try initrd-less boot with fallback.
426 sed "s/^/$submenu_indentation/" << EOF
427- linux ${rel_dirname}/${basename} root=PARTUUID=${GRUB_FORCE_PARTUUID} ro ${args}
428+ linux ${rel_dirname}/${basename} root=${linux_root_device_thisversion} ro ${args}
429 EOF
430- fi
431- fi
432- if test -n "${initrd}" && [ x"$GRUB_DISABLE_INITRD" != xtrue ]; then
433- # TRANSLATORS: ramdisk isn't identifier. Should be translated.
434- if [ x"$quiet_boot" = x0 ] || [ x"$type" != xsimple ]; then
435- message="$(gettext_printf "Loading initial ramdisk ...")"
436- sed "s/^/$submenu_indentation/" << EOF
437+ if test -n "${initrd}"; then
438+ # We do have initrd - let's use it at boot.
439+ # TRANSLATORS: ramdisk isn't identifier. Should be translated.
440+ if [ x"$quiet_boot" = x0 ] || [ x"$type" != xsimple ]; then
441+ sed "s/^/$submenu_indentation/" << EOF
442 echo '$(echo "$message" | grub_quote)'
443 EOF
444- fi
445- sed "s/^/$submenu_indentation/" << EOF
446+ fi
447+ sed "s/^/$submenu_indentation/" << EOF
448 initrd ${rel_dirname}/${initrd}
449 EOF
450+ fi
451+ fi
452 fi
453 sed "s/^/$submenu_indentation/" << EOF
454 }

Subscribers

People subscribed via source and target branches