summaryrefslogtreecommitdiff
path: root/update-initramfs
diff options
context:
space:
mode:
authormaximilian attems <maks@debian.org>2007-04-02 15:04:41 +0200
committermaximilian attems <maks@debian.org>2007-04-02 15:04:41 +0200
commit5dfd85f416a10b1c41ca7005de38b58715c04472 (patch)
treea4ef1abd85d5ff0e941e960c635429a84f5e4ed0 /update-initramfs
parentc4343742b3bf028e467ac8a58ead95c9bfefc628 (diff)
downloadinitramfs-tools-5dfd85f416a10b1c41ca7005de38b58715c04472.tar.gz
initramfs-tools-5dfd85f416a10b1c41ca7005de38b58715c04472.zip
update-initramfs: restore_initramfs
restore initramfs on failure path
Diffstat (limited to 'update-initramfs')
-rwxr-xr-xupdate-initramfs10
1 files changed, 10 insertions, 0 deletions
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