From 56e64b3c07e3b8fc34ab7b4f38b441efb3f9c694 Mon Sep 17 00:00:00 2001 From: Christopher Clark Date: Thu, 24 Sep 2009 12:46:59 -0700 Subject: [PATCH] XC-364: Fix 'upgrade' for 'file' type objects Delete the old file type prior to doing the upgrade. Probably breaks the notion of doing a revert-to-prior version, unfortunately. --- .../install/stages/Upgrade | 4 ++-- .../install/stages/functions | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/target/generic/target_xenclient_installer_skeleton/install/stages/Upgrade b/target/generic/target_xenclient_installer_skeleton/install/stages/Upgrade index 460151e..835fdda 100755 --- a/target/generic/target_xenclient_installer_skeleton/install/stages/Upgrade +++ b/target/generic/target_xenclient_installer_skeleton/install/stages/Upgrade @@ -52,7 +52,7 @@ do_cmd lvrename "${NEW_ROOT_DEV}" "${ROOT_DEV}" >&2 || exit ${Abort} mixedgauge "Upgrading..." 75 do_cmd sync >&2 || exit ${Abort} -upgrade_iovm() +upgrade_iovm_and_files() { case "${COMPONENT}" in iovm) @@ -69,7 +69,7 @@ upgrade_iovm() ;; esac } -iterate_over_packages upgrade_iovm +iterate_over_packages upgrade_iovm_and_files GRUB_ACTIVE_PARTITION="hd0,1" XC_PARTITION=$( pvdisplay -c | awk -F: '{ if ( $2 == "xenclient" ) print $1; }' ) diff --git a/target/generic/target_xenclient_installer_skeleton/install/stages/functions b/target/generic/target_xenclient_installer_skeleton/install/stages/functions index 3364531..580f531 100644 --- a/target/generic/target_xenclient_installer_skeleton/install/stages/functions +++ b/target/generic/target_xenclient_installer_skeleton/install/stages/functions @@ -378,6 +378,7 @@ install_file() do_cmd mount /dev/xenclient/storage /mnt/xenclient/storage >&2 || file_unwind || return 1 mkdir -p $(dirname "/mnt/xenclient/${DST}") || file_unwind || return 1 + rm -f "/mnt/xenclient/${DST}" 2>/dev/null # ignore errors on this command. cp "${SRC}" "/mnt/xenclient/${DST}" || file_unwind || return 1 file_unwind -- 2.39.5