9.10 update-grub fails to run

Bug #426917 reported by David Favor
4
This bug affects 1 person
Affects Status Importance Assigned to Milestone
grub-installer (Ubuntu)
Triaged
Medium
Unassigned

Bug Description

Binary package hint: grub

There appears to be a minor problem which comes and goes with kernel upgrades.

As I recall through kernel 2.6.31-7 update-grub failed to run when a new kernel was installed.

Both 2.6.31-8 and 2.6.31-9 seemed to have fixed this.

Installing 2.6.31-10 causes the problem to reoccur.

The fix is to simply run update-grub manually and all is well.

This maybe a problem with either grub-pc or grub-common installing some action to run when kernels are installed or it maybe a problem in kernel packaging.

Revision history for this message
Steve Langasek (vorlon) wrote :

Thank you for taking the time to report this issue and help to improve Ubuntu.

What is the error message when update-grub fails to run?

Changed in grub (Ubuntu):
status: New → Incomplete
Revision history for this message
Colin Watson (cjwatson) wrote : Re: [Bug 426917] [NEW] 9.10 update-grub fails to run

In what way does it fail to run? Is there any more information you can
give us, such as the terminal output from dpkg? There's not very much to
go on here, unfortunately ...

 status incomplete

Revision history for this message
Michael Lustfield (michaellustfield) wrote :

I'd like to test this to verify it. With the 9.10 install cd you can install grub 2 or leave legacy grub in place. Could you please let us know which version it is? I imagine it's possible a trigger in the package was not set which may need to be watched in the future.

Revision history for this message
David Favor (davidfavor) wrote :

It appears update-grub is never run.

There's no error.

If update-grub is run manually on the command line /boot/grub/grub.cfg is rebuilt without any errors.

I'm running post Alpha 5.

With post Alpha 5 this was broken until around kernel 2.6.31-8 and 2.6.31-9 then return with kernel 2.6.31-10 and I did note in between my install of 2.6.31-9 and 2.6.31-10 there were 3-4 new versions of grub-pc and grub-common I noticed when I did an 'apt-get dist-upgrade'.

I'm by no means dpkg knowledgeable. I'm guessing one of two things.

1) Either the kernel packaging fails to correctly run update-grub... or

2) Either grub-pc or grub-common install some sort of packaging magic which is suppose to run each time a new kernel is installed.

In either case, manually running update-grub fixes the problem.

So I'm guessing the packaging with one of these packages to run update-grub at the end of any kernel install will fix the problem.

Revision history for this message
Steve Langasek (vorlon) wrote : Re: [Bug 426917] Re: 9.10 update-grub fails to run

On Wed, Sep 09, 2009 at 10:45:45PM -0000, David Favor wrote:
> It appears update-grub is never run.

Please post the contents of your /etc/kernel-img.conf.

--
Steve Langasek Give me a lever long enough and a Free OS
Debian Developer to set it on, and I can move the world.
Ubuntu Developer http://www.debian.org/
<email address hidden> <email address hidden>

Revision history for this message
David Favor (davidfavor) wrote :

david@home1:/etc/pulse$ cat /etc/kernel-img.conf
do_symlinks = yes
relative_links = yes
do_bootloader = no
do_bootfloppy = no
do_initrd = yes
link_in_boot = no

Revision history for this message
David Favor (davidfavor) wrote :

I just upgraded two servers from 9.04 -> 9.10 using 'do-release-upgrade -d' and I notice a difference.

After the upgrade I installed the latest kernel (apt-get install linux-image-2.6.31-10-generic) and when this command runs there's a postinst hook that fires which runs update-grub. This is different than the machine where I installed a copy of 9.10 Alpha 4 and have done normal updates. Here's the log of the system which is working correctly (runs the correct posthook for each kernel install).

Please note the Alpha version is using Grub2 (this gets installed during the fresh install). The two servers I just upgraded have Grub1 installed. Maybe this has something to do with it.

If someone knows the command sequence to upgrade from the Grub1 to Grub2 (shudder...) let me know and I'll try it on one of these new servers, then do a --reinstall of the kernel to see if the posthook fires correctly.

Kernel install from working servers....

root@ubuntu:~# apt-get install linux-image-2.6.31-10-generic
Reading package lists... Done
Building dependency tree
Reading state information... Done
Suggested packages:
  fdutils linux-doc-2.6.31 linux-source-2.6.31
The following NEW packages will be installed:
  linux-image-2.6.31-10-generic
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get 28.7MB of archives.
After this operation, 89.9MB of additional disk space will be used.
Get:1 http://us.archive.ubuntu.com karmic/main linux-image-2.6.31-10-generic 2.6.31-10.30 [28.7MB]
Fetched 28.7MB in 17s (1675kB/s)
Selecting previously deselected package linux-image-2.6.31-10-generic.
(Reading database ... 22613 files and directories currently installed.)
Unpacking linux-image-2.6.31-10-generic (from .../linux-image-2.6.31-10-generic_2.6.31-10.30_i386.deb) ...
Done.
Setting up linux-image-2.6.31-10-generic (2.6.31-10.30) ...
Running depmod.
update-initramfs: Generating /boot/initrd.img-2.6.31-10-generic
Running postinst hook script /sbin/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: /vmlinuz-2.6.31-10-generic
Found kernel: /vmlinuz-2.6.28-15-server
Found kernel: /memtest86+.bin
Replacing config file /var/run/grub/menu.lst with new version
Updating /boot/grub/menu.lst ... done

Revision history for this message
Steve Langasek (vorlon) wrote :

The problem is that 'postinst_hook = update-grub' should be set in your /etc/kernel-img.conf, and isn't on the new install. AFAIK, this should be done by the grub-installer package at install time, so reassigning the bug there. Though it's possible this bug is already fixed in alpha 5, and you should just add this line by hand, along with 'postrm_hook = update-grub'.

affects: grub (Ubuntu) → grub-installer (Ubuntu)
Changed in grub-installer (Ubuntu):
importance: Undecided → Medium
status: Incomplete → Triaged
Revision history for this message
Colin Watson (cjwatson) wrote :

The code in grub-installer to do this hasn't changed in years, as far as
I know. Maybe something went wrong in the initial installation before
kernel-img.conf was modified, though - could you attach
/var/log/installer/syslog so that I can check this possibility?

Revision history for this message
David Favor (davidfavor) wrote :

I've added 'postrm_hook = update-grub' to /etc/kernel-img.conf so hopefully this is fixed now.

Thanks.

This looks to relate to this open bug which is queued to be fixed in Alpha 6:

https://bugs.launchpad.net/ubuntu/+source/ubiquity/+bug/419911

Revision history for this message
Colin Watson (cjwatson) wrote :

Ah, yes, thanks. I'll just make this a duplicate then - I've already uploaded the bits to make this work in the alternate installer, so it should now be a simple matter of a ubiquity upload.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.