Merge "Debian: Modify kickstart to implement single OSTREE pull"

This commit is contained in:
Zuul 2022-08-05 12:54:32 +00:00 committed by Gerrit Code Review
commit bfe663f2f5
1 changed files with 77 additions and 6 deletions

View File

@ -1484,6 +1484,75 @@ udevadm settle --timeout=300 || report_failure_with_msg "udevadm settle failed"
# Rescan LVM cache to avoid warnings for VGs that were recreated.
pvscan --cache 2>/dev/null
# Stage the ostree_repo in /sysroot for network installations
# of controller nodes. Doing so avoids a double ostree pull of
# the huge ostree_repo over the network.
if is_usb_install -eq 0 ; then
ilog "USB Install"
else
ilog "Network Install"
##################################################################
#
# System node installs of worker and storage nodes are installed
# over the network rather than from a staged archive.
# This is because these node types do not have/need a local feed.
#
##################################################################
if [ "${controller}" = true ] ; then
ilog "Controller Install"
##############################################################
#
# Controller node network installs pull the ostree_repo from
# the pxeboot server's feed directory in 'archive' mode into
# /sysroot as a local staging location. In this case LAT's
# INSTL (install) variable is updated to install from that
# local stage.
#
# This is done to avoid a second (double) ostree_repo pull
# over the network that would otherwise be needed to populate
# the controller's feed directory.
#
# This staged ostree_repo archive is later moved to the
# controller's feed directory to be used for future installs
# of other system nodes from this controller.
#
##############################################################
PHYS_SYSROOT="/sysroot"
OSTREE_ROOT_DEVICE="LABEL=otaroot"
mkdir -p ${PHYS_SYSROOT}
mount -o rw,noatime "${OSTREE_ROOT_DEVICE}" "${PHYS_SYSROOT}" || elog "Error mounting ${OSTREE_ROOT_DEVICE}"
repo="${PHYS_SYSROOT}/var/www/pages/feed/rel-xxxPLATFORM_RELEASExxx/ostree_repo"
mkdir -p "${repo}"
# Tell LAT to install friom this local stage
# i.e. override where LAT installs from.
export instl=${repo}
export INSTL=${instl}
ostree --repo=${repo} init --mode=archive
if [ "${insturl}" = "file://NOT_SET" ] ; then
ilog "ostree_repo archive pull from file:///instboot/ostree_repo"
ostree --repo=${repo} remote add ${instbr} file:///instboot/ostree_repo
else
ilog "ostree_repo archive pull from ${insturl}"
ostree --repo=${repo} remote add ${instbr} ${insturl}
fi
ostree --repo=${repo} pull --depth=-1 --mirror ${instbr}:${instbr}
umount ${PHYS_SYSROOT}
fi
fi
true
%end
@ -2112,14 +2181,16 @@ if [ "${controller}" = true ] ; then
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
if is_usb_install -eq 0 ; then
ilog "Stage ostree_repo from USB device to ${repo}"
ostree --repo=${repo} init --mode=archive
ostree --repo=${repo} remote add ${instbr} file:///instboot/ostree_repo
ostree --repo=${repo} pull ${pull_options} ${instbr}:${instbr}
else
ostree --repo=${repo} remote add ${instbr} ${insturl}
ilog "Stage ostree_repo from previous /sysroot pull to ${repo}"
mv -f /sysroot/var/www/pages/feed/rel-${sw_release}/ostree_repo ${IMAGE_ROOTFS}/var/www/pages/feed/rel-${sw_release}/
fi
ostree --repo=${repo} pull ${pull_options} ${instbr}:${instbr}
# This is used by patching.
# Set ostree remote to the local install feed
@ -2168,7 +2239,7 @@ if [ "${controller}" = true ] ; then
# handle pxeboot install
else
pxeurl=$(echo $insturl | sed -e s/ostree_repo//)
ilog "Fetch bzImage and initrd files from ${pxeurl}/pxeboot to ${feed}/pxeboot and ${pxeboot}/rel-${sw_release}"
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