Copying the package_checksums file to

<platform_release>_packages_list.txt

The prestaging operation on the system controller requires the list
of packages and their checksums in a file named
"<platform_release>_packages_list.txt", where <software_version> is
the version of the system controller (i.e. the new version which the
subclouds are being upgraded to).

The list of packages and their checksums is obtained from different
sources as a file named "package_checksums". This file should be
copied to /usr/local/share/pkg-list as
<platform_release>_packages_list.txt. It is currently copied as
package_checksums.

This fix copies the file "package_checksums" to
/usr/local/share/pkg-list as <platform_release>_packages_list.txt.

Test Plan:

PASS: Verify that package_checksums is copied to
      /usr/local/share/pkg-list as <platform_release>_packages_list.txt
      when upgrading the system controller to a higher version.

PASS: Verify that package_checksums is copied to
      /usr/local/share/pkg-list as <platform_release>_packages_list.txt
      when installing a controller over pxeboot

PASS: Verify that package_checksums is copied to
      /usr/local/share/pkg-list as <platform_release>_packages_list.txt
      when adding a subcloud from the system controller (using dcmanager
      add)

PASS: Verify that package_checksums is copied to
      /usr/local/share/pkg-list as <platform_release>_packages_list.txt
      when installing a system controller in virtualbox from
      bootimage.iso.

Closes-Bug: 1978420
Signed-off-by: Shrikumar Sharma <shrikumar.sharma@windriver.com>
Change-Id: I6270a7c9169718b2096a83135eeadb634d37b76b
This commit is contained in:
Shrikumar Sharma 2022-06-12 18:39:36 -04:00
parent f1694be26d
commit f31cd0b255
5 changed files with 30 additions and 19 deletions

View File

@ -501,8 +501,8 @@ fi
# copy the package_checksums file to /usr/local/share/pkg-list
INSTALL_MOUNT=/mnt/install/repo
PKG_FILE=package_checksums
# at the target directory, this file is called "packages_list"
DEST_PKG_FILE=packages_list
# at the target directory, this file is called "<release_id>_packages_list.txt"
DEST_PKG_FILE="xxxPLATFORM_RELEASExxx_packages_list.txt"
PKG_FILE_LOC=/usr/local/share/pkg-list
pkg_url=xxxHTTP_URLxxx
@ -532,7 +532,7 @@ else
# the file does not exist because the install is not happening
# from a bootimage.iso.
# so get it from the system controller.
wlog "${KS} downloading packages_list from the system controller"
wlog "${KS} downloading ${DEST_PKG_FILE} from the system controller"
wget ${NOVERIFYSSL_WGET_OPT} ${pkg_url}/${DEST_PKG_FILE} \
-O ${PKG_FILE_LOC}/${DEST_PKG_FILE} \
-o $anaconda_logdir/${PKG_FILE}.log \
@ -540,7 +540,8 @@ else
fi
# cp the package_checksum files to the feed directory
cp ${PKG_FILE_LOC}/${DEST_PKG_FILE} ${FEED_DIR}
wlog "${KS} copying ${PKG_FILE_LOC}/${DEST_PKG_FILE} to ${FEED_DIR}/${PKG_FILE}"
cp ${PKG_FILE_LOC}/${DEST_PKG_FILE} ${FEED_DIR}/${PKG_FILE}
# If the path to $FEED_DIR does not exist then proceed to create it and
# fetch the ISO content in pieces from the system controller:

View File

@ -23,15 +23,16 @@ anaconda_logdir=/var/log/anaconda
mkdir -p $anaconda_logdir
pkg_file_loc=/usr/local/share/pkg-list
pkg_file=packages_list
cksum_file="package_checksums"
pkg_file="xxxPLATFORM_RELEASExxx_packages_list.txt"
FEED_DIR=/var/www/pages/feed/rel-xxxPLATFORM_RELEASExxx
if [ ! -f ${pkg_file_loc} ]; then
mkdir -p ${pkg_file_loc}
fi
echo "Retrieving package_checksums and writing to packages_list" >/dev/console
curl ${feed_url}/rel-xxxPLATFORM_RELEASExxx/${pkg_file} \
echo "Retrieving ${cksum_file} and writing to ${pkg_file_loc}/${pkg_file}" >/dev/console
curl ${feed_url}/rel-xxxPLATFORM_RELEASExxx/${cksum_file} \
-o ${pkg_file_loc}/${pkg_file}
# If the feed directory does not exist, create it now.
@ -39,7 +40,8 @@ curl ${feed_url}/rel-xxxPLATFORM_RELEASExxx/${pkg_file} \
if [ ! -d ${FEED_DIR} ]; then
mkdir -p ${FEED_DIR}
fi
cp ${pkg_file_loc}/${pkg_file} ${FEED_DIR}
echo "Copying ${pkg_file_loc}/${pkg_file} to ${FEED_DIR}/${cksum_file}"
cp ${pkg_file_loc}/${pkg_file} ${FEED_DIR}/${cksum_file}
echo "Mirroring software repository (may take several minutes)..." >/dev/console

