kernel installed by automatic update are not added in menu.lst

Asked by Guillaume Cote

I am running

Linux tolede 2.6.32-45-generic #99-Ubuntu SMP Tue Oct 16 16:26:56 UTC 2012 x86_64 x86_64 x86_64 GNU/Linux

When I do grep title /boot/grub/menu.lst, I have

title Ubuntu 12.04.1 LTS, kernel 3.2.0-32-generic
title Ubuntu 12.04.1 LTS, kernel 3.2.0-32-generic (recovery mode)
title Ubuntu 12.04.1 LTS, kernel 2.6.32-45-generic
title Ubuntu 12.04.1 LTS, kernel 2.6.32-45-generic (recovery mode)
title Ubuntu 12.04.1 LTS, kernel 2.6.32-44-generic
title Ubuntu 12.04.1 LTS, kernel 2.6.32-44-generic (recovery mode)
title Ubuntu 12.04.1 LTS, kernel 2.6.32-43-generic
title Ubuntu 12.04.1 LTS, kernel 2.6.32-43-generic (recovery mode)
title Ubuntu 12.04.1 LTS, memtest86+

When I run :

sudo dpkg-reconfigure linux-image-3.2.0-48-generic

It outputs :

Found kernel: /boot/vmlinuz-3.2.0-48-generic
Found kernel: /boot/vmlinuz-3.2.0-45-generic
Found kernel: /boot/vmlinuz-3.2.0-44-generic
Found kernel: /boot/vmlinuz-3.2.0-43-generic
Found kernel: /boot/vmlinuz-3.2.0-41-generic
Found kernel: /boot/vmlinuz-3.2.0-39-generic
Found kernel: /boot/vmlinuz-3.2.0-38-generic
Found kernel: /boot/vmlinuz-3.2.0-37-generic
Found kernel: /boot/vmlinuz-3.2.0-36-generic
Found kernel: /boot/vmlinuz-3.2.0-35-generic
Found kernel: /boot/vmlinuz-3.2.0-34-generic
Found kernel: /boot/vmlinuz-3.2.0-33-generic
Found kernel: /boot/vmlinuz-3.2.0-32-generic
Found kernel: /boot/vmlinuz-2.6.32-45-generic
Found kernel: /boot/vmlinuz-2.6.32-44-generic
Found kernel: /boot/vmlinuz-2.6.32-43-generic
Found kernel: /boot/memtest86+.bin

But after that menu.lst, contains only the same 9 entries. All the other kernel have been added by automatic update. Why aren't they added to menu.lst? Is there a way to have them added?

Question information

Language:
English Edit question
Status:
Answered
For:
Ubuntu Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
actionparsnip (andrew-woodhead666) said :
#1

What is the output of:

lsb_release -a; uname -a

Thanks

Revision history for this message
Guillaume Cote (lnchpd-guillcote) said :
#2

uname -a
Linux tolede 2.6.32-45-generic #99-Ubuntu SMP Tue Oct 16 16:26:56 UTC 2012 x86_64 x86_64 x86_64 GNU/Linux

lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 12.04.2 LTS
Release: 12.04
Codename: precise

Revision history for this message
actionparsnip (andrew-woodhead666) said :
#3

Try:

sudo apt-get --purge remove linux-image-2.6*
sudo apt-get --purge autoremove

What is the output?

Thanks

Revision history for this message
Guillaume Cote (lnchpd-guillcote) said :
#4

Why do you want me to remove those kernel?

I am currently running on of them and I like having other as backup.

Revision history for this message
Guillaume Cote (lnchpd-guillcote) said :
#5

I found this problem investigating why the sound is not working with the 3.2.0-32 :

https://answers.launchpad.net/ubuntu/+question/230924

There are a couple of other thing that are not working with 3.2.0-32.

Revision history for this message
actionparsnip (andrew-woodhead666) said :
#6

Ok, what is the output of :

sudo update-grub

Thanks

Revision history for this message
Manfred Hampl (m-hampl) said :
#7

What is the output of the commands

dpkg -l | grep grub
sudo dpkg --audit

Revision history for this message
Guillaume Cote (lnchpd-guillcote) said :
#8

dpkg -l | grep grub

ii grub 0.97-29ubuntu66 GRand Unified Bootloader (Legacy version)
ii grub-common 1.99-21ubuntu3.9 GRand Unified Bootloader (common files)

sudo dpkg --audit

[nothing]

sudo update-grub

