From 5dfd85f416a10b1c41ca7005de38b58715c04472 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Mon, 2 Apr 2007 15:04:41 +0200 Subject: update-initramfs: restore_initramfs restore initramfs on failure path --- update-initramfs | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'update-initramfs') diff --git a/update-initramfs b/update-initramfs index a676fe9..9d2b03e 100755 --- a/update-initramfs +++ b/update-initramfs @@ -113,6 +113,15 @@ backup_booted_initramfs() rm -f ${initramfs_bak} } +# restore initramfs backup +restore_initramfs() +{ + [ -z "${initramfs_bak}" ] && return 0 + mv -f "${initramfs_bak}" "${initramfs}" + verbose "Restoring ${initramfs_bak}" +} + + generate_initramfs() { echo "update-initramfs: Generating ${initramfs}" @@ -124,6 +133,7 @@ generate_initramfs() set_sha1 else mkinitramfs_return="$?" + restore_initramfs if [ "$mkinitramfs_return" = "2" ]; then # minversion wasn't met, exit 0 exit 0 -- cgit v1.2.3