From 005544b651ef6cf6c16103398ad5bf76c0c004c8 Mon Sep 17 00:00:00 2001 From: Bin Qian Date: Wed, 12 Jul 2023 17:42:55 +0000 Subject: [PATCH] support import previous compatible load Add support for importing load with import.sh from the current load. This enables to always import load with higher version import.sh (in the case of load-import --inactive) TCs: passed: from system controller running 23.09 load, import 22.12 load passed: regression import N+1 load Story: 2010611 Task: 48371 Change-Id: I4aec6eaa89019d4852979c27a708e409f32e27b0 Signed-off-by: Bin Qian --- bsp-files/upgrades/import.sh | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/bsp-files/upgrades/import.sh b/bsp-files/upgrades/import.sh index c95f055f..4939102b 100644 --- a/bsp-files/upgrades/import.sh +++ b/bsp-files/upgrades/import.sh @@ -32,10 +32,17 @@ error() { trap 'error ${LINENO} $?' ERR -SCRIPT_DIR=$(dirname $0) -ISO_DIR=$(dirname $SCRIPT_DIR) +if [ -n "$1" ]; then + # mount point of the ISO to be imported. + # This is to import inactive load (an older load) + ISO_DIR=$1 + UPGRADES_DIR="${ISO_DIR}/upgrades" +else + UPGRADES_DIR=$(dirname $0) + ISO_DIR=$(dirname ${UPGRADES_DIR}) +fi -source $SCRIPT_DIR/version +source ${UPGRADES_DIR}/version source /etc/build.info FEED_DIR=/var/www/pages/feed/rel-${VERSION}