Edit /etc/default/grub
to use saved entries (your Linux partition should boot by default)
# Set a default boot entry to fall back to
GRUB_DEFAULT=saved
# Hide the GRUB boot options menu for quicker bootup
GRUB_TIMEOUT=0
# Press SHIFT to show boot selector
GRUB_FORCE_HIDDEN_MENU="true"
# Display all menu entries without an 'Advanced' main menu
GRUB_DISABLE_SUBMENU=y
Generate a numerical list of entries from Grub
gawk 'BEGIN {
l=0
menuindex= 0
stack[t=0] = 0
}
function push(x) { stack[t++] = x }
function pop() { if (t > 0) { return stack[--t] } else { return "" } }
{
if( $0 ~ /.*menu.*{.*/ )
{
push( $0 )
l++;
} else if( $0 ~ /.*{.*/ )
{
push( $0 )
} else if( $0 ~ /.*}.*/ )
{
X = pop()
if( X ~ /.*menu.*{.*/ )
{
l--;
match( X, /^[^'\'']*'\''([^'\'']*)'\''.*$/, arr )
if( l == 0 )
{
print menuindex ": " arr[1]
menuindex++
submenu=0
} else
{
print " " (menuindex-1) ">" submenu " " arr[1]
submenu++
}
}
}
}' /boot/grub/grub.cfg
Set the default boot entry.
# Here we use the example boot entry number '2' - use a number of your choosing from the generated grub entries
grub-set-default '2'
Save the configuration
grub-mkconfig -o /boot/grub/grub.cfg