metal/bsp-files/kickstarts/post_net_controller.cfg
Don Penney 7c756f7ff3 Kickstart updates to resolve prepatching issues
The prepatching feature changed how kickstarts are delivered. Where
before, they were generated as part of build-iso and copied during
installation, they are now delivered in packages. However, when the
controller kickstart mirrors the feed directory from the active
controller after installation, it may overwrite these installed files.
This update changes the wget command options to protect against this.

In addition, testing with an RT kernel patch showed Anaconda was also
installing the mlnx-ofa_kernel-rt-modules package from the patching
repo on a standard note, as it attempts to resolve a packaging
requirement. This update also adds explicit exclusions to the package
lists in the standard and lowlatency kickstarts to avoid installing
rt modules on the standard nodes, and vice versa.

Change-Id: I56b22fb0846db05a96004184c1060c05566d5363
Signed-off-by: Don Penney <don.penney@windriver.com>
2018-06-27 13:21:50 -04:00

80 lines
3.0 KiB
INI

%post --erroronfail
# Source common functions
. /tmp/ks-functions.sh
# Retrieve the installation uuid from the controller we booted from
INSTALL_UUID=`curl -sf http://pxecontroller/feed/rel-xxxPLATFORM_RELEASExxx/install_uuid`
if [ $? -ne 0 ]
then
INSTALL_UUID=unknown
fi
grep -q INSTALL_UUID /etc/platform/platform.conf
if [ $? -ne 0 ]; then
echo "INSTALL_UUID=$INSTALL_UUID" >> /etc/platform/platform.conf
fi
cd /www/pages
# Sync software repository
feed_url=http://pxecontroller/feed/
anaconda_logdir=/var/log/anaconda
mkdir -p $anaconda_logdir
echo "Mirroring software repository (may take several minutes)..." >/dev/console
wget --recursive --no-parent --no-host-directories --no-clobber --reject 'index.html*' --reject '*.log' $feed_url/ -o $anaconda_logdir/wget-feed-mirror.log \
|| report_post_failure_with_logfile $anaconda_logdir/wget-feed-mirror.log
# Sync patching repository
updates_url=http://pxecontroller/updates/
wget --mirror --no-parent --no-host-directories --reject 'index.html*' --reject '*.log' $updates_url/ -o $anaconda_logdir/wget-updates-mirror.log \
|| report_post_failure_with_logfile $anaconda_logdir/wget-updates-mirror.log
echo "Done" >/dev/console
shopt -s nullglob
# Check whether a second release is installed
. /etc/build.info
CURRENT_REL_DIR=rel-${SW_VERSION}
OTHER_REL_DIR=
for REL_DIR in /www/pages/feed/*; do
if [[ ! $REL_DIR =~ "${SW_VERSION}" ]]; then
OTHER_REL_DIR=`basename $REL_DIR`
OTHER_REL_VERSION=${OTHER_REL_DIR:4}
break
fi
done
# If second release is installed, find the latest version of the installer
# RPM and install the pxeboot files we require to boot hosts with that release.
if [ ! -z "$OTHER_REL_DIR" ]; then
PATCH_RPM=`find /www/pages/updates/${OTHER_REL_DIR}/Packages -name 'pxe-network-installer*' | sort -V | tail -1`
BASE_RPM=`find /www/pages/feed/${OTHER_REL_DIR}/Packages -name 'pxe-network-installer*' | sort -V | tail -1`
if [ ! -z "$PATCH_RPM" ]; then
INSTALL_RPM=$PATCH_RPM
elif [ ! -z "$BASE_RPM" ]; then
INSTALL_RPM=$BASE_RPM
else
report_post_failure_with_msg "ERROR: Unable to find pxe-network-installer RPM for $OTHER_REL_DIR. Aborting installation."
fi
echo "Installing pxeboot files for release $OTHER_REL_DIR from $INSTALL_RPM" >/dev/console
TMP_RPM=/tmp/pxe-network-installer
mkdir $TMP_RPM
pushd $TMP_RPM
/usr/bin/rpm2cpio $INSTALL_RPM | cpio -idm \
|| report_post_failure_with_msg "Failed to extract pxe-network-installer"
cp -r $TMP_RPM/usr / \
|| report_post_failure_with_msg "Failed to copy pxe-network-installer /usr"
cp -r $TMP_RPM/pxeboot/$OTHER_REL_DIR /pxeboot/ \
|| report_post_failure_with_msg "Failed to copy pxe-network-installer /pxeboot/$OTHER_REL_DIR"
cp $TMP_RPM/pxeboot/pxelinux.cfg.files/*-$OTHER_REL_VERSION /pxeboot/pxelinux.cfg.files/ \
|| report_post_failure_with_msg "Failed to copy pxe-network-installer pxelinux.cfg files"
rm -rf $TMP_RPM
fi
%end