-
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
Conversation
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]>
|
||
.. code-block:: console | ||
|
||
echo 'GRUB_DISABLE_SUBMENU=y' | sudo tee -a /etc/default/grub.d/disable-submenu.cfg |
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 with y
?
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 documentation changed from
y
(unusual) totrue
(common) - The _implementation changed from: "
y
only" to: "y
ORtrue
".
=> To be compatible with ALL grub versions, stick to y
.
@@ -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 comment
The reason will be displayed to describe this comment to others. Learn more.
there should not be any submenu at this point?
But sudo
might be needed to actually read the grub.cfg
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.
there should not be any submenu at this point?
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.
But sudo might be needed to actually read the grub.cfg
In my experience it's not; I use this command all the time.
# 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 comment
The 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 grub-install --target=x86_64-efi ....
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.
I tried to chroot and run update-grub inside the chroot but that did not work, it failed with: can't find device for /, is /dev mounted?
GRUB was still installed fine on my system in that instance, that wasn't my problem.
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 update-grub
from the "real" system.
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 comment
The 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:
can't find device for /, is /dev mounted?
GRUB was still installed fine on my system in that instance, that wasn't my problem.
Few things should be done to be able to update grub in chroot, something like:
https://wiki.gentoo.org/wiki/Chroot#Configuration
What worked for me was to find and manually enter grub commands and parameters at boot time.
Wow
This let me boot. Then I disabled the submenus and ran
update-grub
from the "real" system.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.
Sure!
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.
@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 comment
The 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 comment
The reason will be displayed to describe this comment to others. Learn more.
@marc-hb Thanks!
@ujfalusi Has the issues you raised been resolved to your satisfaction? If so, I will merge this PR. |
The GRUB documentation used to say
GRUB_DISABLE_SUBMENU=y
, now it saysGRUB_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.