Skip to content

Commit

Permalink
[installer]: Add support for grub-set-default. (#532)
Browse files Browse the repository at this point in the history
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.

Signed-off-by: marian-pritsak <marianp@mellanox.com>
  • Loading branch information
marian-pritsak authored and lguohan committed Apr 25, 2017
1 parent f28790c commit 035b08b
Showing 1 changed file with 4 additions and 1 deletion.
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
set default="\${saved_entry}"
fi
if [ "\${next_entry}" ] ; then
set default="\${next_entry}"
set next_entry=
Expand Down

0 comments on commit 035b08b

Please sign in to comment.