[Bug 922340] [NEW] update-initramfs (latest update) always fails during kernel install

Launchpad Bug Tracker 922340 at bugs.launchpad.net
Sat Feb 25 21:36:42 UTC 2012


You have been subscribed to a public bug:

ONEIRIC XUbuntu

During a large batch of upgrades, I found a persistent failure to do the
kernel update.  The error message stated that the post-install script
returned an error 127 from update-initramfs, at or near line 1010.

Investigating the script, I find the only command in the vicinity is a "rm -f ${initramfs}.new" . 
But the problem appears to be that the return code ( $? ) is tested BEFORE calling the command.  

The "diff -U6" output below shows both the way it was, and the way
(IMNSHO) it should be.  If the $? was intended to capture the result of
some previous command, I would strongly suggest capturing it immediately
after that command.

<code language="patch">
@@ -170,15 +170,16 @@
 		OPTS="-v ${OPTS}"
 	fi
 	if mkinitramfs ${OPTS} "${initramfs}.new" "${version}"; then
 		mv -f "${initramfs}.new" "${initramfs}"
 		set_sha1
 	else
-		mkinitramfs_return="$?"
+#### <superbiskit> 2012-01-24: capture return AFTER remove
 		remove_initramfs_bak
-		rm -f "${initramfs}.new"
+		mkinitramfs_return="$?"
+		rm -fv "${initramfs}.new"
 		if [ "$mkinitramfs_return" = "2" ]; then
 			# minversion wasn't met, exit 0
 			exit 0
 		fi
 		echo "update-initramfs: failed for ${initramfs} with $mkinitramfs_return." >&2
 		exit $mkinitramfs_return

//
</code>

** Affects: initramfs-tools (Ubuntu)
     Importance: Undecided
         Status: New


** Tags: initramfs oneiric
-- 
update-initramfs (latest update) always fails during kernel install
https://bugs.launchpad.net/bugs/922340
You received this bug notification because you are a member of Ubuntu Foundations Bugs, which is subscribed to initramfs-tools in Ubuntu.




More information about the foundations-bugs mailing list