[Top][All Lists]

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

Re: Grub2 almost does what I want

From: Andrey Borzenkov
Subject: Re: Grub2 almost does what I want
Date: Tue, 5 Feb 2013 22:28:50 +0400

В Sun, 03 Feb 2013 14:44:18 -0500
Felix Miata <address@hidden> пишет:

> On 2013-02-03 22:58 (GMT+0400) Andrey Borzenkov composed:
> >> >> How mkconfig decided what to create and where to locate are 
> >> >> unfathomable.
> >> > It takes list of /boot/vmlinuz-* and lexicographically sorts them.
> >> It probably needs to find the one on the target partition with the biggest
> >> numeric component to make default/top of list when all others are to go in 
> >> a
> >> submenu as Mageia does it.
> > That's exactly what it does. But you manually created links with
> > non-numeric "version" part. So how should they be sorted now? Before or
> > after numerals?
> > [...]
> Current listing of /boot/vmlinuz-* needs changing to listing of 
> /boot/vmlinuz* so that the stanza containing the preferred kernel "vmlinuz" 
> (or "linux" if that's what the distro uses) when present appears first 
> instead of not at all.

Hmm ... if /vmlinuz link is managed by distribution, it is usually
points to the kernel with highest version number (in which case see
below). If you manage it yourself, you can simply set GRUB_DEFAULT to
menu entry id, which remains the same for a given kernel version on a
given filesystem (at least, as long as you do not reformat it) even if
you add or remove kernels.

So it is not clear what problem using /vmlinuz solves.

>                       (Had that been the case already, I might never have 
> participated in this thread.) Those containing numeric strings should be 
> sorted in descending order.

That's what happens currently.

>                            The rest should be sorted in ascending alpha 
> order.

Why? Because in English "cur" sorts before "prev"? And if other
language translations sort differently? 

>       I would prefer all symlink stanzas be grouped before realname stanzas 
> whenever the titles can be made sensible.

And I prefer to use vmlinuz-$version :) 

If you want to manage grub.cfg yourself, it is really easy. In
default case of /boot and /boot/grub(2) being on the same filesystem
(which likely covers 99% of all use cases) $root is already set
correctly for you by grub-install and already incudes
everything needed to access /boot. Which reduces "unfathomable" grub.cfg
to trivial

menuentry --title ... {
  kernel /vmlinuz-whatever-name whatever kernel options
  initrd /initrd-name

Just disable /etc/boot.d/10_linux and maintain /etc/grub.d/40_custom
manually. Or add 05_my-symlinks which contains menu entries for your
vmlinuz-first, vminuz-second ... in order you like them, which will
always come before standard ones.

One think that could be improved in default script set is symlink
handling. Something like


GRUB_SYMLINK_HANDLING=resolve would complement above nicely without need
to disable standard scripts. Does it make sense?

reply via email to

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