Searching for GRUB installation directory ... found: /boot/grub
Searching for default file ... found: /boot/grub/default
Testing for an existing GRUB menu.lst file ... found: /boot/grub/menu.lst
Searching for splash image ... none found, skipping ...
Found kernel: /boot/vmlinuz-3.2.0-48-generic
Found kernel: /boot/vmlinuz-3.2.0-45-generic
Found kernel: /boot/vmlinuz-3.2.0-44-generic
Found kernel: /boot/vmlinuz-3.2.0-43-generic
Found kernel: /boot/vmlinuz-3.2.0-41-generic
Found kernel: /boot/vmlinuz-3.2.0-39-generic
Found kernel: /boot/vmlinuz-3.2.0-38-generic
Found kernel: /boot/vmlinuz-3.2.0-37-generic
Found kernel: /boot/vmlinuz-3.2.0-36-generic
Found kernel: /boot/vmlinuz-3.2.0-35-generic
Found kernel: /boot/vmlinuz-3.2.0-34-generic
Found kernel: /boot/vmlinuz-3.2.0-33-generic
Found kernel: /boot/vmlinuz-3.2.0-32-generic
Found kernel: /boot/vmlinuz-2.6.32-45-generic
Found kernel: /boot/vmlinuz-2.6.32-44-generic
Found kernel: /boot/vmlinuz-2.6.32-43-generic
Found kernel: /boot/memtest86+.bin
Updating /boot/grub/menu.lst ... done

Revision history for this message
Manfred Hampl (m-hampl) said :
#9

It seems to me that you are still running the old grub boot loader and not the newer grub2. (I miss the grub-pc package in the dpkg -l output.)

To verify that please provide the output of these commands:

which update-grub
dpkg-query -S */update-grub
grub-mkconfig --version

Please provide also some more information about your system:
Is it a desktop system with a X11 GUI, or a server used with text mode only, etc.
I guess you have installed your system some years ago and upgraded from version to version - is that the case?

Revision history for this message
Hamish McIntyre-Bhatty (hamishmb) said :
#10

You are running the kernels for ubuntu Lucid, which are no longer updated, and therefore should not be used due to security issues. You should switch to 3.2

Revision history for this message
Guillaume Cote (lnchpd-guillcote) said :
#11

@hamishmb -- I am running the one that works, I am trying to switch to 3.2, but I have a lot of issue with 3.2.0-32 and the other are not in the menu.

Revision history for this message
Guillaume Cote (lnchpd-guillcote) said :
#12

The system has xubuntu installed, however it has been used mostly headless. I installed the previous LTS and upgraded directly to the current one.

which update-grub

/usr/sbin/update-grub

 dpkg-query -S '*/update-grub'

grub: /usr/sbin/update-grub
grub: /sbin/update-grub

The update-grub in /sbin is wrapper that calls the one in /usr/sbin

 grub-mkconfig --version

grub-mkconfig (GRUB) 1.99-21ubuntu3.9

Revision history for this message
actionparsnip (andrew-woodhead666) said :
#13

Then you are not using Grub, you are using Grub2. Grub2 does not use menu.list. It uses a number of configuration scripts to ultimately generate /boot/grub/grub.cfg

Grub.cfg is NOT to be modified manually and instead the config files it uses to make grub.cfg are to be modified, you can then run:

sudo update-grub

to apply the changes.

Revision history for this message
Guillaume Cote (lnchpd-guillcote) said :
#14

@andrew-woodhead666

There is no file /boot/grub/grub.cfg on my system. As mention previously sudo update-grub outputs :

Updating /boot/grub/menu.lst ... done

What make you think I am using grub2 and not grub?

Revision history for this message
Guillaume Cote (lnchpd-guillcote) said :
#15

I have been investigating update-grub to understand what does not work.

First, it generate a file called $buffer, which contains all the kernel. Then at line 1512, it does :

if ! grep -q "^$start" $menu ; then

I think this if is there to check if the menu.lst contains ### BEGIN AUTOMAGIC KERNELS LIST
and to replace only that part when it exist. After that if does :

    umask 077
    sed -e "/^$start/,/^$end/{
 /^$start/r $buffer
 d
 }
 " $menu > $menu.new
    cat $menu.new > $menu
    rm -f $buffer $menu.new

The result of the sed statement that is store in $menu.new is exactly the original file. I think this is a bug in the script. I don't know the sed syntax, I would appreciate if a sed expert can explain me what this line should do and if it look ok or not?

Revision history for this message
Manfred Hampl (m-hampl) said :
#16

1. The meaning of the sed command is the following:
a. first it checks if there is the occurence of the start sequence (###BEGIN...) in the menu file - if not, the current contents of buffer are copied as new menu file.
b. else all contents between start sequence and end sequence are replaced by the buffer and the old contents removed.

2. BUT: The file is the update-grub script from the outdated old grub package, not from the current grub2 version!

There seems to be a strange combination of packages from grub and grub2 installed.

My recommendation: Check what would happen if you try upgrading from grub to grub2.
Issue the command

apt-get --simulate install grub2

and copy/paste all output as done before.

Can you help with this problem?

Provide an answer of your own, or ask Guillaume Cote for more information if necessary.

To post a message you must log in.