Debian KS: Setup /var/pxeboot utilities from install source

This update enhances the kickstart to populate /var/pxeboot
directory with pxeboot utilities from the install source.

This setup is required for controller function to support
pxebooting system nodes.

The addition of menu.c32 is temporary. It will be removed
once it is added to LAT.

Test Plan:

PASS: Verify /var/pxeboot setup from usb install source
PASS: Verify /var/pxeboot setup from pxeboot install source
PASS: Verify /var/.../feed/<rel> setup from pxeboot install source
PASS: Verify pxeboot of AIO controller-1 (uefi and bios)
PASS: Verify pxeboot of AIO controller-0 from controller-1
PASS: Verify lock and unlock both controllers several times
PASS: Verify swact back and forth several times
PASS: Verify system host-reinstall controller-1
PASS: Verify look and feel
PASS: Verify logging

Note: Secure boot of system node is not yet verified
      to be supported

Story: 2009301
Task: 45305
Signed-off-by: Eric MacDonald <eric.macdonald@windriver.com>
Change-Id: Ibba23eb82113e218daa60a318ec5f03c6dc4b887
This commit is contained in:
Eric MacDonald 2022-05-06 23:08:44 +00:00
parent a91e25e784
commit c18df887d8
4 changed files with 159 additions and 50 deletions

View File

