fixing final SPDK deployment

This commit is contained in:
Audiobuzz
2026-06-28 08:44:49 +00:00
parent 2cf7ad4ffb
commit bc14b8986d
6 changed files with 243 additions and 12 deletions
+8 -3
View File
@@ -98,8 +98,12 @@ except Exception: print(-1)'
cmd_add() {
local v=${1:?usage: add <version>}
local dir="$RELEASES_DIR/$v"
[ -s "$dir/rootfs.erofs" ] || die "$dir/rootfs.erofs missing/empty"
[ -s "$dir/rootfs.hash" ] || die "$dir/rootfs.hash missing/empty"
# Validation failures here RETURN (not die/exit): cmd_add is called per-dir by
# cmd_reconcile as `cmd_add … || warn`, and an `exit` inside a function aborts
# the WHOLE process (|| only catches a return), so one bad/stale dir would stop
# every OTHER release from being added. Return so reconcile skips just this one.
[ -s "$dir/rootfs.erofs" ] || { echo "ERROR: $dir/rootfs.erofs missing/empty" >&2; return 1; }
[ -s "$dir/rootfs.hash" ] || { echo "ERROR: $dir/rootfs.hash missing/empty" >&2; return 1; }
# Guard: the dir name must match the version inside verity.json. A mismatch
# means a stale/symlinked or mislabeled release dir (e.g. an old symlink into
@@ -112,7 +116,8 @@ cmd_add() {
local vv
vv=$(vfield "$v" .image_version)
if [ -n "$vv" ] && [ "${vv,,}" != "${v,,}" ]; then
die "release dir '$v' holds verity.json for version '$vv' (stale symlink / mislabeled dir). Refusing to add — remove '$dir' and re-stage."
echo "ERROR: release dir '$v' holds verity.json for version '$vv' (stale symlink / mislabeled dir). Refusing to add — remove '$dir' and re-stage." >&2
return 1
fi
local nqn du hu s