From: Mateusz Moscicki Date: Mon, 7 Aug 2023 09:31:22 +0000 (+0200) Subject: Remove ISU packages during major OS upgrade X-Git-Tag: accepted/tizen/unified/20230822.043319^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=c60b549cab33b1ccd3ae6b53422af7bac5b92b28;p=platform%2Fcore%2Fsystem%2Fupgrade.git Remove ISU packages during major OS upgrade If the system release name has changed, remove incompatible packages, as they may not be compatible with the new system version. Change-Id: I43663bda0f50fbdcd608cd7e65881bd644b36476 --- diff --git a/packaging/upgrade.spec b/packaging/upgrade.spec index 8a12585..527ad7a 100644 --- a/packaging/upgrade.spec +++ b/packaging/upgrade.spec @@ -3,7 +3,7 @@ Name: upgrade Summary: Upgrade support for Tizen -Version: 8.0.0 +Version: 8.0.1 Release: 0 Group: System License: Apache-2.0 diff --git a/scripts/rw-upgrade/update.sh.in b/scripts/rw-upgrade/update.sh.in index 26d965a..5d3739d 100644 --- a/scripts/rw-upgrade/update.sh.in +++ b/scripts/rw-upgrade/update.sh.in @@ -102,8 +102,17 @@ VERSION_COMPARE() { return 0 } +REMOVE_ISU_PKG() +{ + local PKG_NAME=$1 + rm -rf "/opt/isu/$PKG_NAME" +} + REMOVE_UNNECESSARY_ISU_PKGS() { + local OS_RELEASE_NAME + OS_RELEASE_NAME=$(grep TZ_BUILD_RELEASE_NAME /etc/tizen-build.conf | awk -F '"' '{print $2}') + for ISUCFG in $(find /etc/isu/ -type f -name isu.cfg); do PKG_NAME=$(basename "$(dirname "$ISUCFG")") if [ ! -d "/opt/isu/$PKG_NAME" ]; then @@ -111,13 +120,22 @@ REMOVE_UNNECESSARY_ISU_PKGS() fi CUR_IMG_VERSION=$(grep -e "^version" "/etc/isu/$PKG_NAME/isu.cfg" | awk -F "=" '{ gsub(/[ ]+/, ""); print $2}') INSTALLED_VERSION=$(grep -e "^version" "/opt/isu/$PKG_NAME/isu.cfg" | awk -F "=" '{ gsub(/[ ]+/, ""); print $2}') + ISU_RELEASE_NAME=$(grep -e "^tz_build_release_name" "/opt/isu/$PKG_NAME/isu.cfg" | awk -F "=" '{ gsub(/[ ]+/, ""); print $2}') + + if [ "$OS_RELEASE_NAME" != "$ISU_RELEASE_NAME" ]; then + # Release name of the current image and package are different. + # In that case we remove the ISU package because it may + # not be compatible with this version of the system. + REMOVE_ISU_PKG "$PKG_NAME" + continue + fi VERSION_COMPARE "$CUR_IMG_VERSION" "$INSTALLED_VERSION" if [[ $? != 2 ]]; then # Package from the current image is newer than the one installed # so we can remove the installed one - rm -rf "/opt/isu/$PKG_NAME" + REMOVE_ISU_PKG "$PKG_NAME" fi done }