update-initramfs truncates initrd if MINKVER not met

Bug #101844 reported by Soren Hansen
2
Affects Status Importance Assigned to Milestone
initramfs-tools (Ubuntu)
Fix Released
High
Ben Collins

Bug Description

Binary package hint: initramfs-tools

When update-initramfs runs it creates a backup of the current initrd. If one of the hooks has a MINKVER set that's not fulfilled, update-initramfs leaves an initrd of 0 bytes and the backup. If update-initramfs runs again, it overwrites the old backup with a new backup of the 0 bytes initrd. During an edgy->feisty userland upgrade, "update-initramfs -u" is run numerous times, nuking the current initrd, rendering the system unbootable.

Attaching a fix that restores the backup. I'm not sure, though, if restore_backup should be called only if minversion isn't met, or in all cases where update-initramfs fails.

Revision history for this message
Soren Hansen (soren) wrote :
Changed in initramfs-tools:
importance: Undecided → High
Revision history for this message
Soren Hansen (soren) wrote :

Attaching output of "sh -x update-initramfs -u". Output of second run is identical.

Revision history for this message
Soren Hansen (soren) wrote :

I'm an idiot. Note to self: When running "sh -x foo" to prove a point, don't be in a directory with a fixed "foo".

Revision history for this message
Soren Hansen (soren) wrote :

Notice the extra "rm -f /boot/initrd.img-2.6.17-10-server.dpkg-bak"

Changed in initramfs-tools:
assignee: nobody → ben-collins
status: Unconfirmed → Fix Committed
Revision history for this message
Soren Hansen (soren) wrote :

Applied in Debian, and pulled in in 0.85eubuntu9.

Changed in initramfs-tools:
status: Fix Committed → Fix Released
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.