Skip to content

Commit 424ddf4

Browse files
authored
ktest setup: GRUB submenu fixes (#486)
The GRUB documentation used to say `GRUB_DISABLE_SUBMENU=y`, now it says `GRUB_DISABLE_SUBMENU=true` Also, the corresponding code is unreliable copy/paste/diverge: rhboot/grub2@ee4bd79ef28e6fa4a6 This makes GRUB submenus error-prone. As a broken grub.cfg makes the system unbootable, "harden" the corresponding documentation. Signed-off-by: Marc Herbert <[email protected]>
1 parent 3c8c515 commit 424ddf4

File tree

1 file changed

+15
-7
lines changed

1 file changed

+15
-7
lines changed

getting_started/setup_linux/setup_ktest_environment.rst

+15-7
Original file line numberDiff line numberDiff line change
@@ -58,16 +58,24 @@ Set up a target
5858
sudo emacs /etc/default/grub
5959

6060
b) Change ``GRUB_DEFAULT=[n]`` to ``GRUB_DEFAULT=saved``.
61-
62-
c) Add ``GRUB_DISABLE_SUBMENU=y`` to the end of the file and save it.
6361

64-
This step is necessary because submenus confuse ktest.
62+
c) You must disable GRUB submenus because they confuse ktest:
63+
64+
.. code-block:: console
65+
66+
echo 'GRUB_DISABLE_SUBMENU=y' | sudo tee -a /etc/default/grub.d/disable-submenu.cfg
6567

6668
d) Update the grub configuration.
6769

6870
.. code-block:: console
69-
70-
sudo update-grub
71+
72+
# Better safe than _very_ sorry
73+
sudo cp /boot/grub/grub.cfg /boot/grub/saved_grub.cfg
74+
75+
sudo update-grub
76+
77+
# Make sure submenus are actually disabled
78+
grep submenu /boot/grub/grub.cfg
7179

7280
#. Set the default kernel.
7381

@@ -84,7 +92,7 @@ Set up a target
8492
# Print your currently booted (and known-safe) option
8593
cat /proc/cmdline
8694
# List the grub entries
87-
awk '/^menuentry/ { print i++, '\t', $0 }' /boot/grub/grub.cfg
95+
awk '/^menuentry|submenu/ { print i++, '\t', $0 }' /boot/grub/grub.cfg
8896
# Find the entry that matches the output of the
8997
# first command you ran, and take note of its number
9098
sudo grub-set-default [n] # Where [n] is that number
@@ -135,7 +143,7 @@ Set up a target
135143
#=> saved_entry=6
136144
137145
# Show all, numbered kernel choices without (re)booting
138-
awk '/^menuentry/ { print i++, '\t', $0 }' /boot/grub/grub.cfg
146+
awk '/^menuentry|submenu/ { print i++, '\t', $0 }' /boot/grub/grub.cfg
139147
#=> 5 menuentry ...
140148
#=> 6 menuentry 'Ubuntu, with Linux 5.4.0-53-generic' --class ubuntu ...
141149
#=> 7 menuentry ...

0 commit comments

Comments
 (0)