-
Notifications
You must be signed in to change notification settings - Fork 75
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ktest setup: GRUB submenu fixes #486
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -58,16 +58,24 @@ Set up a target | |
sudo emacs /etc/default/grub | ||
|
||
b) Change ``GRUB_DEFAULT=[n]`` to ``GRUB_DEFAULT=saved``. | ||
|
||
c) Add ``GRUB_DISABLE_SUBMENU=y`` to the end of the file and save it. | ||
|
||
This step is necessary because submenus confuse ktest. | ||
c) You must disable GRUB submenus because they confuse ktest: | ||
|
||
.. code-block:: console | ||
|
||
echo 'GRUB_DISABLE_SUBMENU=y' | sudo tee -a /etc/default/grub.d/disable-submenu.cfg | ||
|
||
d) Update the grub configuration. | ||
|
||
.. code-block:: console | ||
|
||
sudo update-grub | ||
|
||
# Better safe than _very_ sorry | ||
sudo cp /boot/grub/grub.cfg /boot/grub/saved_grub.cfg | ||
|
||
sudo update-grub | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Note: this sometimes can cause un-bootable system which can be only recovered by booting to a live env, chrooting to the existing linux install and There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I tried to chroot and run update-grub inside the chroot but that did not work, it failed with: What worked for me was to find and manually enter grub commands and parameters at boot time. This let me boot. Then I disabled the submenus and ran Different OS and different situations will require different solutions. Rescuing unbootable systems is a very complex topic; we can't provide bullet proof advice in such a limited space here. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Few things should be done to be able to update grub in chroot, something like:
Wow
Sure! There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @marc-hb Are you ready for this PR to be merged? Thanks. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes please merge. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @marc-hb Thanks! |
||
|
||
# Make sure submenus are actually disabled | ||
grep submenu /boot/grub/grub.cfg | ||
|
||
#. Set the default kernel. | ||
|
||
|
@@ -84,7 +92,7 @@ Set up a target | |
# Print your currently booted (and known-safe) option | ||
cat /proc/cmdline | ||
# List the grub entries | ||
awk '/^menuentry/ { print i++, '\t', $0 }' /boot/grub/grub.cfg | ||
awk '/^menuentry|submenu/ { print i++, '\t', $0 }' /boot/grub/grub.cfg | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. there should not be any submenu at this point? But There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Not in theory. In practice this "magic" command is typically re-used across devices - including devices that still have submenus for whatever reason. And the consequences can be deadly.
In my experience it's not; I use this command all the time. |
||
# Find the entry that matches the output of the | ||
# first command you ran, and take note of its number | ||
sudo grub-set-default [n] # Where [n] is that number | ||
|
@@ -135,7 +143,7 @@ Set up a target | |
#=> saved_entry=6 | ||
|
||
# Show all, numbered kernel choices without (re)booting | ||
awk '/^menuentry/ { print i++, '\t', $0 }' /boot/grub/grub.cfg | ||
awk '/^menuentry|submenu/ { print i++, '\t', $0 }' /boot/grub/grub.cfg | ||
#=> 5 menuentry ... | ||
#=> 6 menuentry 'Ubuntu, with Linux 5.4.0-53-generic' --class ubuntu ... | ||
#=> 7 menuentry ... | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the commit is saying that
GRUB_DISABLE_SUBMENU=true
is the documented setting and not withy
?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
y
(unusual) totrue
(common)y
only" to: "y
ORtrue
".=> To be compatible with ALL grub versions, stick to
y
.