Debian: Stage subcloud install feed as /var/www/pages/iso
There is a lighttpd rule that prevents a subcloud install from accessing the system controller's feed directory for the purpose of setting up its own feed dir in prep for its own system node installs. This update enhances the kickstart.cfg file to stage the feed content for a subcloud controller-0 install. The new subcloud feed dir is /var/www/pages/iso/rel-xx.xx Test Plan: PASS: Verify /var/www/pages/iso file content for - usb install - pxe install - controller system node install PASS: Verify subcloud can install controller-1 from iso feed Regression: PASS: Verify /var/pxeboot content for - usb install - pxe install - controller system node install PASS: Verify /var/www/pages/feed file content for - usb install - pxe install - controller system node install PASS: Verify Debian DX System Install - usb install then controller-1 as system node install - pxe install then controller-1 as system node install PASS: Verify UEFI and Legacy BIOS Install Story: 2009968 Task: 46648 Signed-off-by: Eric MacDonald <eric.macdonald@windriver.com> Change-Id: Ia1511813c5673762ad386122cf9a1666e6392b30
This commit is contained in:
parent
2ae23916a8
commit
884ff2aae8
@ -2762,12 +2762,10 @@ if [ "${controller}" = true ] ; then
|
||||
pull_options="${commits} --mirror"
|
||||
pxeboot="${IMAGE_ROOTFS}/var/pxeboot"
|
||||
feed="${IMAGE_ROOTFS}/var/www/pages/feed/rel-${sw_release}"
|
||||
subcloud_feed="${IMAGE_ROOTFS}/var/www/pages/iso/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
|
||||
if is_usb_install -eq 0 ; then
|
||||
@ -2832,119 +2830,153 @@ if [ "${controller}" = true ] ; then
|
||||
|
||||
# This fetch is only needed once because the repo is stored in /var
|
||||
set_variable "ostree_repo_fetched"
|
||||
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
|
||||
if is_usb_install -eq 0 ; 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 ${feed}
|
||||
cp -a bzImage* ${pxeboot}/rel-${sw_release}
|
||||
cp -a initrd* ${pxeboot}/rel-${sw_release}
|
||||
####################################################################
|
||||
# Setup the feed and pxeboot directories
|
||||
#
|
||||
# All the feed and pxeboot setup operation are off of /var which is
|
||||
# common to normal and rollback filesystems.
|
||||
# Therefore this only needs to be done once like the ostree repo
|
||||
# pull but for a different reason.
|
||||
#
|
||||
#####################################################################
|
||||
|
||||
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
|
||||
mkdir -p "${pxeboot}/rel-${sw_release}"
|
||||
mkdir -p "${pxeboot}/EFI/BOOT"
|
||||
|
||||
mkdir -p "${feed}/pxeboot"
|
||||
mkdir -p "${feed}/kickstart"
|
||||
mkdir -p "${feed}/pxeboot/EFI/BOOT"
|
||||
|
||||
mkdir -p "${subcloud_feed}/pxeboot"
|
||||
mkdir -p "${subcloud_feed}/kickstart"
|
||||
mkdir -p "${subcloud_feed}/pxeboot/EFI/BOOT"
|
||||
|
||||
# Check for noverifyssl
|
||||
if grep -q noverifyssl /proc/cmdline; then
|
||||
NOVERIFYSSL_WGET_OPT="--no-check-certificate"
|
||||
else
|
||||
NOVERIFYSSL_WGET_OPT=""
|
||||
fi
|
||||
|
||||
# handle USB install
|
||||
if is_usb_install -eq 0 ; then
|
||||
|
||||
# populate /var/pxeboot
|
||||
ilog "Copy bzImage, initrd and respective secure boot .sig files"
|
||||
ilog "... from /instboot/pxeboot to ${pxeboot}/rel-${sw_release}"
|
||||
|
||||
cp -a /instboot/pxeboot/bzImage* ${pxeboot}/rel-${sw_release}
|
||||
cp -a /instboot/pxeboot/initrd* ${pxeboot}/rel-${sw_release}
|
||||
cp -a /instboot/efi.img ${pxeboot}
|
||||
cp -a /instboot/pxeboot/EFI ${pxeboot}
|
||||
for f in bootx64.efi bootx64-nosig.efi grub.cfg.sig grubx64.efi LockDown.efi LockDown.efi.sig mmx64.efi ; do
|
||||
cp -a /instboot/pxeboot/EFI/BOOT/${f} ${pxeboot}/EFI/BOOT
|
||||
done
|
||||
|
||||
# populate feeds
|
||||
ilog "Stage images and kickstarts from /instboot to feeds"
|
||||
for this_feed in ${feed} ${subcloud_feed} ; do
|
||||
cp -a /instboot/pxeboot/bzImage* ${this_feed}/pxeboot
|
||||
cp -a /instboot/pxeboot/initrd* ${this_feed}/pxeboot
|
||||
cp -a /instboot/efi.img ${this_feed}
|
||||
cp -a /instboot/pxeboot/EFI ${this_feed}/pxeboot
|
||||
cp -a /instboot/kickstart/kickstart.cfg ${this_feed}/kickstart
|
||||
cp -a /instboot/kickstart/miniboot.cfg ${this_feed}/kickstart
|
||||
done # feeds
|
||||
|
||||
# handle pxeboot install
|
||||
else
|
||||
pxeurl=$(echo $insturl | sed -e s/ostree_repo//)
|
||||
|
||||
# Fetch and stage the kernels, signature files and initrd
|
||||
ilog "Fetch bzImage and initrd files from ${pxeurl}/pxeboot"
|
||||
pushd ${pxeboot}/rel-${sw_release} > /dev/null
|
||||
for f in bzImage bzImage-rt bzImage-rt.sig bzImage.sig bzImage-std bzImage-std.sig initrd initrd.sig ; do
|
||||
ilog "... fetching ${f} to ${pxeboot}/rel-${sw_release}"
|
||||
|
||||
# handle pxeboot install
|
||||
else
|
||||
pxeurl=$(echo $insturl | sed -e s/ostree_repo//)
|
||||
ilog "Fetch bzImage and initrd files from ${pxeurl}/pxeboot"
|
||||
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 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}"
|
||||
# also copy to the feeds
|
||||
ilog "... copying ${f} to ${feed}/pxeboot"
|
||||
cp -a ${f} ${feed}/pxeboot
|
||||
ilog "... copying ${f} to ${subcloud_feed}/pxeboot"
|
||||
cp -a ${f} ${subcloud_feed}/pxeboot
|
||||
done
|
||||
popd > /dev/null
|
||||
|
||||
# Fetch and stage the efi.img
|
||||
ilog "Fetch efi.img from ${pxeurl} to ${pxeboot}"
|
||||
pushd ${pxeboot} > /dev/null
|
||||
for f in efi.img ; do
|
||||
ilog "... fetching ${f} to ${pxeboot}"
|
||||
|
||||
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
|
||||
# also copy to the feeds
|
||||
ilog "... copying ${f} to ${feed}"
|
||||
cp -a ${f} ${feed}
|
||||
ilog "... copying ${f} to ${subcloud_feed}"
|
||||
cp -a ${f} ${subcloud_feed}
|
||||
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
|
||||
# Fetch and stage the boot loaders
|
||||
pushd ${pxeboot}/EFI/BOOT > /dev/null
|
||||
ilog "Copy files from ${pxeurl}/pxeboot/EFI/BOOT to ${pxeboot}/EFI/BOOT"
|
||||
for f in bootx64.efi bootx64-nosig.efi grub.cfg.sig grubx64.efi LockDown.efi LockDown.efi.sig mmx64.efi; do
|
||||
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
|
||||
# also copy to the feeds
|
||||
ilog "... copying ${f} to ${feed}/pxeboot/EFI/BOOT"
|
||||
cp -a ${f} ${feed}/pxeboot/EFI/BOOT
|
||||
ilog "... copying ${f} to ${subcloud_feed}/pxeboot/EFI/BOOT"
|
||||
cp -a ${f} ${subcloud_feed}/pxeboot/EFI/BOOT
|
||||
done
|
||||
popd > /dev/null
|
||||
|
||||
# Fetch and stage the kickstarts
|
||||
ilog "Fetch kickstarts from ${pxeurl} to ${feed}/kickstart"
|
||||
pushd ${feed}/kickstart > /dev/null
|
||||
for f in kickstart.cfg miniboot.cfg ; do
|
||||
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
|
||||
|
||||
ilog "... copying ${f} to ${subcloud_feed}/kickstart"
|
||||
cp -a ${f} ${subcloud_feed}/kickstart
|
||||
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
|
||||
done
|
||||
[ -e /${LAT_DIR}/wget.tmp ] && rm -f /${LAT_DIR}/wget.tmp
|
||||
ln -s ../../pxelinux.cfg/grub.cfg
|
||||
fi
|
||||
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
|
||||
else
|
||||
# This is used by patching.
|
||||
# For non-controller system node installs (worker/storage) we need to
|
||||
|
Loading…
x
Reference in New Issue
Block a user