update-initramfs trigger should run flash-kernel

Bug #358762 reported by Oliver Grawert
6
Affects Status Importance Assigned to Milestone
initramfs-tools (Ubuntu)
Fix Released
High
Unassigned
Jaunty
Fix Released
High
Registry Administrators

Bug Description

Binary package hint: initramfs-tools

if update-initramfs runs on the ARM architecture, namely on a system that uses the flash-kernel tool to update kernels and initramfs, there is no flash-kernel run after update-initramfs finished (i.e. if you install udev) ... a hook needs to be put in place so flash-kernel is run automatically

Tags: arm
Oliver Grawert (ogra)
tags: added: arm
Changed in initramfs-tools (Ubuntu):
importance: Undecided → High
milestone: none → ubuntu-9.04
Revision history for this message
Loïc Minier (lool) wrote :

root@babbage:~# apt-get install --reinstall initramfs-tools
Reading package lists... Done
Building dependency tree
Reading state information... Done
0 upgraded, 0 newly installed, 1 reinstalled, 0 to remove and 0 not upgraded.
Need to get 81.3kB of archives.
After this operation, 0B of additional disk space will be used.
Do you want to continue [Y/n]?
Get:1 http://ports.ubuntu.com jaunty/main initramfs-tools 0.92bubuntu27 [81.3kB]
Fetched 81.3kB in 1s (70.4kB/s)
(Reading database ... 41068 files and directories currently installed.)
Preparing to replace initramfs-tools 0.92bubuntu27 (using .../initramfs-tools_0.92bubuntu27_all.deb) ...
Unpacking replacement initramfs-tools ...
Processing triggers for man-db ...
Setting up initramfs-tools (0.92bubuntu27) ...
update-initramfs: deferring update (trigger activated)

Processing triggers for initramfs-tools ...
update-initramfs: Generating /boot/initrd.img-2.6.28-11-imx51

Changed in initramfs-tools (Ubuntu):
assignee: nobody → canonical-mobile
status: New → Triaged
Revision history for this message
Oliver Grawert (ogra) wrote :

--- /usr/sbin/update-initramfs 2009-03-13 10:57:32.000000000 +0100
+++ update-initramfs 2009-04-10 13:25:25.000000000 +0200
@@ -184,6 +184,12 @@
  lilo
 }

+# call flash-kernel
+run_flash_kernel()
+{
+ flash-kernel
+}
+
 # check if lilo is on mbr
 mbr_check()
 {
@@ -262,6 +268,9 @@
  if [ -r /etc/zipl.conf ]; then
   zipl
  fi
+ if [ -r /etc/flash-kernel.conf ]; then
+ run_flash_kernel
+ fi
 }

 compare_sha1()

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

something similar to teh above should suffice for a start, problematic seems to me that update-initramfs -c (creating an initramfs from scratch) doesnt call a bootloader at all, the run_bootloader() function is only executed when update-initramfs is called with -u ... though the same problem is true for lilo, elilo and zipl here.

Revision history for this message
Loïc Minier (lool) wrote :

This affects all arches; http://lists.debian.org/debian-arm/2008/07/msg00071.html has a more elegant fix:
if flash-kernel --supported >/dev/null 2>&1; then
 flash-kernel
fi

