update-initramfs -c does not update the bootloader

Bug #701698 reported by Oliver Grawert
44
This bug affects 7 people
Affects Status Importance Assigned to Milestone
boot (Ubuntu)
Fix Released
Wishlist
Oliver Grawert
Natty
Won't Fix
Wishlist
Unassigned
Oneiric
Fix Released
High
Oliver Grawert

Bug Description

Binary package hint: initramfs-tools

when looking at update-initramfs' source code there is the run_bootloader function looking like:

run_bootloader()
{
        # invoke policy conformant bootloader hooks
        if [ -d /etc/initramfs/post-update.d/ ]; then
                run-parts --arg=${version} --arg=${initramfs} \
                        /etc/initramfs/post-update.d/
                return 0
        fi

        # FIXME: to be removed postsqueeze release
[...]
        if flash-kernel --supported >/dev/null 2>&1; then
                flash-kernel ${version}
                return 0
        fi
}

this function is later on called from the update function (invoked by calling update-initramfs -u)
in the case where a completely new kernel update is installed and the create function (update-initramfs -c) is used the run_bootloader function is ignored. in case of bootloaders like lilo or bootloaders that need flash-kernel to run this leaves the system with the previous kernel. the kernel will only be active after an update-initramfs -u run

a call to run_bootloader needs to be added to the create() function.

Tags: bitesize armel
Oliver Grawert (ogra)
Changed in initramfs-tools (Ubuntu):
importance: Undecided → High
assignee: nobody → Oliver Grawert (ogra)
Revision history for this message
Oliver Grawert (ogra) wrote :

subscribing the debian maintqainer to the bug to get some feedback about the issue.

Revision history for this message
maximilian attems (maks-debian) wrote :

I am subscribed to these bugs, just silent lately due to the swarm of unrelated bugs.

Anyway why do you want it to be run on create?

Revision history for this message
Oliver Grawert (ogra) wrote :

a) our kernel packages carry the ABI version in their packagename, in case of a dist upgrade between two releases there is no former initrd to upgrade

b) in the case of armel we often have users that only use a rootfs and later install a kernel they created with kernel-package, these users indeed have to run update-initramfs -c to create the initial initrd.

beyond that i dont really see a reason for different behavior between create and update regarding the bootloader, imho both commands should get me a bootable system with the new initrd, which wont happen in case of create currently, at least for bootloaders that need the initrd and kernel flashed into certain places.
currently update-initramfs -c in combination with flash-kernel leaves me either with the old initrd/kernel or if i'm unlucky (i.e. because i bootstrapped a rootfs manually) with no kernel at all for the bootloader i would assume the same is true for bootloaders like lilo or any other bootloader that needs special handling as well.

Revision history for this message
maximilian attems (maks-debian) wrote :

In the question of an abi upgrade aka new install it is the linux image responsibility to call the respective hooks.

You don't want to have create run them too otherwise you end up in funny loops.
(See old discussion with Joey Hess when implementing the triggering)

Uniropo (uniropo)
affects: initramfs-tools (Ubuntu Natty) → boot (Ubuntu Natty)
Tobin Davis (gruemaster)
Changed in boot (Ubuntu Natty):
status: New → Triaged
tags: added: armel
tags: added: bitesize
Oliver Grawert (ogra)
Changed in boot (Ubuntu Natty):
importance: High → Wishlist
Revision history for this message
Kate Stewart (kate.stewart) wrote :

Reflecting the Natty status into Oneiric, so this gets considered.

Changed in boot (Ubuntu Oneiric):
importance: Undecided → High
status: New → Triaged
Revision history for this message
Frostybeard (william-smith-frostybeard) wrote :

I have this problem too. I duplicated an error to this one. After successfully installing Natty to Pandaboard, running "apt-get update" and "apt-get dist-upgrade" breaks the installation, meaning Ubuntu no longer boots.

Also running the graphical update tool fails in the initramfs package installation. I have it running now and am reluctant to reboot. Just wondering if I can fix it before shutting it down so that it will reboot.

Revision history for this message
Frostybeard (william-smith-frostybeard) wrote :

@Oliver Grawert
Here's what I get when I run "update-initramfs -u"

william@william-pandaboard:~$ sudo update-initramfs -u
update-initramfs: Generating /boot/initrd.img-2.6.38-1208-omap4
find: `/lib/modules/2.6.38-1208-omap4/kernel/arch': No such file or directory
find: `/lib/modules/2.6.38-1208-omap4/kernel/arch/': No such file or directory
find: `/lib/modules/2.6.38-1208-omap4/kernel/arch/': No such file or directory
find: `/lib/modules/2.6.38-1208-omap4/kernel/arch/': No such file or directory
find: `/lib/modules/2.6.38-1208-omap4/kernel/arch/': No such file or directory
find: `/lib/modules/2.6.38-1208-omap4/kernel/arch/': No such file or directory
find: `/lib/modules/2.6.38-1208-omap4/kernel/arch/': No such file or directory
find: `/lib/modules/2.6.38-1208-omap4/kernel/arch/': No such file or directory
ln: creating symbolic link `/tmp/mkinitramfs_s8hhlr/bin/sync': File exists
Using u-boot partition: /dev/mmcblk0p1
Creating backups of uImage and uInitrd... done.
Generating kernel u-boot image... done.
Generating Initramfs u-boot image... done.
Generating u-boot configuration from /boot/boot.script... done.
umount: /tmp/tmp.ooKvzS2lwQ: device is busy.
        (In some cases useful info about processes that use
         the device is found by lsof(8) or fuser(1))

Revision history for this message
Frostybeard (william-smith-frostybeard) wrote :

That worked. I was able to reboot.

Oliver Grawert (ogra)
Changed in boot (Ubuntu Oneiric):
assignee: nobody → Oliver Grawert (ogra)
Revision history for this message
Oliver Grawert (ogra) wrote :

flash-kernel (2.28ubuntu28) oneiric; urgency=low

  * add an /etc/kernel/postinst.d script to work around (LP: #701698)
    and finally make upgrades to newer kernel versions work.

Changed in boot (Ubuntu Oneiric):
status: Triaged → Fix Released
Oliver Grawert (ogra)
Changed in boot (Ubuntu Natty):
assignee: Oliver Grawert (ogra) → nobody
status: Triaged → Won't Fix
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

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