Skip to content
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

[installer]: Add support for grub-set-default. #532

Merged
merged 1 commit into from
Apr 25, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion installer/x86_64/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -489,11 +489,14 @@ set timeout=5

EOF

# Add the logic to support grub-reboot
# Add the logic to support grub-reboot and grub-set-default
cat <<EOF >> $grub_cfg
if [ -s \$prefix/grubenv ]; then
load_env
fi
if [ "\${saved_entry}" ] ; then
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

saved_entry [](start = 9, length = 11)

Where does it come from? Could you add some comment in this pull request about the problem and solution summary?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Its needed for sonic-net/sonic-utilities#40 for user to set default image for boot.

grub-set-default utility writes to value of saved_entry variable to grubenv.
https://www.gnu.org/software/grub/manual/legacy/Invoking-grub_002dset_002ddefault.html
This patch provides support for grub-set-default to allow user choose a default image to boot from.

set default="\${saved_entry}"
fi
if [ "\${next_entry}" ] ; then
set default="\${next_entry}"
set next_entry=
Expand Down