forked from u-root/u-root
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
pkg/boot: Add basic support for GRUB default boot entry
Add support for the default boot entry when GRUB_DEFAULT=saved and GRUB_ENABLE_BLSCFG=true in /etc/default/grub. For this case grub.cfg would generate the below line: set default="${saved_entry}" and grubenv would contain the value of ${saved_entry}, which will be compared and used as the default boot entry. Here it only handles specifically for this case. The default boot entry will be assigned with an incremented linux.BootRank, therefore it will be displayed from the top of the boot menu. Testing method: With CentOS 8, set GRUB_DEFAULT=saved and GRUB_ENABLE_BLSCFG=true in /etc/default/grub, and then run 'grub2-mkconfig -o /boot/efi/EFI/centos/grub.cfg'. Use 'grubby --set-default' to set the default boot option, run 'cat /boot/*/grubenv' to check the value after saved_entry is expected. After reboot, 'boot' command can see the default boot option displayed at the top of the boot menu. Signed-off-by: Shelly Chang <[email protected]>
- Loading branch information
1 parent
6daa073
commit 8a23cba
Showing
5 changed files
with
88 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters