Prestage container images at /opt/platform-backup

To save on network resources, it is required to prestage the
ostree_repo and the container images. When installation of a
subcloud is done, it is preferred that the prestaged ostree
repo and the prestaged container images are used, instead of
downloading them.

The prestaged container images are copied over to
/opt/platform-backup from the mounted media containing the
prestage iso.

Test Plan:
PASS: Verify that the prestaged container images are copied to
      /opt/platform-backup/<release version>.

PASS: Verify that the ostree_repo is not pulled from the system
      controller but from /opt/platform-backup for installation.

Story: 2010120
Task: 46709

Signed-off-by: Shrikumar Sharma <shrikumar.sharma@windriver.com>
Change-Id: Ie2276d65e44f51a36dfcff922afaf5a9bdd0cf89
This commit is contained in:
Shrikumar Sharma 2022-11-02 14:04:39 +00:00
parent 26fcaf8b9f
commit b36d22a8b5

View File

@ -2787,14 +2787,28 @@ if [ "${controller}" = true ] ; then
ilog "Temporary backup mount is ${backup_mount}"
mkdir -p "${backup_mount}"
mount "${backup_device}" "${backup_mount}" 2>/dev/null
mount "${backup_device}" "${backup_mount}"
rc=$?
if [ ${rc} -ne 0 ]; then
report_failure_with_msg "Unable to mount ${backup_device} on ${backup_mount} [rc=${rc}]"
fi
ilog "Copying repo to ${backup_mount}"
cp -a ${repo} ${backup_mount}
rc=$?
if [ ${rc} -ne 0 ]; then
report_failure_with_msg "Unable to copy repo to /opt/platform-backup"
report_failure_with_msg "Unable to copy repo to /opt/platform-backup [rc=${rc}]"
fi
if [ -e "/instboot/opt/platform-backup/${sw_release}" ]; then
ilog "Copying images and patches to ${backup_mount}"
cp -a /instboot/opt/platform-backup/${sw_release} ${backup_mount}
rc=$?
if [ ${rc} -ne 0 ]; then
report_failure_with_msg "Unable to copy images from /instboot to /opt/platform-backup [rc=${rc}]"
fi
fi
umount "${backup_mount}"
fi
else