git: af4ba95daf75 - main - freebsd-update: Add some diagnositic information for a failure case
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Mon, 17 Nov 2025 14:42:57 UTC
The branch main has been updated by emaste:
URL: https://cgit.FreeBSD.org/src/commit/?id=af4ba95daf75cf1b1624dd57038cfaa3ed2753e7
commit af4ba95daf75cf1b1624dd57038cfaa3ed2753e7
Author: Ed Maste <emaste@FreeBSD.org>
AuthorDate: 2025-08-28 16:04:06 +0000
Commit: Ed Maste <emaste@FreeBSD.org>
CommitDate: 2025-11-17 14:42:17 +0000
freebsd-update: Add some diagnositic information for a failure case
Users report freebsd-update failing with "The update metadata index is
correctly signed, but failed an integrity check." Add a hint at which
of the cases is failing to help track down the issue.
PR: 264205
Reviewed by: dch
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D52222
---
usr.sbin/freebsd-update/freebsd-update.sh | 16 ++++++++--------
1 file changed, 8 insertions(+), 8 deletions(-)
diff --git a/usr.sbin/freebsd-update/freebsd-update.sh b/usr.sbin/freebsd-update/freebsd-update.sh
index 2a07bc1fb7bc..b6e42e94f4bf 100644
--- a/usr.sbin/freebsd-update/freebsd-update.sh
+++ b/usr.sbin/freebsd-update/freebsd-update.sh
@@ -1402,7 +1402,7 @@ fetch_metadata_index () {
fetch_metadata_bogus () {
echo
echo "The update metadata$1 is correctly signed, but"
- echo "failed an integrity check."
+ echo "failed an integrity check ($2)."
echo "Cowardly refusing to proceed any further."
return 1
}
@@ -1413,7 +1413,7 @@ fetch_metadata_index_merge () {
for METAFILE in $@; do
if [ `grep -E "^${METAFILE}\|" ${TINDEXHASH} | wc -l` \
-ne 1 ]; then
- fetch_metadata_bogus " index"
+ fetch_metadata_bogus " index" "${METAFILE} count not 1"
return 1
fi
@@ -1436,7 +1436,7 @@ fetch_metadata_index_merge () {
# specifically grepped out of ${TINDEXHASH}.
fetch_metadata_index_sanity () {
if grep -qvE '^[0-9A-Z.-]+\|[0-9a-f]{64}$' tINDEX.new; then
- fetch_metadata_bogus " index"
+ fetch_metadata_bogus " index" "unexpected entry in tINDEX.new"
return 1
fi
}
@@ -1453,7 +1453,7 @@ fetch_metadata_sanity () {
# Check that the first four fields make sense.
if gunzip -c < files/$1.gz |
grep -qvE "^[a-z]+\|[0-9a-z-]+\|${P}+\|[fdL-]\|"; then
- fetch_metadata_bogus ""
+ fetch_metadata_bogus "" "invalid initial fields"
return 1
fi
@@ -1464,28 +1464,28 @@ fetch_metadata_sanity () {
# Sanity check entries with type 'f'
if grep -E '^f' sanitycheck.tmp |
grep -qvE "^f\|${M}\|${H}\|${P}*\$"; then
- fetch_metadata_bogus ""
+ fetch_metadata_bogus "" "invalid type f entry"
return 1
fi
# Sanity check entries with type 'd'
if grep -E '^d' sanitycheck.tmp |
grep -qvE "^d\|${M}\|\|\$"; then
- fetch_metadata_bogus ""
+ fetch_metadata_bogus "" "invalid type d entry"
return 1
fi
# Sanity check entries with type 'L'
if grep -E '^L' sanitycheck.tmp |
grep -qvE "^L\|${M}\|${P}*\|\$"; then
- fetch_metadata_bogus ""
+ fetch_metadata_bogus "" "invalid type L entry"
return 1
fi
# Sanity check entries with type '-'
if grep -E '^-' sanitycheck.tmp |
grep -qvE "^-\|\|\|\|\|\|"; then
- fetch_metadata_bogus ""
+ fetch_metadata_bogus "" "invalid type - entry"
return 1
fi