From 0fad58b3891f5eeae689f78d9facd4d70e3aa339 Mon Sep 17 00:00:00 2001 From: Josef 'Jeff' Sipek Date: Thu, 18 Jan 2018 21:48:31 -0500 Subject: [PATCH] create_ramdisk: remove old boot archive hash file first It ss better to have a boot archive without a hash (and be bootable), than one with a hash for its predecessor (and not be bootable). --- usr/src/cmd/boot/scripts/create_ramdisk.ksh | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/usr/src/cmd/boot/scripts/create_ramdisk.ksh b/usr/src/cmd/boot/scripts/create_ramdisk.ksh index 1ffba8c9c9..2c79262985 100644 --- a/usr/src/cmd/boot/scripts/create_ramdisk.ksh +++ b/usr/src/cmd/boot/scripts/create_ramdisk.ksh @@ -163,8 +163,10 @@ function create_archive echo "update of $archive failed" ERROR=1 else - mv "${archive}-new" "$archive" + # remove the hash first, it's better to have a boot archive + # without a hash, than one with a hash for its predecessor rm -f "$archive.hash" + mv "${archive}-new" "$archive" mv "$archive.hash-new" "$archive.hash" 2> /dev/null fi } @@ -180,6 +182,9 @@ function duplicate_archive ERROR=1 rm "$dst-new" else + # remove the hash first, it's better to have a boot archive + # without a hash, than one with a hash for its predecessor + rm -f "$dst.hash" mv "$dst-new" "$dst" mv "$dst.hash-new" "$dst.hash" fi -- 2.11.4.GIT