diff --git a/kickstart/files/kickstart.cfg b/kickstart/files/kickstart.cfg index 68f11851..2e948d25 100644 --- a/kickstart/files/kickstart.cfg +++ b/kickstart/files/kickstart.cfg @@ -2876,12 +2876,13 @@ if [ "${controller}" = true ] ; then # Check if this is a prestage iso.If yes, then # copy the ostree_repo to the backup directory. if is_prestage -eq 0 ; then - ilog "Prestage operation: copying repo to /opt/platform-backup" - staging_dir=platform-backup - backup_device=/dev/disk/by-partlabel/platform_backup - backup_mount=/tmp/${staging_dir} + ilog "Prestage operation: copying repo to /opt/platform-backup/${sw_release}" - ilog "Temporary backup mount is ${backup_mount}" + backup_device=/dev/disk/by-partlabel/platform_backup + backup_mount=/tmp/platform-backup + backup_mount_release="${backup_mount}/${sw_release}" + + ilog "Temporary backup mount: ${backup_mount}, release: ${backup_mount_release}" mkdir -p "${backup_mount}" mount "${backup_device}" "${backup_mount}" rc=$? @@ -2889,27 +2890,32 @@ if [ "${controller}" = true ] ; 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} + ilog "Copying repo to ${backup_mount_release}" + mkdir "${backup_mount_release}" rc=$? if [ ${rc} -ne 0 ]; then - report_failure_with_msg "Unable to copy repo to /opt/platform-backup [rc=${rc}]" + report_failure_with_msg "Unable to create ${backup_mount_release} directory [rc=${rc}]" + fi + cp -a "${repo}" "${backup_mount_release}" + rc=$? + if [ ${rc} -ne 0 ]; then + report_failure_with_msg "Unable to copy repo to /opt/platform-backup/${sw_release} [rc=${rc}]" fi # The summary file is not transferred on an ostree pull, so we need to # regenerate the checksum here based on the new local repo contents - ilog "Calculating new checksum for prestaged ${backup_mount}/ostree_repo" - pushd "${backup_mount}" > /dev/null + ilog "Calculating new checksum for prestaged ${backup_mount_release}/ostree_repo" + pushd "${backup_mount_release}" > /dev/null find ostree_repo -type f -exec md5sum {} + | LC_ALL=C sort | md5sum | awk '{ print $1; }' > .ostree_repo_checksum ilog "Calculated checksum: $(cat .ostree_repo_checksum)" popd > /dev/null 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} + ilog "Copying images and patches to ${backup_mount_release}" + rsync -a /instboot/opt/platform-backup/${sw_release}/ ${backup_mount_release} rc=$? if [ ${rc} -ne 0 ]; then - report_failure_with_msg "Unable to copy images from /instboot to /opt/platform-backup [rc=${rc}]" + report_failure_with_msg "Unable to copy images from /instboot to /opt/platform-backup/${sw_release} [rc=${rc}]" fi fi @@ -3203,7 +3209,7 @@ if [ -e "/instboot/ks-addon.cfg" ]; then source /instboot/ks-addon.cfg rc=$? if [ "${rc}" -ne 0 ]; then - ilog "Addon script ks-addon.cfg exited with [rc=${rc}]" + ilog "Addon script ks-addon.cfg exited with [rc=${rc}]" fi fi diff --git a/kickstart/files/miniboot.cfg b/kickstart/files/miniboot.cfg index e250dbe7..136a953e 100644 --- a/kickstart/files/miniboot.cfg +++ b/kickstart/files/miniboot.cfg @@ -2936,10 +2936,18 @@ if [ "${controller}" = true ] ; then # This fetch is only needed once because the repo is stored in /var set_variable "ostree_repo_fetched" + # If the miniboot ISO contains a patches directory + if [ -d "/instboot/patches" ]; then + ilog "Prepatched iso" + ilog "Creating patching metadata directories" + mkdir -p ${IMAGE_ROOTFS}/var/rootdirs/opt/patching/metadata/{committed,available,applied} + cp -a /instboot/patches/* ${IMAGE_ROOTFS}/var/rootdirs/opt/patching/metadata/committed/ + fi + # copy efi.img to /var/pxeboot to enable duplex/multinode subclouds cp -a /instboot/efi.img ${pxedir} rc=$? - if [ rc -ne 0 ]; then + if [ ${rc} -ne 0 ]; then elog "Failed to copy efi.img to ${pxedir}" fi