update-initramfs truncates initrd if MINKVER not met

Bug #101844 reported by Soren Hansen on 2007-04-02
Affects Status Importance Assigned to Milestone
initramfs-tools (Ubuntu)
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.

Soren Hansen (soren) wrote :
Changed in initramfs-tools:
importance: Undecided → High
Soren Hansen (soren) wrote :

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

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".

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
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  Edit
Everyone can see this information.

Other bug subscribers