From b36d22a8b5aa6a2db69d56695e8c655b0a7dd5b3 Mon Sep 17 00:00:00 2001 From: Shrikumar Sharma Date: Wed, 2 Nov 2022 14:04:39 +0000 Subject: [PATCH] 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/. 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 Change-Id: Ie2276d65e44f51a36dfcff922afaf5a9bdd0cf89 --- kickstart/files/kickstart.cfg | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/kickstart/files/kickstart.cfg b/kickstart/files/kickstart.cfg index a7b954ed..a57d7c65 100644 --- a/kickstart/files/kickstart.cfg +++ b/kickstart/files/kickstart.cfg @@ -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