Support Redfish subcloud install with single packages fetch
This update modifies the miniboot kickstart so rpm Packages repodata and patches are fetched from the system controller only once during a Redfish subcloud install. The existing packages mirror operation done in the %post phase is moved to the %pre phase. However, since the in-service feed dir does not exist at that time, the fetched content is staged to /mnt/install/repo as /mnt/install/repo/Packages /mnt/install/repo/repodata /mnt/install/repo/patches The %post phase fetch code that was moved is replaced with code that positions the %pre fetched content to the local filesystem here: # feed directory /var/www/pages/feed/rel-xx.xx/Packages /var/www/pages/feed/rel-xx.xx/repodata # updates directory /var/www/pages/updates/rel-xx.xx/Packages /var/www/pages/updates/rel-xx.xx/repodata # patching directory /opt/patching/packages /opt/patching/metadata The miniboot kickstart is updated with a detailed description of the various staging/prestaging install options along with logging enhancements that show the source and destination flow of packages, repodata and patches in the installation process. Also modified kickstart to ensure that Prestaged Content takes precedence over prestaged ISO. Both of which take precedence over Staged Install. Moved Prestaged content check to %pre stage som that the next priority install option can be taken rather than a belated install failure. Test Plan PASS: Verify single packages pull over subcloud controller-0 install PASS: Verify with both UEFI and BIOS across various servers PASS: Verify end-to-end subcloud installs (60+) Packages PASS: Verify install time is shorter PASS: Compare feed directory before/after install PASS: Compare package/repodata data transfer before/after install Patch Handling PASS: Compare patched content before/after installed subcloud PASS: Verify patched updates are mirrored and auto applied PASS: Verify patches can be applied and remove after install PASS: Verify patch handling for both prestaged iso committed patches as well as non-committed patches. PASS: Verify patch handling when installing subclouds from a system controller that has committed patches for all 3 install cases. Failure Handling PASS: Verify staging feed failure leads to installation failure ; parity behavior PASS: Verify handling of failed lighttpd during packages download PASS: Verify report_post_failure change handling Robustness PASS: Verify install to wiped disk PASS: Verify reinstall of same controller PASS: Verify expected lighttpd traffic logs PASS: Verify success path logs PASS: Verify install case logs show the install source/destination PASS: Verify failure path error handling and messages Prestaging Cases: PASS: Verify prestaged ISO end-to-end install (25+) PASS: Verify Prestaged Content install is priority 1 PASS: Verify Prestaged ISO install is priority 2 PASS: Verify Staged install is priority 3 PASS: Verify cascade of priority handling due to errors PASS: Verify patches fetch from SC for Prestaged content install PASS: Verify patches fetch from SC for Prestaged ISO install PASS: Verify Prestaged Content Install with and without valid and invalid prestaged images PASS: Verify Prestaged ISO install with and without prestaged valid and invalid prestaged images PASS: Verify Prestaged ISO check failure leads to Prestaged Content Install PASS: Verify Prestaged ISO check failure leads to Staged Install with incomplete prestaged content PASS: Verify Prestaged ISO check failure leads to Staged install if prestaged repodata or Packages dir is not present or empty Change-Id: I54ff9f7570d77efbb860904094adc5b6b8a3bf8d Closes-Bug: 1971157 Signed-off-by: emacdona <eric.macdonald@windriver.com>
This commit is contained in:
parent
87ada3e5a0
commit
1a6fd50e2c
@ -57,7 +57,9 @@ Installation failed.
|
||||
\$msg
|
||||
|
||||
EOF
|
||||
echo "\$msg" >/etc/platform/installation_failed
|
||||
if [ -d /etc/platform ] ; then
|
||||
echo "\$msg" >/etc/platform/installation_failed
|
||||
fi
|
||||
|
||||
echo -e '\n\nInstallation failed.\n'
|
||||
echo "\$msg"
|
||||
@ -74,7 +76,9 @@ Installation failed.
|
||||
Please see \$logfile for details of failure
|
||||
|
||||
EOF
|
||||
echo \$logfile >/etc/platform/installation_failed
|
||||
if [ -d /etc/platform ] ; then
|
||||
echo \$logfile >/etc/platform/installation_failed
|
||||
fi
|
||||
|
||||
echo -e '\n\nInstallation failed.\n'
|
||||
cat \$logfile
|
||||
|
@ -1,5 +1,54 @@
|
||||
%pre --erroronfail
|
||||
|
||||
############################################################################
|
||||
#
|
||||
# This miniboot kickstart tells Anaconda to install the subcloud
|
||||
# from one of the following repo sources listed in order of priority.
|
||||
#
|
||||
# 1. Prestaged Content ; Packages and repodata (highest priority)
|
||||
#
|
||||
# prestaged source ... /opt/platform-backup/rel-xx.xx/Packages
|
||||
# prestaged source ... /opt/platform-backup/rel-xx.xx/repodata
|
||||
# prestaged source ... xxxHTTP_URLxxx/patches
|
||||
#
|
||||
# Anaconda install ... /opt/platform-backup/rel-xx.xx
|
||||
#
|
||||
# 2. Prestaged ISO image
|
||||
#
|
||||
# prestaged source ... /opt/platform-backup/rel-xx.xx/bootimage.iso
|
||||
# prestaged check ... /opt/platform-backup/rel-xx.xx/bootimage.md5
|
||||
# prestaged source ... xxxHTTP_URLxxx/patches
|
||||
#
|
||||
# Anaconda install ... /mnt/bootimage
|
||||
#
|
||||
# 3. Staged feeds after %pre fetch from System Controller (lowest priority)
|
||||
#
|
||||
# stage source wget xxxHTTP_URLxxx/Packages -> /mnt/install/repo/Packages
|
||||
# stage source wget xxxHTTP_URLxxx/repodata -> /mnt/install/repo/repodata
|
||||
# stage source wget xxxHTTP_URLxxx/patches -> /mnt/install/repo/patches
|
||||
#
|
||||
# Anaconda install ... /mnt/install/repo/
|
||||
#
|
||||
# All of the above methods must mirror the system controller's feed,
|
||||
# updates and patching repos from the staged or prestaged source.
|
||||
#
|
||||
# feed .... for installing system nodes /var/www/pages/feed/rel-xx.xx
|
||||
#
|
||||
# updates ... for managing updates /var/www/pages/updates
|
||||
#
|
||||
# patching .. for managing patches /opt/patching/commit
|
||||
# /opt/patching/available
|
||||
# /opt/patching/applied
|
||||
#
|
||||
# Miniboot checks and reports on found prestaged container images or
|
||||
# other files with md5 checks present. Miniboot leaves them to be
|
||||
# utilized by software.
|
||||
#
|
||||
# prestaged container images ... /opt/platform-backup/rel-xx.xx/image#
|
||||
# prestaged image checks ... /opt/platform-backup/rel-xx.xx/image#.md5
|
||||
#
|
||||
############################################################################
|
||||
|
||||
# Source common functions
|
||||
. /tmp/ks-functions.sh
|
||||
|
||||
@ -9,11 +58,15 @@ BACKUP_PART_LABEL=Platform\\x20Backup
|
||||
BACKUP_DEVICE=/dev/disk/by-partlabel/${BACKUP_PART_LABEL}
|
||||
BACKUP_MOUNT=/mnt/${STAGING_DIR}
|
||||
BOOTIMAGE_ISO=""
|
||||
|
||||
# Staging and Prestaging Directories
|
||||
INSTALL_MOUNT=/mnt/install/repo
|
||||
BOOTIMAGE_MOUNT=/mnt/bootimage
|
||||
PRESTAGE_DIR=${BACKUP_MOUNT}/${SW_VERSION}
|
||||
|
||||
KS="Miniboot pre:"
|
||||
|
||||
wlog "${KS} local install check"
|
||||
wlog "${KS} Local Install check"
|
||||
|
||||
iso_check=false
|
||||
iso_mount=false
|
||||
@ -109,7 +162,7 @@ if [ -e ${BACKUP_DEVICE} ]; then
|
||||
wlog "${KS} no prestaged files"
|
||||
fi
|
||||
else
|
||||
wlog "${KS} Error: ${BACKUP_MOUNT} not mounted"
|
||||
wlog "${KS} ${BACKUP_MOUNT} not mounted"
|
||||
fi
|
||||
else
|
||||
wlog "${KS} mount of ${BACKUP_DEVICE} to ${BACKUP_MOUNT} failed rc:$rc"
|
||||
@ -120,18 +173,36 @@ fi
|
||||
|
||||
if [ "${iso_check}" = true -a "${iso_mount}" = true ] ; then
|
||||
wlog "${KS} Local Install ready"
|
||||
fi
|
||||
|
||||
if [ "${iso_mount}" = false ] ; then
|
||||
wlog "${KS} Prestage ISO is not available"
|
||||
elif [ "${iso_mount}" = false ] ; then
|
||||
wlog "${KS} Prestaged ISO not present or invalid"
|
||||
fi
|
||||
|
||||
# Make sure the prestage directory exists, as well as the required subdirectories.
|
||||
exists_prestage=false
|
||||
if [ ! -e ${PRESTAGE_DIR} ] || [ ! -e ${PRESTAGE_DIR}/Packages ] || [ ! -e ${PRESTAGE_DIR}/repodata ]; then
|
||||
exists_prestage=false
|
||||
wlog "${KS} Prestaged content not present"
|
||||
else
|
||||
exists_prestage=true
|
||||
repodata_files_count=$(ls ${PRESTAGE_DIR}/repodata | wc -l)
|
||||
if [ ${repodata_files_count} -ne 0 ]; then
|
||||
packages_files_count=$(ls ${PRESTAGE_DIR}/Packages | wc -l)
|
||||
if [ ${packages_files_count} -ne 0 ] ; then
|
||||
exists_prestage=true
|
||||
wlog "${KS} Prestaged content present"
|
||||
# unmount iso image if mounted
|
||||
if [ -d ${BOOTIMAGE_MOUNT} ]; then
|
||||
wlog "${KS} Unmounting ${BOOTIMAGE_MOUNT} for prestaged content install"
|
||||
umount ${BOOTIMAGE_MOUNT}
|
||||
rmdir ${BOOTIMAGE_MOUNT}
|
||||
else
|
||||
wlog "${KS} ${BOOTIMAGE_MOUNT} dir does not exist"
|
||||
fi
|
||||
else
|
||||
wlog "${KS} Prestaged Content is invalid ; no Package files present"
|
||||
fi
|
||||
else
|
||||
wlog "${KS} Prestaged Content is invalid ; no repodata files present ${repodata_files_count}"
|
||||
fi
|
||||
fi
|
||||
|
||||
#
|
||||
@ -139,28 +210,98 @@ fi
|
||||
# Lower cost has higher priority ; making local install preferred.
|
||||
#
|
||||
# If ${BOOTIMAGE_MOUNT} exists then install from local iso - Local Install
|
||||
# Otherwise, they are fetched from platform backup if the Packages have been
|
||||
# Otherwise, they are fetched from platform backup if the Packages have been
|
||||
# prestaged.
|
||||
# If this fails, they are fetched from the System Controller - Remote Install
|
||||
#
|
||||
if [ "${exists_prestage}" = true ]; then
|
||||
wlog "${KS} Prestage directory found: ${PRESTAGE_DIR}"
|
||||
cat << EOF > /tmp/repo-include
|
||||
repo --name=local-base --cost=100 --baseurl=file://${BOOTIMAGE_MOUNT}/
|
||||
repo --name=local-updates --cost=100 --baseurl=file://${BOOTIMAGE_MOUNT}/patches/
|
||||
repo --name=local-base --cost=200 --baseurl=file://${PRESTAGE_DIR}/
|
||||
repo --name=local-updates --cost=200 --baseurl=file://${PRESTAGE_DIR}/patches/
|
||||
repo --name=remote-base --cost=300 --baseurl=xxxHTTP_URLxxx/
|
||||
repo --name=remote-updates --cost=300 --baseurl=xxxHTTP_URLxxx/patches/
|
||||
repo --name=local-base --cost=100 --baseurl=file://${PRESTAGE_DIR}/
|
||||
repo --name=local-updates --cost=100 --baseurl=file://${PRESTAGE_DIR}/patches/
|
||||
repo --name=remote-base --cost=200 --baseurl=xxxHTTP_URLxxx/
|
||||
repo --name=remote-updates --cost=200 --baseurl=xxxHTTP_URLxxx/patches/
|
||||
EOF
|
||||
else
|
||||
wlog "${KS} Packages will either be retrieved from prestage iso or downloaded"
|
||||
elif [ "${iso_check}" = true -a "${iso_mount}" = true ] ; then
|
||||
wlog "${KS} Packages will be retrieved from prestage iso"
|
||||
cat << EOF > /tmp/repo-include
|
||||
repo --name=local-base --cost=100 --baseurl=file://${BOOTIMAGE_MOUNT}/
|
||||
repo --name=local-updates --cost=100 --baseurl=file://${BOOTIMAGE_MOUNT}/patches/
|
||||
repo --name=remote-base --cost=200 --baseurl=xxxHTTP_URLxxx/
|
||||
repo --name=remote-updates --cost=200 --baseurl=xxxHTTP_URLxxx/patches/
|
||||
EOF
|
||||
else
|
||||
# Mirror remote software repositories
|
||||
wlog "${KS} Staging Repo"
|
||||
|
||||
# Check for inst.noverifyssl
|
||||
if grep -q inst.noverifyssl /proc/cmdline; then
|
||||
NOVERIFYSSL_WGET_OPT="--no-check-certificate"
|
||||
else
|
||||
NOVERIFYSSL_WGET_OPT=""
|
||||
fi
|
||||
|
||||
declare -i cut_dirs=NUM_DIRS
|
||||
cd "${INSTALL_MOUNT}"
|
||||
mkdir -p logs
|
||||
mkdir -p Packages
|
||||
mkdir -p repodata
|
||||
feed_url=xxxHTTP_URLxxx
|
||||
|
||||
# Fetch Packages
|
||||
wlog "${KS} Staged Install packages fetch from $feed_url/Packages"
|
||||
wget ${NOVERIFYSSL_WGET_OPT} --mirror --no-parent --no-host-directories --reject 'index.html*' --reject '*.log' \
|
||||
--cut-dirs=$cut_dirs ${feed_url}/Packages/ -o ${INSTALL_MOUNT}/logs/rpmget.log \
|
||||
|| report_pre_failure_with_msg "Failed to fetch Packages ; see ${INSTALL_MOUNT}/logs/rpmget.log"
|
||||
wlog "${KS} Staged Packages to ${INSTALL_MOUNT}/Packages complete"
|
||||
|
||||
# Fetch Repodata
|
||||
wlog "${KS} Staged Install repodata fetch from $feed_url/repodata"
|
||||
wget ${NOVERIFYSSL_WGET_OPT} --mirror --no-parent --no-host-directories --reject 'index.html*' --reject '*.log' \
|
||||
--cut-dirs=$cut_dirs ${feed_url}/repodata/ -o ${INSTALL_MOUNT}/logs/rpmget_repo.log \
|
||||
|| report_pre_failure_with_msg "Failed to fetch repodata ; see ${INSTALL_MOUNT}/logs/rpmget_repo.log"
|
||||
wlog "${KS} Staged repodata to ${INSTALL_MOUNT}/repodata complete"
|
||||
|
||||
# Fetch Patch Package Data quietly
|
||||
# - Patch Packages
|
||||
# - Patches repodata
|
||||
# - Patches metadata
|
||||
# - Save all patch packages to /opt/patching/packages/xxxPLATFORM_RELEASExxx
|
||||
patches_url=xxxHTTP_URLxxx/patches
|
||||
wget ${NOVERIFYSSL_WGET_OPT} -q --spider ${patches_url}/
|
||||
if [ $? -eq 0 ]; then
|
||||
wlog "${KS} Staged Install patch repository from $patches_url to ${INSTALL_MOUNT}/patches"
|
||||
mkdir -p ${INSTALL_MOUNT}/patches/Packages
|
||||
mkdir -p ${INSTALL_MOUNT}/patches/repodata
|
||||
cd ${INSTALL_MOUNT}/patches
|
||||
declare -i patches_cut_dirs=$((cut_dirs+1))
|
||||
|
||||
wlog "${KS} Staged Install fetch patch Packages from $patches_url/Packages"
|
||||
wget ${NOVERIFYSSL_WGET_OPT} --mirror --no-parent --no-host-directories --reject 'index.html*' \
|
||||
--cut-dirs=$patches_cut_dirs $patches_url/Packages/ -o ${INSTALL_MOUNT}/logs/patches_rpmget.log \
|
||||
|| report_post_failure_with_logfile ${INSTALL_MOUNT}/logs/patches_rpmget.log
|
||||
|
||||
wlog "${KS} Staged Install fetch patch repodata from $patches_url/repodata"
|
||||
wget ${NOVERIFYSSL_WGET_OPT} --mirror --no-parent --no-host-directories --reject 'index.html*' \
|
||||
--cut-dirs=$patches_cut_dirs $patches_url/repodata/ -o ${INSTALL_MOUNT}/logs/patches_rpmget_repo.log \
|
||||
|| report_post_failure_with_logfile ${INSTALL_MOUNT}/logs/patches_rpmget_repo.log
|
||||
|
||||
wlog "${KS} Staged Install fetch patch metadata from $patches_url/metadata"
|
||||
wget ${NOVERIFYSSL_WGET_OPT} --mirror --no-parent --no-host-directories --reject 'index.html*' \
|
||||
--cut-dirs=$patches_cut_dirs $patches_url/metadata/ -o ${INSTALL_MOUNT}/logs/patches_rpmget_metadata.log \
|
||||
|| report_post_failure_with_logfile ${INSTALL_MOUNT}/logs/patches_rpmget_metadata.log
|
||||
|
||||
wlog "${KS} Staged patches to ${INSTALL_MOUNT}/patches complete"
|
||||
else
|
||||
wlog "${KS} get from patches url '$patches_url' failed"
|
||||
fi
|
||||
|
||||
cat << EOF > /tmp/repo-include
|
||||
repo --name=local-base --cost=100 --baseurl=file://${INSTALL_MOUNT}/
|
||||
repo --name=local-updates --cost=100 --baseurl=file://${INSTALL_MOUNT}/patches/
|
||||
repo --name=remote-base --cost=200 --baseurl=xxxHTTP_URLxxx/
|
||||
repo --name=remote-updates --cost=200 --baseurl=xxxHTTP_URLxxx/patches/
|
||||
EOF
|
||||
fi
|
||||
%end
|
||||
|
||||
@ -210,6 +351,7 @@ EOF
|
||||
. /tmp/ks-functions.sh
|
||||
|
||||
# Mirror local software repositories
|
||||
INSTALL_MOUNT=/mnt/install/repo
|
||||
SYSIMAGE_MOUNT=/mnt/sysimage
|
||||
FEED_DIR=${SYSIMAGE_MOUNT}/var/www/pages/feed/rel-xxxPLATFORM_RELEASExxx
|
||||
UPDATES_DIR=${SYSIMAGE_MOUNT}/var/www/pages/updates/rel-xxxPLATFORM_RELEASExxx
|
||||
@ -218,139 +360,83 @@ PACKAGES_DIR=${PATCHING_DIR}/packages/xxxPLATFORM_RELEASExxx/
|
||||
|
||||
KS="Miniboot post:"
|
||||
|
||||
if [ -d ${SYSIMAGE_MOUNT} ] ; then
|
||||
files="$(ls -lrt ${SYSIMAGE_MOUNT})"
|
||||
wlog "${KS} ${SYSIMAGE_MOUNT} files : $files[@]"
|
||||
if [ -d ${FEED_DIR} ] ; then
|
||||
files=$(ls -lrt ${FEED_MOUNT})
|
||||
wlog "${KS} $FEED_DIR files : $files[@]"
|
||||
else
|
||||
wlog "${KS} error : feed dir '$FEED_DIR' does not exist"
|
||||
fi
|
||||
|
||||
# Check updates Dir
|
||||
if [ -d ${UPDATES_DIR} ] ; then
|
||||
files=$(ls -lrt ${UPDATES_DIR})
|
||||
wlog "${KS} $UPDATES_DIR files : $files[@]"
|
||||
else
|
||||
wlog "${KS} $UPDATES_DIR does not exist"
|
||||
fi
|
||||
|
||||
# Check Packages Dir
|
||||
if [ -d ${PATCHING_DIR} ] ; then
|
||||
files=$(ls -lrt ${PATCHING_DIR})
|
||||
wlog "${KS} $PATCHING_DIR files : $files[@]"
|
||||
|
||||
if [ -d ${PATCHING_DIR}/metadata ] ; then
|
||||
files=$(ls -lrt ${PATCHING_DIR}/metadata)
|
||||
wlog "${KS} $PATCHING_DIR/metadata files : $files[@]"
|
||||
|
||||
if [ -d ${PATCHING_DIR}/metadata/applied ] ; then
|
||||
files=$(ls -lrt ${PATCHING_DIR}/metadata/applied)
|
||||
wlog "${KS} $PATCHING_DIR/metadata/applied files : $files[@]"
|
||||
else
|
||||
wlog "${KS} $PATCHING_DIR/metadata/applied does not exist"
|
||||
fi
|
||||
if [ -d ${PATCHING_DIR}/metadata/available ] ; then
|
||||
files=$(ls -lrt ${PATCHING_DIR}/metadata/available)
|
||||
wlog "${KS} $PATCHING_DIR/metadata/available files : $files[@]"
|
||||
else
|
||||
wlog "${KS} $PATCHING_DIR/metadata/available does not exist"
|
||||
fi
|
||||
else
|
||||
wlog "${KS} $PATCHING_DIR/metadata does not exist"
|
||||
fi
|
||||
else
|
||||
wlog "${KS} $PATCHING_DIR does not exist"
|
||||
fi
|
||||
|
||||
# Check Packages Dir
|
||||
if [ -d ${PACKAGES_DIR} ] ; then
|
||||
files=$(ls -lrt ${PACKAGES_DIR})
|
||||
wlog "${KS} $PACKAGES_DIR files : $files[@]"
|
||||
else
|
||||
wlog "${KS} $PACKAGES_DIR does not exist"
|
||||
fi
|
||||
wlog "${KS} end of sysimage_mount ${SYSIMAGE_MOUNT}"
|
||||
else
|
||||
wlog "${KS} Error : $SYSIMAGE_MOUNT does not exists or is not a directory"
|
||||
fi
|
||||
|
||||
|
||||
# # Handle 3 prestaging conditions
|
||||
#
|
||||
# 1. Full local install ; iso present in platform-backup/rel
|
||||
# 2. Prioritized install ; use prestaged content and fetch what's missing remotely
|
||||
# 3. Full remote install ; no prestaging content in platform-backup/rel
|
||||
if [ -d /mnt/bootimage ]; then
|
||||
wlog "${KS} /mnt/bootimage"
|
||||
srcdir=/mnt/bootimage
|
||||
elif [ -d /mnt/platform-backup/xxxPLATFORM_RELEASExxx ] ; then
|
||||
wlog "${KS} looking for packages in /mnt/platform_backup"
|
||||
srcdir=/mnt/platform-backup/xxxPLATFORM_RELEASExxx
|
||||
else
|
||||
# Remote System Controller
|
||||
wlog "${KS} /mnt/install/source"
|
||||
srcdir=/mnt/install/source
|
||||
fi
|
||||
|
||||
need_packages=false
|
||||
need_patches=false
|
||||
|
||||
# Handle 3 prestaging conditions
|
||||
#
|
||||
# 1. Full local install ; iso present in platform-backup/rel
|
||||
# 2. Prioritized install ; use prestaged content fetch what's missing remotely
|
||||
# 3. Staged install ; no prestaging content
|
||||
if [ -d /mnt/bootimage ]; then
|
||||
srcdir=/mnt/bootimage
|
||||
# Always need to fetch patches for Prestaged ISO install.
|
||||
# It is not sufficient to only get committed patches from the ISO,
|
||||
# There may also be non-committed patches applied to the system
|
||||
# controller that are needed as well.
|
||||
# Setting need_patches to true for the ISO install handles both commited
|
||||
# and non-committed patch cases.
|
||||
need_patches=true
|
||||
wlog "${KS} Local Install from $srcdir"
|
||||
elif [ -d ${INSTALL_MOUNT}/Packages ] ; then
|
||||
srcdir=${INSTALL_MOUNT}
|
||||
wlog "${KS} Staged Install from $srcdir"
|
||||
else
|
||||
srcdir=/mnt/platform-backup/xxxPLATFORM_RELEASExxx
|
||||
wlog "${KS} looking for packages in ${srcdir}"
|
||||
fi
|
||||
|
||||
# prepare to boot other hosts by mirroring sw repository
|
||||
if [ -d $srcdir/Packages ] ; then
|
||||
wlog "${KS} copying software repository $srcdir/Packages"
|
||||
wlog "${KS} copying software repository $srcdir/Packages and $srcdir/repodata"
|
||||
mkdir -p ${FEED_DIR}
|
||||
packagefilecount=$(ls ${srcdir}/Packages | wc -l)
|
||||
if [ ${packagefilecount} = 0 ]; then
|
||||
wlog "${KS} ${srcdir}/Packages is empty. Fetching remotely"
|
||||
need_packages=true
|
||||
else
|
||||
cp -r $srcdir/Packages ${FEED_DIR}/Packages
|
||||
if [ -d $srcdir/repodata ] ; then
|
||||
repodatafilecount=$(ls ${srcdir}/repodata | wc -l)
|
||||
if [ ${repodatafilecount} = 0 ]; then
|
||||
wlog "${KS} ${srcdir}/repodata is empty.Fetching remotely"
|
||||
need_packages=true
|
||||
else
|
||||
cp -r $srcdir/repodata ${FEED_DIR}/repodata
|
||||
fi
|
||||
if [ -d $srcdir/repodata ] ; then
|
||||
repodatafilecount=$(ls ${srcdir}/repodata | wc -l)
|
||||
if [ ${repodatafilecount} = 0 ]; then
|
||||
report_post_failure_with_msg "$srcdir/repodata files not found."
|
||||
else
|
||||
wlog "${KS} $srcdir/repodata dir does not exist. Fetching remotely"
|
||||
need_packages=true
|
||||
wlog "${KS} copying repodata from $srcdir/repodata to ${FEED_DIR}/repodata"
|
||||
cp -r $srcdir/repodata ${FEED_DIR}/repodata
|
||||
fi
|
||||
else
|
||||
report_post_failure_with_msg "$srcdir/repodata not found."
|
||||
fi
|
||||
packagesfilecount=$(ls ${srcdir}/Packages | wc -l)
|
||||
if [ ${packagesfilecount} = 0 ]; then
|
||||
report_post_failure_with_msg "$srcdir/Packages files not found."
|
||||
else
|
||||
wlog "${KS} copying packages from $srcdir/Packages to ${FEED_DIR}/Packages"
|
||||
cp -r $srcdir/Packages ${FEED_DIR}/Packages
|
||||
fi
|
||||
else
|
||||
wlog "${KS} $srcdir/Packages not found. Fetching remotely"
|
||||
need_packages=true
|
||||
report_post_failure_with_msg "$srcdir/Packages not found."
|
||||
fi
|
||||
|
||||
if [ -d $srcdir/patches ]; then
|
||||
if [ -d $srcdir/patches/Packages ] ; then
|
||||
wlog "${KS} copying patch Packages $srcdir/patches/Packages"
|
||||
wlog "${KS} copying patch Packages from $srcdir/patches/Packages to ${UPDATES_DIR}/Packages"
|
||||
mkdir -p ${UPDATES_DIR}
|
||||
cp -r $srcdir/patches/Packages ${UPDATES_DIR}/Packages
|
||||
else
|
||||
wlog "${KS} $srcdir/patches/Packages does not exist. Fetching remotely"
|
||||
wlog "${KS} $srcdir/patches/Packages doesn't exist. Fetching remotely"
|
||||
need_patches=true
|
||||
fi
|
||||
|
||||
if [ -d $srcdir/patches/repodata ] ; then
|
||||
wlog "${KS} copying patch repository $srcdir/patches/repodata"
|
||||
wlog "${KS} copying patch repodata from $srcdir/patches/repodata to ${UPDATES_DIR}/repodata"
|
||||
mkdir -p ${UPDATES_DIR}
|
||||
cp -r $srcdir/patches/repodata ${UPDATES_DIR}/repodata
|
||||
else
|
||||
wlog "${KS} $srcdir/patches/repodata does not exist. Fetching remotely"
|
||||
wlog "${KS} $srcdir/patches/repodata doesn't exist. Fetching remotely"
|
||||
need_patches=true
|
||||
fi
|
||||
else
|
||||
wlog "${KS} $srcdir/patches does not exist. Fetching remotely"
|
||||
wlog "${KS} $srcdir/patches doesn't exist. Fetching remotely"
|
||||
need_patches=true
|
||||
fi
|
||||
|
||||
if [ -d $srcdir/patches/metadata -a "${need_patches}" = false ] ; then
|
||||
mkdir -p ${PATCHING_DIR}
|
||||
wlog "${KS} copying $srcdir/patches/metadata to ${PATCHING_DIR}"
|
||||
wlog "${KS} copying patch metadata from $srcdir/patches/metadata to ${PATCHING_DIR}/metadata"
|
||||
cp -r $srcdir/patches/metadata ${PATCHING_DIR}/metadata
|
||||
else
|
||||
wlog "${KS} $srcdir/patches/metadata doesn't exist. Fetching remotely"
|
||||
@ -359,7 +445,7 @@ fi
|
||||
|
||||
if [ -d $srcdir/patches -a "${need_patches}" = false ]; then
|
||||
mkdir -p ${PACKAGES_DIR}
|
||||
wlog "${KS} copying packages"
|
||||
wlog "${KS} copying packages from ${UPDATES_DIR}/Packages to ${PACKAGES_DIR}"
|
||||
find ${UPDATES_DIR}/Packages -name '*.rpm' \
|
||||
| xargs --no-run-if-empty -I files cp --preserve=all files ${PACKAGES_DIR}
|
||||
else
|
||||
@ -367,14 +453,17 @@ else
|
||||
need_patches=true
|
||||
fi
|
||||
|
||||
if [ "${need_packages}" = true ]; then
|
||||
echo > ${SYSIMAGE_MOUNT}/tmp/needpackages
|
||||
if [ "${srcdir}" = "${INSTALL_MOUNT}" ] ; then
|
||||
|
||||
# save the pre stage anaconda logs
|
||||
mkdir -p ${SYSIMAGE_MOUNT}/var/log/anaconda
|
||||
cp -a ${INSTALL_MOUNT}/logs/* ${SYSIMAGE_MOUNT}/var/log/anaconda
|
||||
fi
|
||||
|
||||
if [ "${need_patches}" = true ]; then
|
||||
echo > ${SYSIMAGE_MOUNT}/tmp/needpatches
|
||||
fi
|
||||
|
||||
true
|
||||
%end
|
||||
|
||||
|
||||
@ -412,18 +501,8 @@ fi
|
||||
FEED_DIR=/var/www/pages/feed/rel-xxxPLATFORM_RELEASExxx
|
||||
declare -i cut_dirs=NUM_DIRS
|
||||
|
||||
declare need_packages=
|
||||
declare need_patches=
|
||||
|
||||
if [ -f /tmp/needpackages ]; then
|
||||
wlog "${KS} Packages need to be downloaded"
|
||||
need_packages=true
|
||||
rm /tmp/needpackages
|
||||
else
|
||||
need_packages=false
|
||||
fi
|
||||
|
||||
|
||||
if [ -f /tmp/needpatches ]; then
|
||||
wlog "${KS} patches need to be downloaded"
|
||||
need_patches=true
|
||||
@ -432,34 +511,6 @@ else
|
||||
need_patches=false
|
||||
fi
|
||||
|
||||
if ( [ ! -d "${FEED_DIR}/Packages" ] || [ ! -d "${FEED_DIR}/repodata" ] ) && [ "${need_packages}" = true ]; then
|
||||
mkdir -p "${FEED_DIR}/Packages"
|
||||
mkdir -p "${FEED_DIR}/repodata"
|
||||
cd "${FEED_DIR}"
|
||||
feed_url=xxxHTTP_URLxxx
|
||||
|
||||
wlog "${KS} Remote Install"
|
||||
|
||||
wlog "${KS} downloading software repository $feed_url"
|
||||
|
||||
# Fetch Packages
|
||||
wget ${NOVERIFYSSL_WGET_OPT} --mirror --no-parent --no-host-directories --reject 'index.html*' \
|
||||
--cut-dirs=$cut_dirs $feed_url/Packages/ -o $anaconda_logdir/rpmget.log \
|
||||
|| report_post_failure_with_logfile $anaconda_logdir/rpmget.log
|
||||
|
||||
wlog "${KS} download of $feed_url/Packages/ complete"
|
||||
|
||||
# Fetch Repodata. In the case of "${need_packages} = yes", it is better to fetch
|
||||
# both the Packages as well as the repodata (since repodata is correlated with the Packages)
|
||||
wget ${NOVERIFYSSL_WGET_OPT} --mirror --no-parent --no-host-directories --reject 'index.html*' \
|
||||
--cut-dirs=$cut_dirs $feed_url/repodata/ -o $anaconda_logdir/rpmget_repo.log \
|
||||
|| report_post_failure_with_logfile $anaconda_logdir/rpmget_repo.log
|
||||
|
||||
wlog "${KS} download of $feed_url/repodata/ complete"
|
||||
else
|
||||
wlog "${KS} Local Install"
|
||||
fi
|
||||
|
||||
# Fetch Patch Package Data quietly
|
||||
# - Patch Packages
|
||||
# - Patches repodata
|
||||
@ -474,13 +525,14 @@ if [ $? -eq 0 ] && [ "${need_patches}" = true ]; then
|
||||
mkdir -p updates/rel-xxxPLATFORM_RELEASExxx/repodata
|
||||
cd updates/rel-xxxPLATFORM_RELEASExxx
|
||||
declare -i patches_cut_dirs=$((cut_dirs+1))
|
||||
this_dir=$(pwd)
|
||||
|
||||
wlog "${KS} fetch packages"
|
||||
wlog "${KS} fetch patch packages from $patches_url/Packages to ${this_dir}"
|
||||
wget ${NOVERIFYSSL_WGET_OPT} --mirror --no-parent --no-host-directories --reject 'index.html*' \
|
||||
--cut-dirs=$patches_cut_dirs $patches_url/Packages/ -o $anaconda_logdir/patches_rpmget.log \
|
||||
|| report_post_failure_with_logfile $anaconda_logdir/patches_rpmget.log
|
||||
|
||||
wlog "${KS} fetch package repodata"
|
||||
wlog "${KS} fetch patch repodata from $patches_url/repodata to ${this_dir}"
|
||||
wget ${NOVERIFYSSL_WGET_OPT} --mirror --no-parent --no-host-directories --reject 'index.html*' \
|
||||
--cut-dirs=$patches_cut_dirs $patches_url/repodata/ -o $anaconda_logdir/patches_rpmget_repo.log \
|
||||
|| report_post_failure_with_logfile $anaconda_logdir/patches_rpmget_repo.log
|
||||
@ -489,16 +541,16 @@ if [ $? -eq 0 ] && [ "${need_patches}" = true ]; then
|
||||
mkdir -p /opt/patching/packages/xxxPLATFORM_RELEASExxx
|
||||
cd /opt/patching
|
||||
|
||||
wlog "${KS} fetch patch metadata"
|
||||
wlog "${KS} fetch patch metadata from $patches_url/metadata to /opt/patching/metadata"
|
||||
wget ${NOVERIFYSSL_WGET_OPT} --mirror --no-parent --no-host-directories --reject 'index.html*' \
|
||||
--cut-dirs=$patches_cut_dirs $patches_url/metadata/ -o $anaconda_logdir/patches_rpmget_metadata.log \
|
||||
|| report_post_failure_with_logfile $anaconda_logdir/patches_rpmget_metadata.log
|
||||
|
||||
wlog "${KS} save a copy of all patch packages, preserve attributes"
|
||||
wlog "${KS} save a copy of all patch packages to /opt/patching/packages/xxxPLATFORM_RELEASExxx ; preserve attributes"
|
||||
find /var/www/pages/updates/rel-xxxPLATFORM_RELEASExxx/Packages -name '*.rpm' \
|
||||
| xargs --no-run-if-empty -I files cp --preserve=all files /opt/patching/packages/xxxPLATFORM_RELEASExxx/
|
||||
else
|
||||
wlog "${KS} Patches are not required to be downloaded"
|
||||
wlog "${KS} Patches are not required to be downloaded in post phase"
|
||||
fi
|
||||
|
||||
%end
|
||||
|
Loading…
Reference in New Issue
Block a user