perhaps we need to test for the existence of flash-kernel as well (but not the .conf, that's arch specific).

summary: - update-initramfs is missing a trigger for flash-kernel
+ update-initramfs trigger should run flash-kernel
Loïc Minier (lool)
Changed in initramfs-tools (Ubuntu Jaunty):
status: Triaged → New
Revision history for this message
Oliver Grawert (ogra) wrote :

confirming the debian fix works fine (tested with apt-get install --reinstall udev)

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

Loïc asked for a release team review/ack here, but I don't see that there's a final debdiff available for inspection - from what I see there are two different patches being considered? (maybe three, depending on what's in the debian fix?)

Either of the proposed bits of code here look reasonable/acceptable to me.

As for update-initramfs -c not calling the bootloader, it's assumed that this is handled by the kernel postinstall hooks instead. Does flash-kernel correctly integrate with the kernel packages on that score?

Revision history for this message
Loïc Minier (lool) wrote :

What Debian merged was this patch:
diff --git a/update-initramfs b/update-initramfs
index 6f978f3..9830a7d 100755
--- a/update-initramfs
+++ b/update-initramfs
@@ -262,6 +262,12 @@ run_bootloader()
        if [ -r /etc/zipl.conf ]; then
                zipl
        fi
+ if flash-kernel --supported >/dev/null 2>&1; then
+ flash-kernel
+ fi
+ if glantank-update-kernel --supported >/dev/null 2>&1; then
+ glantank-update-kernel
+ fi
 }

 compare_sha1()

(modified to drop glantank later on)

Concerning update-initramfs -c: we add a /etc/kernel-img.conf which calls flash-kernel on upgrades.

Will attach a debdiff.

Revision history for this message
Loïc Minier (lool) wrote :

I tested the patch with "sudo apt-get install --reinstall udev" on my desktop:
Réception de : 1 http://archive.ubuntu.com jaunty/main udev 141-1 [338kB]
338ko réceptionnés en 0s (1744ko/s)
(Lecture de la base de données... 247996 fichiers et répertoires déjà installés.)
Préparation du remplacement de udev 141-1 (en utilisant .../archives/udev_141-1_amd64.deb) ...
Ajout de « local diversion of /sbin/udevadm to /sbin/udevadm.upgrade »
Dépaquetage de la mise à jour de udev ...
Traitement des actions différées (« triggers ») pour « man-db »...
Paramétrage de udev (141-1) ...
 * Stopping kernel event manager... [ OK ]
 * Starting kernel event manager... [ OK ]
Suppression de « local diversion of /sbin/udevadm to /sbin/udevadm.upgrade »
update-initramfs: deferring update (trigger activated)

Traitement des actions différées (« triggers ») pour « initramfs-tools »...
update-initramfs: Generating /boot/initrd.img-2.6.28-11-generic

and on an armel imx51 babbage board:
Get:1 http://ports.ubuntu.com jaunty/main udev 141-1 [326kB]
Fetched 326kB in 4s (80.6kB/s)
(Reading database ... 45967 files and directories currently installed.)
Preparing to replace udev 141-1 (using .../archives/udev_141-1_armel.deb) ...
Adding `local diversion of /sbin/udevadm to /sbin/udevadm.upgrade'
Unpacking replacement udev ...
Processing triggers for man-db ...
Setting up udev (141-1) ...
 * Stopping kernel event manager... [ OK ]
 * Starting kernel event manager... [ OK ]
Removing `local diversion of /sbin/udevadm to /sbin/udevadm.upgrade'
update-initramfs: deferring update (trigger activated)

Processing triggers for initramfs-tools ...
update-initramfs: Generating /boot/initrd.img-2.6.28-11-imx51
Flashing kernel... done.
Generating padded initramfs... done.
Flashing initramfs... done.

(the effects were actually visible during installation of initramfs-tools itself, but I wanted a clean test.)

Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package initramfs-tools - 0.92bubuntu28

---------------
initramfs-tools (0.92bubuntu28) jaunty; urgency=low

  * update-initramfs: copy the logic added in Debian to run flash-kernel after
    the initrd has been generated (if the system is supported by
    flash-kernel); flash-kernel is run twice, but at least the system really
    runs the latest initrd; LP: #358762.

 -- Loic Minier <email address hidden> Sat, 11 Apr 2009 00:07:04 +0200

Changed in initramfs-tools (Ubuntu Jaunty):
status: New → Fix Released
Curtis Hovey (sinzui)
Changed in initramfs-tools (Ubuntu):
assignee: Registry Administrators (registry) → nobody
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.