Fix the unattend that broke Engineer builds; gate unattend deploys on the linter
a94c203added a RunSynchronous Path of 417 chars to both std/eng answer files. Windows caps it at 259 and then rejects the WHOLE answer file, so an Engineer build stopped at 'Windows could not parse or process unattend answer file'. The live files were restored to their pre-a94c203 versions the same day. - The status steps now fit: Send-ImagingStage.ps1 -Persist copies itself out of C:\Deploy (no cmd copy chain), short PowerShell switches, default arguments left out. Longest Path is 168 chars; lint-unattend passes. NOT deployed: these files must go live only through deploy-unattend.sh. - scripts/deploy-unattend.sh: the only route for an answer file to a PXE server. Lints first and refuses on any error, backs up, swaps atomically, lints the live copy and restores the backup if that fails. - .githooks/pre-commit (git config core.hooksPath .githooks): refuses a commit whose staged unattend fails the linter. Verified by planting a 352-char Path (blocked) and against the exacta94c203file (rejected). - Boot menu: also accept SecureBoot read as hex 01, and show the raw values in the warning so a wrong read can be diagnosed from the screen.
This commit is contained in:
20
.githooks/pre-commit
Executable file
20
.githooks/pre-commit
Executable file
@@ -0,0 +1,20 @@
|
||||
#!/bin/bash
|
||||
# Refuse a commit that stages an unattend answer file the linter rejects.
|
||||
# A bad answer file stops every bay imaged with it at "Windows could not
|
||||
# parse or process unattend answer file". Enable with:
|
||||
# git config core.hooksPath .githooks
|
||||
set -euo pipefail
|
||||
ROOT="$(git rev-parse --show-toplevel)"
|
||||
mapfile -t FILES < <(git diff --cached --name-only --diff-filter=ACM | grep -iE '(^|/)(Flat)?Unattend[^/]*\.xml$' || true)
|
||||
[ ${#FILES[@]} -eq 0 ] && exit 0
|
||||
TMP="$(mktemp -d)"; trap 'rm -rf "$TMP"' EXIT
|
||||
STAGED=()
|
||||
for f in "${FILES[@]}"; do
|
||||
out="$TMP/$(echo "$f" | tr '/' '_')"
|
||||
git show ":$f" > "$out" # lint what is staged, not the working copy
|
||||
STAGED+=("$out")
|
||||
done
|
||||
if ! python3 "$ROOT/scripts/lint-unattend.py" --local "${STAGED[@]}"; then
|
||||
echo "pre-commit: unattend lint failed for: ${FILES[*]}" >&2
|
||||
exit 1
|
||||
fi
|
||||
Reference in New Issue
Block a user