diff --git a/bsp-files/kickstarts/post_miniboot_controller.cfg b/bsp-files/kickstarts/post_miniboot_controller.cfg index fc2604da..fd94069d 100644 --- a/bsp-files/kickstarts/post_miniboot_controller.cfg +++ b/bsp-files/kickstarts/post_miniboot_controller.cfg @@ -10,6 +10,7 @@ BACKUP_DEVICE=/dev/disk/by-partlabel/${BACKUP_PART_LABEL} BACKUP_MOUNT=/mnt/${STAGING_DIR} BOOTIMAGE_ISO="" BOOTIMAGE_MOUNT=/mnt/bootimage +PRESTAGE_DIR=${BACKUP_MOUNT}/${SW_VERSION} KS="Miniboot pre:" wlog "${KS} local install check" @@ -125,20 +126,42 @@ if [ "${iso_mount}" = false ] ; then wlog "${KS} Prestage ISO is not available" fi +# Make sure the prestage directory exists, as well as the required subdirectories. +exists_prestage=false +if [ ! -e ${PRESTAGE_DIR} ] || [ ! -e ${PRESTAGE_DIR}/Packages ] || [ ! -e ${PRESTAGE_DIR}/repodata ]; then + exists_prestage=false +else + exists_prestage=true +fi + # # This controls where the packages come from. # Lower cost has higher priority ; making local install preferred. # # If ${BOOTIMAGE_MOUNT} exists then install from local iso - Local Install -# Otherwise, they are fetched from platform backup. +# Otherwise, they are fetched from platform backup if the Packages have been +# prestaged. # If this fails, they are fetched from the System Controller - Remote Install # -cat << EOF > /tmp/repo-include -repo --name=local-base --cost=100 --baseurl=file://${BOOTIMAGE_MOUNT}/ -repo --name=local-updates --cost=100 --baseurl=file://${BOOTIMAGE_MOUNT}/patches/ -repo --name=remote-base --cost=200 --baseurl=xxxHTTP_URLxxx/ -repo --name=remote-updates --cost=200 --baseurl=xxxHTTP_URLxxx/patches/ +if [ "${exists_prestage}" = true ]; then + wlog "${KS} Prestage directory found: ${PRESTAGE_DIR}" + cat << EOF > /tmp/repo-include + repo --name=local-base --cost=100 --baseurl=file://${BOOTIMAGE_MOUNT}/ + repo --name=local-updates --cost=100 --baseurl=file://${BOOTIMAGE_MOUNT}/patches/ + repo --name=local-base --cost=200 --baseurl=file://${PRESTAGE_DIR}/ + repo --name=local-updates --cost=200 --baseurl=file://${PRESTAGE_DIR}/patches/ + repo --name=remote-base --cost=300 --baseurl=xxxHTTP_URLxxx/ + repo --name=remote-updates --cost=300 --baseurl=xxxHTTP_URLxxx/patches/ EOF +else + wlog "${KS} Packages will either be retrieved from prestage iso or downloaded" + cat << EOF > /tmp/repo-include + repo --name=local-base --cost=100 --baseurl=file://${BOOTIMAGE_MOUNT}/ + repo --name=local-updates --cost=100 --baseurl=file://${BOOTIMAGE_MOUNT}/patches/ + repo --name=remote-base --cost=200 --baseurl=xxxHTTP_URLxxx/ + repo --name=remote-updates --cost=200 --baseurl=xxxHTTP_URLxxx/patches/ +EOF +fi %end # Repository arguments from %pre