help-grub
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: change default os


From: Jordan Uggla
Subject: Re: change default os
Date: Sun, 24 Mar 2013 21:57:48 -0700

On Sun, Mar 24, 2013 at 12:09 PM, David WE Roberts
<address@hidden> wrote:
>
> I have used the renumbering trick on several systems for some time and it
> seems to work fine.
>
> Changing the order in which the '.d' files are run seems to change the
> order in which the menu entries are built and is less invasive than
> editing config files.

You have a different definition of "less invasive" than I do. I think
changing a single configuration option, GRUB_DEFAULT, in
/etc/default/grub is much less invasive than modifying the scripts in
/etc/grub.d/, even just to rename them.

>
> Given that the grub.cfg file starts with an explicit warning against
> editing it directly, as does the documentation, I an confused as to how it
> is a viable alternative.
>
> Please note that I am running Ubuntu Linux.
>
> On a regular basis the kernel is updated and the grub configuration is
> updated.
> So writing a manual grub.cfg would surely mean redoing this every time you
> updated the kernel.

Writing a completely manual grub.cfg with Ubuntu would require that
you either have a separate grub-installation in a different directory
(often people even make a separate grub partition when they have many
OSs so that they can keep their main grub installation independent of
any OS) or that you make Debian/Ubuntu's update-grub script a symlink
to /bin/true, then dpkg-divert update-grub. That said, if you're going
to dpkg-divert something then you could in fact dpkg-divert the
scripts in /etc/grub.d/ into a different order, and since you're
telling dpkg about the renaming (rather than just using mv to move the
files) it should continue to work on upgrades.

>
> I haven't yet seen grub.d updated (at least not os_prober).

I have. How have you been checking if it has been updated?

>
> This fix is quite widely mentioned in Linux fora (which is where I found
> it).

There is a lot of bad advice on forums, some of it even very popular.

>
> So you will have problems if /etc/grub.d is updated or restructured such
> that a new os_prober script is delivered.
>
> How often is this compared to kernel updates?

Much less often than kernel updates, though likely at least once
within a major release and almost certainly when upgrading from one
major release to another.

>
> On a more abstract note, why should Linux appear before 'other OS' in the
> boot menu?

A decision on some type of order needs to be made, and the OS
controlling grub being first seems a sane default, if not ideal in
many cases.

>
> It would be much more friendly if you could select the order in which
> various OS are added to the menu.

Indeed, it is unfortunate how hard it is to change the order of menu
entries in grub when using grub-mkconfig, I can't think of a great
interface currently for setting the order menu entries are displayed,
though it's likely that someone else could. If you have a proposal for
a good interface for this please share it.

>
> Just suppose you wanted the menu order to be
>
> (1) Windows 7
>
> (2) Windows Vista
>
> (3) Linux
>
> How would you achieve this automatically on a kernel update by Ubuntu?

Currently, you basically wouldn't. If you really wanted to, using
dpkg-divert to re-order the files in /etc/grub.d/ wouldn't be a bad
solution, though is very distribution specific, and also wouldn't
allow you to decide which of Windows Vista or Windows 7 comes first,
as they're both generated by /etc/grub.d/30_os-prober.

It's definitely not an ideal situation.

-- 
Jordan Uggla (Jordan_U on irc.freenode.net)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]