@ -1 +1,2 @@
var/www/pages/feed/*
var/pxeboot/menu.c32

View File

@ -14,4 +14,6 @@ override_dh_auto_configure:
override_dh_install:
install -d -m 755 $(ROOT)/var/www/pages/feed/rel-${platform_release}
install -p -D -m 700 kickstart.cfg $(ROOT)/var/www/pages/feed/rel-${platform_release}
install -d -m 755 $(ROOT)/var/pxeboot
install -p -D -m 700 menu.c32 $(ROOT)/var/pxeboot
dh_install

View File

@ -1951,8 +1951,10 @@ else
# must be a worker or storage node install
pushd /tmp > /dev/null
fi
wget ${NOVERIFYSSL_WGET_OPT} ${pxeurl}/install_uuid -o /${LAT_DIR}/wget_install_uuid.log
[ $? -ne 0 ] && report_failure_with_msg "Failed to fetch install_uuid from pxeboot server"
if [ ! -e ./install_uuid ] ; then
wget ${NOVERIFYSSL_WGET_OPT} ${pxeurl}/install_uuid -o /${LAT_DIR}/wget_install_uuid.log
[ $? -ne 0 ] && report_failure_with_msg "Failed to fetch install_uuid from pxeboot server"
fi
if [ -e ./install_uuid ] ; then
INSTALL_UUID=$(cat install_uuid)
else
@ -1994,18 +1996,22 @@ get_variable "ostree_repo_fetched"
OSTREE_REPO_FETCHED=$?
# Fetch ostree
if [ "${controller}" = true -a ${OSTREE_REPO_FETCHED} -eq 0 ] ; then
$(is_system_node_install)
if [ $? -ne 0 ] ; then
sw_release="xxxPLATFORM_RELEASExxx"
if [ "${controller}" = true ] ; then
sw_release="xxxPLATFORM_RELEASExxx"
# -1 is all commits, positive number is that number of last commits
commits="--depth=-1"
pull_options="${commits} --mirror"
feed="${IMAGE_ROOTFS}/var/www/pages/feed/rel-${sw_release}"
repo="${feed}/ostree_repo"
mkdir -p "${repo}"
# -1 is all commits, positive number is that number of last commits
commits="--depth=-1"
pull_options="${commits} --mirror"
pxeboot="${IMAGE_ROOTFS}/var/pxeboot"
feed="${IMAGE_ROOTFS}/var/www/pages/feed/rel-${sw_release}"
repo="${feed}/ostree_repo"
mkdir -p "${repo}"
mkdir -p "${feed}"
mkdir -p "${feed}/pxeboot"
mkdir -p "${feed}/kickstart"
mkdir -p "${pxeboot}/rel-${sw_release}"
if [ ${OSTREE_REPO_FETCHED} -eq 0 ] ; then
ilog "Pull ostree_repo to ${repo}"
ostree --repo=${repo} init --mode=archive
if [ "${insturl}" = "file://NOT_SET" ] ; then
@ -2023,46 +2029,146 @@ if [ "${controller}" = true -a ${OSTREE_REPO_FETCHED} -eq 0 ] ; then
ostree --repo=/sysroot/ostree/repo remote delete ${instname}
ostree --repo=/sysroot/ostree/repo remote add ${instname} ${file_feed} ${feed_branch}
# Check for noverifyssl
if grep -q noverifyssl /proc/cmdline; then
NOVERIFYSSL_WGET_OPT="--no-check-certificate"
else
NOVERIFYSSL_WGET_OPT=""
fi
pushd ${feed}
pxeurl=$(echo $insturl | sed -e s/ostree_repo//)
if [ "${pxeurl}" = "file://NOT_SET" ] ; then
cp /instboot/bzImage .
cp /instboot/initrd .
else
# TODO: Remove ; This is temporary until the kernel and initrd are fetched from ostree_repo
wget ${NOVERIFYSSL_WGET_OPT} --spider --quiet ${pxeurl}/bzImage
[ $? -ne 0 ] && report_failure_with_msg "Failed to find bzImage on pxeboot server ; ${sw_release} ${pxeurl}"
wget ${NOVERIFYSSL_WGET_OPT} --reject 'index.html*' --quiet ${pxeurl}/bzImage
[ $? -ne 0 ] && report_failure_with_msg "Failed to get bzImage from pxeboot server ; ${sw_release} ${pxeurl}"
wget ${NOVERIFYSSL_WGET_OPT} --spider --quiet ${pxeurl}/initrd
[ $? -ne 0 ] && report_failure_with_msg "Failed to find initrd on pxeboot server ; ${sw_release} ${pxeurl}"
wget ${NOVERIFYSSL_WGET_OPT} --reject 'index.html*' --quiet ${pxeurl}/initrd
[ $? -ne 0 ] && report_failure_with_msg "Failed to get initrd from pxeboot server ; ${sw_release} ${pxeurl}"
fi
# Copy the kernel and initrd to the release based pxeboot dir
mkdir -p /var/pxeboot/${sw_release}
cp -a ${feed}/bzImage /var/pxeboot/${sw_release}
cp -a ${feed}/initrd /var/pxeboot/${sw_release}
# TODO: Not needed once the kickstart is in the iso
# Save the kickstart
cp /${LAT_DIR}/lat-installer.ks ${feed}/kickstart.cfg
# This fetch is only needed once because the repo is stored in /var
set_variable "ostree_repo_fetched"
popd
fi
# Setup the feed and pxeboot directories
# ######################################
#
# Check for noverifyssl
if grep -q noverifyssl /proc/cmdline; then
NOVERIFYSSL_WGET_OPT="--no-check-certificate"
else
NOVERIFYSSL_WGET_OPT=""
fi
# handle USB install
pxeurl=$(echo $insturl | sed -e s/ostree_repo//)
if [ "${pxeurl}" = "file://NOT_SET" ] ; then
pushd ${feed}/pxeboot > /dev/null
ilog "Copy bzImage, initrd and respective secure boot .sig files"
ilog "... from /instboot/pxeboot to ${feed}/pxeboot and ${pxeboot}/rel-${sw_release}"
cp -a /instboot/pxeboot/bzImage* .
cp -a /instboot/pxeboot/initrd* .
cp -a /instboot/efi.img .
cp -a bzImage* ${pxeboot}/rel-${sw_release}
cp -a initrd* ${pxeboot}/rel-${sw_release}
ilog "Copy pxeboot utilities from /instboot/pxeboot to ${pxeboot}"
for f in pxelinux.0 libcom32.c32 ldlinux.c32 libutil.c32 vesamenu.c32 grubx64.efi; do
cp -a /instboot/pxeboot/${f} .
cp -a /instboot/pxeboot/${f} ${pxeboot}
done
cp -a /instboot/efi.img ${pxeboot}
cp -a /instboot/pxeboot/EFI ${pxeboot}
cp -a /instboot/pxeboot/EFI ${feed}/pxeboot
cp -a /instboot/kickstart/kickstart.cfg ${feed}/kickstart
popd > /dev/null
# handle pxeboot install
else
ilog "Fetch bzImage and initrd files from ${pxeurl}/pxeboot to ${feed}/pxeboot and ${pxeboot}/rel-${sw_release}"
pushd ${feed}/pxeboot > /dev/null
for f in bzImage bzImage-rt bzImage-rt.sig bzImage.sig bzImage-std bzImage-std.sig initrd initrd.sig; do
if [ ! -e "./${f}" ] ; then
ilog "... fetching ${f} to ${feed}/pxeboot"
wget ${NOVERIFYSSL_WGET_OPT} ${pxeurl}/pxeboot/${f} -o /${LAT_DIR}/wget.tmp
[ $? -ne 0 ] && report_failure_with_msg "Failed to find ${pxeurl}/pxeboot/${f}"
cat /${LAT_DIR}/wget.tmp >> /${LAT_DIR}/wget_pxeboot_setup.log
fi
# also copy it to the /var/pxeboot release dir
if [ -e "./${f}" -a ! -e "${pxeboot}/rel-${sw_release}/${f}" ] ; then
cp ${f} ${pxeboot}/rel-${sw_release}
ilog "... copying ${f} to ${pxeboot}/rel-${sw_release}"
fi
done
popd > /dev/null
ilog "Fetch pxeboot utilities from ${pxeurl}/pxeboot to ${pxeboot}"
pushd ${feed}/pxeboot > /dev/null
for f in pxelinux.0 libcom32.c32 ldlinux.c32 libutil.c32 vesamenu.c32 grubx64.efi; do
if [ ! -e "./${f}" ] ; then
ilog "... fetching ${f} to ${feed}/pxeboot"
wget ${NOVERIFYSSL_WGET_OPT} ${pxeurl}/pxeboot/${f} -o /${LAT_DIR}/wget.tmp
[ $? -ne 0 ] && report_failure_with_msg "Failed to get ${pxeurl}/pxeboot/${f}"
cat /${LAT_DIR}/wget.tmp >> /${LAT_DIR}/wget_pxeboot_setup.log
fi
# also copy it to the /var/pxeboot directory
if [ -e "./${f}" -a ! -e "${pxeboot}/${f}" ] ; then
ilog "... copying ${f} to ${pxeboot}"
cp ${f} ${pxeboot}
fi
done
popd > /dev/null
ilog "Fetch efi.img from ${pxeurl} to ${feed}"
pushd ${feed} > /dev/null
for f in efi.img ; do
if [ ! -e "./${f}" ] ; then
ilog "... fetching ${f} to ${feed}"
wget ${NOVERIFYSSL_WGET_OPT} ${pxeurl}/${f} -o /${LAT_DIR}/wget.tmp
[ $? -ne 0 ] && report_failure_with_msg "Failed to get ${pxeurl}/${f}"
cat /${LAT_DIR}/wget.tmp >> /${LAT_DIR}/wget_pxeboot_setup.log
fi
# also copy it to the /var/pxeboot directory
if [ -e "./${f}" -a ! -e "${pxeboot}/${f}" ] ; then
ilog "... copying ${f} to ${pxeboot}"
cp ${f} ${pxeboot}
fi
done
popd > /dev/null
ilog "Fetch files from ${pxeurl}/pxeboot/EFI/BOOT to ${feed}/pxeboot/EFI/BOOT"
mkdir -p ${pxeboot}/EFI/BOOT
mkdir -p ${feed}/pxeboot/EFI/BOOT
pushd ${pxeboot}/EFI/BOOT > /dev/null
for f in bootx64.efi bootx64-nosig.efi grub.cfg.sig grubx64.efi LockDown.efi LockDown.efi.sig mmx64.efi; do
if [ ! -e "./${f}" ] ; then
ilog "... fetching ${f} to ${pxeboot}/EFI/BOOT"
wget ${NOVERIFYSSL_WGET_OPT} ${pxeurl}/pxeboot/EFI/BOOT/${f} -o /${LAT_DIR}/wget.tmp
[ $? -ne 0 ] && report_failure_with_msg "Failed to get ${pxeurl}/pxeboot/EFI/BOOT/${f}"
cat /${LAT_DIR}/wget.tmp >> /${LAT_DIR}/wget_pxeboot_setup.log
fi
if [ -e "./${f}" -a ! -e ${feed}/pxeboot/EFI/BOOT/${f} ] ; then
ilog "... copying ${f} to ${feed}/pxeboot/EFI/BOOT"
cp ${f} ${feed}/pxeboot/EFI/BOOT
fi
done
popd > /dev/null
ilog "Fetch kickstarts from ${pxeurl} to ${feed}/kickstart"
pushd ${feed}/kickstart > /dev/null
for f in kickstart.cfg ; do
if [ ! -e ${f} ] ; then
ilog "... fetching ${f} to ${feed}/kickstart"
wget ${NOVERIFYSSL_WGET_OPT} ${pxeurl}/kickstart/${f} -o /${LAT_DIR}/wget.tmp
[ $? -ne 0 ] && report_failure_with_msg "Failed to get ${pxeurl}/kickstart/${f}"
cat /${LAT_DIR}/wget.tmp >> /${LAT_DIR}/wget_pxeboot_setup.log
fi
done
[ -e /${LAT_DIR}/wget.tmp ] && rm -f /${LAT_DIR}/wget.tmp
popd > /dev/null
fi
# Temporary WorkAround: The current UEFI pxeboot loader does not call the
# default provisioning grub menu in /var/pxeboot/pxelinux.cfg/grub.cfg.
#
# While the above issue is investigated, to support DX and system node
# install for UEFI servers this code moves the lat grub.cfg aside and
# creates a link to the default provisioning mac based grub menu.
pushd ${pxeboot}/EFI/BOOT > /dev/null
if [ ! -L grub.cfg ] ; then
if [ -e grub.cfg ] ; then
mv grub.cfg grub.cfg.lat
fi
ln -s ../../pxelinux.cfg/grub.cfg
fi
popd > /dev/null
fi
# Save the install scripts and kickstart logs
@ -2071,9 +2177,9 @@ if [ ${?} -ne 0 ] ; then
elog "Failed to mount /dev/mapper/cgts--vg-log--lv"
else
if [ -e "${IMAGE_ROOTFS}/${LOG_DIR}" ]; then
ilog "Saving installer data to /${LOG_DIR}"
cp -a /${LAT_DIR} ${IMAGE_ROOTFS}/${LOG_DIR}
cp /install ${IMAGE_ROOTFS}/${LOG_DIR}/lat
ilog "Saved installer data to ${IMAGE_ROOTFS}/${LOG_DIR}"
else
wlog "Could not save installer data"
fi

BIN
kickstart/files/menu.c32 Normal file

Binary file not shown.