Merge "Debian: Modify kickstart to implement single OSTREE pull"
This commit is contained in:
commit
bfe663f2f5
@ -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.
|
# Rescan LVM cache to avoid warnings for VGs that were recreated.
|
||||||
pvscan --cache 2>/dev/null
|
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
|
true
|
||||||
%end
|
%end
|
||||||
|
|
||||||
@ -2112,14 +2181,16 @@ if [ "${controller}" = true ] ; then
|
|||||||
mkdir -p "${pxeboot}/rel-${sw_release}"
|
mkdir -p "${pxeboot}/rel-${sw_release}"
|
||||||
|
|
||||||
if [ ${OSTREE_REPO_FETCHED} -eq 0 ] ; then
|
if [ ${OSTREE_REPO_FETCHED} -eq 0 ] ; then
|
||||||
ilog "Pull ostree_repo to ${repo}"
|
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} init --mode=archive
|
||||||
if [ "${insturl}" = "file://NOT_SET" ] ; then
|
|
||||||
ostree --repo=${repo} remote add ${instbr} file:///instboot/ostree_repo
|
ostree --repo=${repo} remote add ${instbr} file:///instboot/ostree_repo
|
||||||
else
|
|
||||||
ostree --repo=${repo} remote add ${instbr} ${insturl}
|
|
||||||
fi
|
|
||||||
ostree --repo=${repo} pull ${pull_options} ${instbr}:${instbr}
|
ostree --repo=${repo} pull ${pull_options} ${instbr}:${instbr}
|
||||||
|
else
|
||||||
|
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
|
||||||
|
|
||||||
# This is used by patching.
|
# This is used by patching.
|
||||||
# Set ostree remote to the local install feed
|
# Set ostree remote to the local install feed
|
||||||
@ -2168,7 +2239,7 @@ if [ "${controller}" = true ] ; then
|
|||||||
# handle pxeboot install
|
# handle pxeboot install
|
||||||
else
|
else
|
||||||
pxeurl=$(echo $insturl | sed -e s/ostree_repo//)
|
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
|
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
|
for f in bzImage bzImage-rt bzImage-rt.sig bzImage.sig bzImage-std bzImage-std.sig initrd initrd.sig; do
|
||||||
if [ ! -e "./${f}" ] ; then
|
if [ ! -e "./${f}" ] ; then
|
||||||
|
Loading…
Reference in New Issue
Block a user