Copy pxeboot template to feed during kickstart

This commit change to copy pxeboot template files from install directory
(/var/pxeboot/pxelinux.cfg.files/) to feed repo. The install directory
is always available.

This change removes the dependency to the installation source. The
pxeboot template files are directly copied from local install directory.

Test plan:
    passed: installed both controllers in standard load. observed that
            the template files exist at directory
               /var/www/pages/feed/rel-24.09/pxeboot/pxelinux.cfg.files/
    passed: installed both controllers in AIO load. Observed that the
            template files exist at directory
               /var/www/pages/feed/rel-24.09/pxeboot/pxelinux.cfg.files/
    passed: installed SX from pxeboot server, observed template files
            exist at directory
               /var/www/pages/feed/rel-24.09/pxeboot/pxelinux.cfg.files/

Task: 51482
Story: 2010676

Change-Id: I7b16c9fdf11269dbdbda32fbd634c89063eb644e
Signed-off-by: Bin Qian <bin.qian@windriver.com>
This commit is contained in:
Bin Qian 2025-01-02 17:37:07 +00:00
parent 2337299893
commit 3423e2efff

View File

@ -3028,6 +3028,7 @@ if [ "${controller}" = true ] ; then
commits="--depth=-1"
pull_options="${commits} --mirror"
pxeboot="${IMAGE_ROOTFS}/var/pxeboot"
pxe_config="${IMAGE_ROOTFS}/var/pxeboot/pxelinux.cfg.files/"
feed="${IMAGE_ROOTFS}/var/www/pages/feed/rel-${sw_release}"
repo="${feed}/ostree_repo"
config_file="${repo}/config"
@ -3120,27 +3121,11 @@ if [ "${controller}" = true ] ; then
mkdir -p ${feed}/pxeboot/pxelinux.cfg.files
# handle USB install
if is_usb_install -eq 0 ; then
ilog "Copying pxelinux.cfg.files for USB install"
cp -a ${pxeboot}/pxelinux.cfg.files/* ${feed}/pxeboot/pxelinux.cfg.files
else
ilog "Fetching pxelinux.cfg.files for pxeboot install"
feed_remote_url=$(echo ${insturl} | sed -e 's/ostree_repo/pxeboot\/pxelinux\.cfg\.files\//g')
cd ${feed}/pxeboot/pxelinux.cfg.files
wget ${NOVERIFYSSL_WGET_OPT} -q --spider ${feed_remote_url}
if [ $? -eq 0 ]; then
ilog "Fetching pxelinux template files from ${feed_remote_url}"
wget ${NOVERIFYSSL_WGET_OPT} -r -np -nH --cut-dirs=4 -R "index.html*" ${feed_remote_url} \
-o /${LAT_DIR}/wget_pxelinux_files.log
# Configure the file permissions for PXE and EFI files
find . -type f \( -name "pxe*" -o -name "efi*" \) -exec chmod 755 {} +
ilog "pxelinux.cfg.files fetch completed"
else
report_failure_with_msg "Failed to get pxeboot template files from ${feed_remote_url}"
fi
fi
ilog "Copy ${pxe_config}/efi-pxe* to ${feed}/pxeboot/pxelinux.cfg.files/ ..."
cp -a ${pxe_config}/efi-pxe* ${feed}/pxeboot/pxelinux.cfg.files/
ilog "Copy ${pxe_config}/pxe* to ${feed}/pxeboot/pxelinux.cfg.files/ ..."
cp -a ${pxe_config}/pxe* ${feed}/pxeboot/pxelinux.cfg.files/
ilog "pxelinux.cfg.files fetch completed"
####################################################################
# Fetch and add efi.img to /var/pxeboot