Merge "prestage install: remove ostree_repo checksum"

This commit is contained in:
Zuul
2025-05-08 15:00:54 +00:00
committed by Gerrit Code Review

View File

@@ -1097,35 +1097,8 @@ if check_prestage -eq 0 ; then
report_failure_with_msg "Unable to mount ${ISO_DEV} Error rc=${rc}"
fi
local_repo_check_fail=
# Calculate local checksum and compare
checksum_file=${ISODIR}/.ostree_repo_checksum
if [ -f "${checksum_file}" ]; then
checksum_from_file=$(cat "${checksum_file}")
ilog "Verifying checksum for prestaged ${ISODIR}/ostree_repo"
pushd "${ISODIR}" > /dev/null
checksum=$(find ostree_repo -type f -exec md5sum {} + | LC_ALL=C sort | md5sum | awk '{ print $1; }')
popd > /dev/null
if [ "${checksum}" = "${checksum_from_file}" ]; then
ilog "Verified ostree checksum: ${checksum}"
else
elog "ostree checksum failed on ${ISODIR}/ostree_repo"
elog "Calculated checksum: ${checksum}"
elog "File checksum: ${checksum_from_file}"
local_repo_check_fail=true
fi
else
# No prestage checksum file is available. Use ostree fsck instead.
# The only problem with this is the length of time required for fsck to complete.
wlog "No ostree checksum file at ${checksum_file}. Performing ostree fsck instead."
if ! ostree --repo="${ISODIR}/ostree_repo" fsck; then
elog "ostree fsck failed on prestaged ${ISODIR}/ostree_repo: reverting to remote pull"
local_repo_check_fail=true
fi
fi
if [ -n "${local_repo_check_fail}" ]; then
report_failure_with_msg "ostree integrity check failed on ISO ${ISODIR}/ostree_repo"
fi
# This is a prestaged ostree_repo (non-network). ostree_repo checksum
# verification is not required
if [ -e "${ISODIR}/ks-setup.cfg" ]; then
source "${ISODIR}/ks-setup.cfg"