From 45241499b487b0da212667ed04c8af3ba010a460 Mon Sep 17 00:00:00 2001 From: "Junfeng (Shawn) Li" Date: Mon, 12 Sep 2022 16:10:28 -0400 Subject: [PATCH] Update package extraction from CentOS for Debian Details: For feature parity, the upgrade-start-pkg-extract has to be updated to support upgrading to Debian 22.12 and CentOS 22.12. Preview change in this CR https://review.opendev.org/c/starlingx/update/+/850906 only runs on Debian to Debian upgrade. This change will allow the package extraction running on CentOS to Debian upgrade. Test Plan: PASS: manually tested the script on Debian PASS: manually tested the script on CentOS Task: 46269 Story: 2009303 Signed-off-by: Junfeng (Shawn) Li Change-Id: I05f9e631b0bbddcad3e9ea21000ff7f283b2f097 --- cgcs-patch/bin/upgrade-start-pkg-extract | 16 ++++++++++++++++ sw-patch/bin/upgrade-start-pkg-extract | 2 +- 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/cgcs-patch/bin/upgrade-start-pkg-extract b/cgcs-patch/bin/upgrade-start-pkg-extract index fd94bd59..5b50b70c 100644 --- a/cgcs-patch/bin/upgrade-start-pkg-extract +++ b/cgcs-patch/bin/upgrade-start-pkg-extract @@ -60,6 +60,22 @@ if [ ! -d ${TGT_BASE_REPO} ]; then exit 1 fi +# Copy files to destination folders on Debian +if [ -d "${TGT_BASE_REPO}/ostree_repo/" ]; then + rsync -ac ${TGT_BASE_REPO}/kickstart/kickstart.cfg ${TGT_BASE_REPO}/ && + rsync -ac ${TGT_BASE_REPO}/pxeboot/bzImage* /var/pxeboot/rel-${TGT_RELEASE}/ && + rsync -ac ${TGT_BASE_REPO}/pxeboot/initrd* /var/pxeboot/rel-${TGT_RELEASE}/ && + rsync -ac ${TGT_BASE_REPO}/pxeboot/pxelinux.cfg.files/*-${TGT_RELEASE} /var/pxeboot/pxelinux.cfg.files/ + rsync -ac ${TGT_BASE_REPO}/upgrades/pxeboot-update-${TGT_RELEASE}.sh /usr/sbin/ + + if [ $? -ne 0 ]; then + logger -t $0 "rsync command failed on Debian extracting" + exit 1 + fi + exit 0 +fi + +# The code below is only used on CentOS and will be removed when CentOS is no longer supported. declare TGT_PATCHES_REPO_OPT="" if [ -d ${TGT_PATCHES_REPO} ]; then TGT_PATCHES_REPO_OPT="--repofrompath updates,${TGT_PATCHES_REPO}" diff --git a/sw-patch/bin/upgrade-start-pkg-extract b/sw-patch/bin/upgrade-start-pkg-extract index 56847ec7..5b50b70c 100644 --- a/sw-patch/bin/upgrade-start-pkg-extract +++ b/sw-patch/bin/upgrade-start-pkg-extract @@ -75,7 +75,7 @@ if [ -d "${TGT_BASE_REPO}/ostree_repo/" ]; then exit 0 fi -# The code below is only used on CenOS and will be removed when CenOS is no longer supported. +# The code below is only used on CentOS and will be removed when CentOS is no longer supported. declare TGT_PATCHES_REPO_OPT="" if [ -d ${TGT_PATCHES_REPO} ]; then TGT_PATCHES_REPO_OPT="--repofrompath updates,${TGT_PATCHES_REPO}"