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

Re: linux-image-2.6.32-trunk-686 causing grub problems: alphabetical



On Tue, Mar 16, 2010 at 09:03 -0400, Stephen Powell wrote:
> On Tue, 16 Mar 2010 08:26:40 -0400 (EDT), Mitchell Laks wrote:
> > 
> > I notice that others had problems with grub not updating the kernel
> > from linux-image-2.6.32-trunk-686 to linux-image-2.6.32-3-amd64
> > and I had this  same problem.
> > 
> > I suspect that this is because the heuristic that dpkg or apt or aptitude update
> > is using
> > finds that linux-image-2.6.32-trunk-686 is greater than linux-image-2.6.32-3-amd
> > 64 alphabetically
> > even though it is the older kernel
> > and this is breaking all of your automatic grub updates done by debian packaging.
> > 
> > that is the reason we are all suffering....
> 
> I don't think this has anything to do with the package management system.
> My guess is that grub2 simply makes a list of all files in /boot which begin
> with linux-image, sorts them in descending order by the ASCII collating
> sequence, and the one which comes out on top is the default kernel.
> The problem is the decision to use "trunk" in the original 2.6.32 kernel
> image name.  This sorts higher than any numeric value.  I use lilo; so this
> doesn't affect me; but doesn't grub2 have some option for remembering
> the last kernel booted and making that the default?  If you don't want to
> remove/purge the old kernel, it seems to me that that would be the way to go.

Exactly. The relevant code is:

--- /etc/grub.d/10_linux -----------------------------------------------
...
list=`for i in /boot/vmlinu[xz]-* /vmlinu[xz]-* ; do
        if grub_file_is_not_garbage "$i" ; then echo -n "$i " ; fi
      done`
prepare_boot_cache=
...
------------------------------------------------------------------------

Which obviously does not special-case -trunk-, so it sorts based on
LC_COLLATE. Looks as if the -trunk- name was a particularly bad choice
and I'm not sure what is the best way to solve this problem.

The easiest way would be to enforce a strict naming scheme (maybe with
lintian) so the aforementioned code can stay as simple as it is today.
-- 
  .''`.     Wolodja Wentland    <wentland@cl.uni-heidelberg.de> 
 : :'  :    
 `. `'`     4096R/CAF14EFC 
   `-       081C B7CD FF04 2BA9 94EA  36B2 8B7F 7D30 CAF1 4EFC

Attachment: signature.asc
Description: Digital signature


Reply to: