Package: initramfs-tools
Severity: wishlist
Version: 0.91e
User: [EMAIL PROTECTED]
Usertags: origin-ubuntu ubuntu-patch hardy ubuntu

Attached is a patch to improve the way update-initramfs handles the generating 
of new or updated initramfs images for kernels. It puts in place a few measures 
to ensure that if there is not enough disk space on /boot, a previous initramfs 
is still in tact, to allow the booting of that kernel. The patch applies 
against current git head. See the Ubuntu specification found at the following 
URL for more information: 
https://wiki.ubuntu.com/HardyInitramfsErrorHandling
diff -urN initramfs-tools/update-initramfs initramfs-tools.new/update-initramfs
--- initramfs-tools/update-initramfs	2008-02-26 11:04:36.943676705 +1100
+++ initramfs-tools.new/update-initramfs	2008-02-26 11:01:00.555676705 +1100
@@ -87,7 +87,7 @@
 	[ ! -r "${initramfs}" ] && return 0
 	initramfs_bak="${initramfs}.dpkg-bak"
 	[ -r "${initramfs_bak}" ] && rm -f "${initramfs_bak}"
-	ln -f "${initramfs}" "${initramfs_bak}"
+	mv -f "${initramfs}" "${initramfs_bak}"
 	verbose "Keeping ${initramfs_bak}"
 }
 
@@ -131,7 +131,7 @@
 {
 	[ -z "${initramfs_bak}" ] && return 0
 	verbose "Restoring ${initramfs_bak}"
-	rm -f "${initramfs_bak}"
+	mv -f "${initramfs_bak}" "${initramfs}"
 }
 
 
@@ -142,8 +142,7 @@
 	if [ "${verbose}" = 1 ]; then
 		OPTS="-v ${OPTS}"
 	fi
-	if mkinitramfs ${OPTS} "${initramfs}.new" "${version}"; then
-		mv -f "${initramfs}.new" "${initramfs}"
+	if mkinitramfs ${OPTS} "${initramfs}" "${version}"; then
 		set_sha1
 	else
 		mkinitramfs_return="$?"

Attachment: signature.asc
Description: Digital signature

Reply via email to