tkldev-setup: build the bootstrap locally when it cannot be downloaded, verify the right file #1
No reviewers
Labels
No labels
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Keel-Linux/tkldev!1
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "fix/build-missing-bootstrap"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem: on a fresh TKLDev 19.0 the 40tkldev first-boot hook (tkldev-setup core) died with a 404 because bootstrap-trixie-amd64.tar.gz was never published on the mirror, and nothing could be built; with a mirror that has the tarball (bookworm) the download aborted on signature-verify because it was pointed at the bootstrap directory instead of the tarball.
Diagnosis: the closing bracket of a dirname call had moved (
78e7142upstream), so signature-verify received /turnkey/fab/bootstraps/- and its .hash, which do not exist; and the script had no fallback when the tarball or its .hash cannot be downloaded.Fix: verify the tarball, not its directory; when the download fails, clone or update turnkeylinux/bootstrap next to FAB_PATH and 'make install' it, as bt-bootstrap does (default: warn and build; --strict: fail as before; --transition: warn and skip, without verifying files that were never downloaded). The script now defines its functions first, returns early when sourced, and takes TKLBAM_PATH like BT_PATH and FAB_PATH so a run can be pointed at a scratch tree. The last commit makes tests/coverage.sh read COVERAGE_THRESHOLD, the variable the reusable workflow exports.
Tests: 63 bats with git, wget, apt-get, make, lsb_release, turnkey-version, dpkg, id and signature-verify stubbed on PATH; tests/coverage.sh under kcov: tkldev-setup 185/186 lines (99.46 percent; the missing line is the continuation of a two-line warning call). On a TKLDev 19.0 VM with the trixie bootstrap removed: default builds and installs it in 81 s, --strict exits 1, --transition skips; a bookworm download verifies and unpacks.
Serves BRIEF section 8 (the build host must build from the organization) and the M0 gate of docs/m0-gate.md.