Thanks to visit codestin.com
Credit goes to github.com

Skip to content

installer-setup WS-B: platform-gate hardening (bootstrap-prereq parity, disk-on-store, early hal0 user)#1139

Merged
thinmintdev merged 2 commits into
mainfrom
feat/1098-platform-gate-hardening
Jul 6, 2026
Merged

installer-setup WS-B: platform-gate hardening (bootstrap-prereq parity, disk-on-store, early hal0 user)#1139
thinmintdev merged 2 commits into
mainfrom
feat/1098-platform-gate-hardening

Conversation

@thinmintdev

Copy link
Copy Markdown
Contributor

Summary

Closes #1098.

Three up-front gate gaps closed in installer/install.sh / installer/lib/preflight.sh:

  1. Bootstrap-prereq parityinstaller/bootstrap.sh (the curl|bash one-liner) hard-requires a Linux host plus curl/tar/sha256sum in its own preflight() before it ever fetches the release tarball. install.sh leans on all three later in its own run (the network probe's curl call, the rsync-fallback tar copy, the FLM .deb sha256 check) but a direct sudo bash install.sh — no bootstrap in front — never checked for them up front. Added preflight_bootstrap_prereqs() to installer/lib/preflight.sh (mirrors bootstrap.sh's checks/message style) and call it, hard (die on failure), as the first thing install.sh does in its "Pre-flight checks" step. Also wired into preflight_all so hal0 doctor reports the same floor.
  2. Disk-space check on the chosen model store — the existing disk probe only ever measured VAR_DIR. Model weights land at MODELS_DIR, which is frequently a different mount (--models-dir=/data/models, a NAS/NVMe). Added a second preflight_disk call against MODELS_DIR, warn-only (non-fatal) — no model is picked yet at install time, so an undersized store shouldn't hard-block the rest of the platform gate the way a genuinely full root disk should.
  3. Early hal0 user creation — the hal0 system user/group + render/video group membership used to be created very late (after directories, the source copy, and hal0.toml were already mutated). Moved to immediately after pre-flight, before the first mutating step ("Filesystem layout"'s mkdir -p). The directory-dependent follow-up work that needs VAR_DIR to exist (FLM cache, HF cache, STATE.md ownership) stays where it was, in its own now-ui_step-free block.

No regression to the one-liner path: bootstrap.sh is unchanged, and install.sh's new checks are strictly additive.

Test plan

  • bash -n installer/install.sh
  • uv run ruff format src tests / ruff check / ruff format --check — clean
  • New tests: tests/installer/test_bootstrap_prereq_parity.py (function-level, via subprocess+stubs — asserts Linux/curl/tar/sha256sum checks, install.sh wiring + ordering) and tests/installer/test_platform_gate_hardening.py (static-text/ordering assertions: early user creation precedes mutation, no duplicate user/group creation, models-store disk check present and warn-only)
  • uv run pytest tests/ -q --ignore=tests/e2e — same ~14 pre-existing failures as main (confirmed via git stash: hermes venv, comfyui phase4, proxmox host detection, container spec, config-url-proxy, models-preview, settings-store), no new failures introduced

🤖 Generated with Claude Code

…y, disk-on-store, early hal0 user)

The direct `sudo bash install.sh` path skipped the same base-prereq checks
(Linux host, curl/tar/sha256sum) that bootstrap.sh's one-liner enforces
before ever fetching the release tarball, so a minimal host could sail
past "Pre-flight checks" and die deep in the run with a bare "command not
found". The hal0 system user was also created very late (after
directories, the source copy, and hal0.toml were already mutated), and
the disk-space preflight only ever measured VAR_DIR, never the models
store an operator picks via --models-dir/HAL0_MODELS_DIR.

Add preflight_bootstrap_prereqs (mirrors bootstrap.sh's preflight()) and
call it hard in install.sh's own Pre-flight step; move the hal0
user/group + render/video group creation to right after pre-flight,
before any filesystem mutation; add a warn-only disk probe on MODELS_DIR
alongside the existing (fatal) VAR_DIR probe.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
@thinmintdev thinmintdev enabled auto-merge (squash) July 6, 2026 06:18
@thinmintdev thinmintdev merged commit 2576d63 into main Jul 6, 2026
2 of 3 checks passed
thinmintdev added a commit that referenced this pull request Jul 6, 2026
…ity tests (#1143)

full_bin_dir seeds PATH tools as symlinks to the real binaries; _fake_uname
then overwrote `uname` via write_text(), which FOLLOWS the symlink and
rewrites the host's /usr/bin/uname → PermissionError on the CI runner
(TestNonLinuxHost::test_darwin_is_rejected / test_linux_is_accepted), or
silent mutation of the real binary when the suite runs as root. _write_exe
now unlinks first so it replaces the symlink with a regular file.

Unblocks CI on main (regression from #1098/#1139 merged green off a
box-local run where /usr/bin/uname was writable).

Co-authored-by: Claude Opus 4.8 (1M context) <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

installer-setup WS-B: platform-gate hardening (bootstrap-prereq parity, disk-on-store, early hal0 user)

1 participant