View File

@ -98,20 +98,21 @@ declare -i cut_dirs=NUM_DIRS
if [ mountpoint -q /mnt/sysimage ]; then
wlog "${KS} Downloading package_checksums from controller"
pkg_file=packages_list
cksum_file="package_checksums"
pkg_file="xxxPLATFORM_RELEASExxx_packages_list.txt"
pkg_file_loc=/mnt/sysimage/usr/local/share/pkg-list
if [ ! -d ${pkg_file_loc} ]; then
mkdir -p ${pkg_file_loc}
fi
wlog "${KS} Downloading from ${feed_url} to ${pkg_file_loc}/${pkg_file}"
wlog "${KS} Downloading ${cksum_file} from ${feed_url} to ${pkg_file_loc}/${pkg_file}"
wget ${NOVERIFYSSL_WGET_OPT} -O ${pkg_file_loc}/${pkg_file} ${feed_url}/${pkg_file} \
-o $anaconda_logdir/${pkg_file}.log \
|| wlog "${KS} Failed to download packages_list from controller"
|| wlog "${KS} Failed to download packages list from controller"
wlog "${KS} Copying ${pkg_file_loc}/${pkg_file} to ${FEED_DIR}"
cp ${pkg_file_loc}/${pkg_file} ${FEED_DIR}
wlog "${KS} Copying ${pkg_file_loc}/${pkg_file} to ${FEED_DIR}/${cksum_file}"
cp ${pkg_file_loc}/${pkg_file} ${FEED_DIR}/${cksum_file}
fi
echo "Mirroring software repository (may take several minutes)..." >/dev/console

View File

@ -64,7 +64,10 @@ else
srcdir=/run/install/repo
fi
cksum_file="package_checksums"
pkg_dir=/mnt/sysimage/usr/local/share/pkg-list
pkg_list_file="xxxPLATFORM_RELEASExxx_packages_list.txt"
feed_dir=/mnt/sysimage/var/www/pages/feed/rel-xxxPLATFORM_RELEASExxx/
if [ ! mountpoint -q /mnt/sysimage ]; then
wlog "${KS} /mnt/sysimage not mounted. The installation will fail."
@ -75,9 +78,13 @@ if [ ! -d ${pkg_dir} ]; then
mkdir -p ${pkg_dir}
fi
if [ -f ${srcdir}/package_checksums ]; then
cp ${srcdir}/package_checksums ${pkg_dir}/packages_list
cp ${srcdir}/package_checksums /mnt/sysimage/var/www/pages/feed/rel-xxxPLATFORM_RELEASExxx/packages_list
# Copy the package checksums to both the feed_dir as well as /usr/local/share/pkg-list
if [ -f ${srcdir}/${cksum_file} ]; then
wlog "${KS} copying ${srcdir}/${cksum_file} to ${pkg_dir}/${pkg_list_file}"
cp ${srcdir}/${cksum_file} ${pkg_dir}/${pkg_list_file}
wlog "${KS} copying ${srcdir}/${cksum_file} to ${feed_dir}/${cksum_file}"
cp ${srcdir}/${cksum_file} ${feed_dir}/${cksum_file}
fi
if [ -d $srcdir/Packages ] ; then

View File

@ -64,16 +64,16 @@ fi
# copy package checksum if it exists
PKG_FILE=package_checksums
PKG_FILE="package_checksums"
PKG_FILE_LOC=/usr/local/share/pkg-list
if [ -f ${ISO_DIR}/${PKG_FILE} ]; then
DEST_PKG_FILE=packages_list
DEST_PKG_FILE="${VERSION}_packages_list.txt"
if [ ! -d ${PKG_FILE_LOC} ]; then
mkdir -p ${PKG_FILE_LOC}
fi
cp ${ISO_DIR}/${PKG_FILE} ${PKG_FILE_LOC}/${DEST_PKG_FILE}
cp ${ISO_DIR}/${PKG_FILE} ${FEED_DIR}/${DEST_PKG_FILE}
cp ${ISO_DIR}/${PKG_FILE} ${FEED_DIR}/${PKG_FILE}
fi