Add native Windows driver profile support#157
Conversation
…tcha Two gaps found while checking whether the harness is ready for the PR #157 author to add linbo_driverpostsync tests against it: - No example of extracting more than one function into a single test file, even though extract_function already supports it - relevant since valid_image_name/valid_profile_name would likely be tested together. - No mention of the busybox-ash-vs-dash bashism trap found in convert_size() during Phase 1 (${var/pattern} works under ash, fails under dash) - worth flagging explicitly so it doesn't have to be rediscovered the same way for every new test.
|
Phase 1 of the shell-test harness (see For this PR: A few pointers that'll save you some time:
Happy to help if anything in the harness itself is unclear or needs adjusting for your case. |
40aaa38 to
588206d
Compare
|
Thanks for the guidance. I rebased the PR onto the current The complete shell test suite passes under both No runtime behavior was changed. |
|
One heads-up before this gets its CI run: Could you rebase/merge the current |
588206d to
719231a
Compare
|
Rebased onto the current The complete shell test suite passes under both |
HappyBasher
left a comment
There was a problem hiding this comment.
Reviewed `linbo_driverpostsync` in full (639 lines). Solid work:
- Input validation (`valid_image_name`/`valid_profile_name`) is fail-closed and traversal-safe before any value touches an rsync or filesystem path; Windows-reserved device names are correctly rejected too.
- Staging + atomic swap pattern (staging → active, with a last-known-good backup) is applied consistently for both metadata and payload syncs, with crash recovery on the next run.
- `match.conf` parsing is fail-closed (single `[match]` section, exactly one vendor, ≥1 non-empty product).
- `pnputil-install.cmd` generation correctly maps all four documented exit codes (0/259/1641/3010) to the right self-delete/retry behavior.
- Wave 1 tests landed and CI is green under both `dash` and BusyBox `ash`.
I also cross-checked this against `linuxmuster-tools` v7.4.10, which already renders the server-side dispatcher this pairs with: argument order/quoting match exactly, profile-name validation on that side is at least as strict (no injection path through a rendered dispatcher), and the generated dispatcher already guards with `command -v linbo_driverpostsync` so an old client without this executable gets a visible warning instead of breaking.
Non-blocking follow-ups worth tracking as separate issues rather than holding up this PR:
- Hidden-dotfile cache leak: the "retain only current matches" cleanup loops use a bare `` glob, which doesn't match `.staging-`/`.previous-*` left behind by profiles that get unassigned or stop matching. Traced the blast radius — disk space only, not read into `/mnt/Drivers/LINBO`, but worth a follow-up fix.
- Wave 2 test coverage (match.conf parsing, crash recovery, batch/registry generation) is still workbench-only: fine as a documented, accepted scoping decision.
- `usage()` doesn't special-case a `help` argument the way `linbo_patch_registry` does.
- Given `linuxmuster-tools` already shipped its side ahead of sequence, let's prioritize getting a linbo7 package with this out and into the fleet rollout — the tools-side feature is currently live but nonfunctional until then.
Approving.
Adds the 2026-07-23 status update: Wave 1 tests landed and CI green, cross-repo contract verified against the already-released linuxmuster-tools v7.4.10 dispatcher renderer (safe graceful degradation via its command -v guard), and revises the recommendation to Approved with the remaining items reframed as non-blocking follow-ups.
The command selects Windows driver profiles using the client's current DMI vendor and product information. It downloads the small
match.conffiles first, transfers only matching driver payloads and prepares them for installation through Windows PnPUtil.Existing LINBO paths for image downloads, sync hooks, mounts and registry handling are reused. No additional service, network port or dependency is introduced.