Skip to content

feature: Add Trident Linux Installer for ISO autorun - #819

Merged
Paco Huelsz (frhuelsz) merged 62 commits into
mainfrom
user/frhuelsz/trident-installer
Nov 19, 2026
Merged

Paco Huelsz (frhuelsz) merged 62 commits into
mainfrom
user/frhuelsz/trident-installer

Conversation

@frhuelsz

@frhuelsz Paco Huelsz (frhuelsz) commented Oct 5, 2026 •

Copy link
Copy Markdown
Collaborator

🔍 Description

Adds trident-installer, an optional RPM for installer ISOs. It runs Trident with a terminal UI for installation progress, logs, and recovery.

  • Starts automatically when the ISO boots with trident.installer=1.
  • Installs using a supplied Host Configuration, or streams the first COSI found on the installer media. There is no initial source picker or confirmation prompt.
  • Shows progress on the local console and sends logs to serial consoles. Recovery offers a shell or a new installation from a remote URL.

Includes TOML configuration and an installer reference covering setup, source selection, and screen flows.

Remove the installer media after installation: leaving it first in boot order can reimage the machine on the next boot.

Trident installer console

🤔 Rationale

Give installer ISOs a small Rust front end to Trident instead of maintaining separate shell installers.

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 1 pipeline(s).
There may be pipelines that require an authorized user to comment /azp run to run.

@frhuelsz
Paco Huelsz (frhuelsz) changed the base branch from main to user/frhuelsz/trident-client-crate November 6, 2026 01:02
@frhuelsz
Paco Huelsz (frhuelsz) changed the base branch from user/frhuelsz/trident-client-crate to main November 7, 2026 01:08
@frhuelsz
Paco Huelsz (frhuelsz) marked this pull request as ready for review November 7, 2026 01:29
@frhuelsz
Paco Huelsz (frhuelsz) requested a review from a team as a code owner November 7, 2026 01:29
Copilot AI balanced review requested due to automatic review settings November 7, 2026 01:29

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

URL secrets leak into console and serial logs, and unresolved defects also affect remote recovery, ACL payload rejection, and firmware pairing.

4 open issues
What changed in this PR

Adds a Trident-native autorun installer for explicitly marked Linux installation media, using the shared trident-client from prerequisite PR #925.

Changes:

  • Adds installer configuration, source discovery, streaming safety checks, recovery integration, and inert demo scenarios.
  • Packages marker-gated startup and console handling, with shared OS helpers and gRPC client APIs.
  • Adds ISO recipes, disposable VM/USB tooling, tests, and configuration documentation.
File Description
tests/​images/​tui-installer/​README.md Documents ISO preparation and disposable VM use.
tests/​images/​tui-installer/​image.yaml Defines the packaged installer ISO.
tests/​images/​tui-installer/​.gitignore Excludes staged payloads and RPMs.
tests/​images/​tailor.yaml Configures the image-building toolchain.
tests/​images/​.gitignore Excludes Tailor working state.
test/​test_scripts.py Tests VM isolation, serial following, and VNC startup.
test/​tailor.yaml Configures the local fixture toolchain.
test/​run.py Launches disposable UEFI VMs with serial and VNC support.
test/​README.md Documents local installer validation workflows.
test/​make_usb.py Creates GPT/FAT32 USB test images.
test/​installer/​image.yaml Defines the local validation ISO.
test/​installer/​files/​installer.toml Keeps fixture results visible without automatic reboot.
test/​build.py Validates payloads and builds RPM/ISO fixtures.
test/​.gitignore Excludes generated fixtures and VM state.
packaging/​systemd/​trident-installer.service Gates installer startup on the kernel marker.
packaging/​systemd/​serial-getty@.service.d/​trident-installer.conf Suppresses serial gettys on marked boots.
packaging/​systemd/​getty@tty1.service.d/​trident-installer.conf Reserves tty1 on marked boots.
packaging/​rpm/​trident.spec Builds and packages the installer and startup configuration.
packaging/​etc/​installer.toml Supplies packaged autorun defaults.
packaging/​docker/​Dockerfile.azl Includes the installer binary in RPM builds.
Makefile Integrates installer builds and client validation.
docs/​Reference/​Installer-Configuration.md Documents TOML settings and source selection.
crates/​trident-proto/​Cargo.toml Inherits the workspace version.
crates/​trident-client/​src/​types.rs Defines transport-independent client events and results.
crates/​trident-client/​src/​transport.rs Implements connections and endpoint diagnostic redaction.
crates/​trident-client/​src/​servicing.rs Handles servicing streams and completion timeouts.
crates/​trident-client/​src/​protocol.rs Maps and validates protocol messages.
crates/​trident-client/​src/​preview.rs Exposes preview installation and inspection APIs.
crates/​trident-client/​src/​lib.rs Exports and documents the shared client API.
crates/​trident-client/​src/​error.rs Exposes errors and execution certainty.
crates/​trident-client/​src/​error_kind.rs Defines internal client failure representations.
crates/​trident-client/​src/​client.rs Implements typed and raw-YAML RPC methods.
crates/​trident-client/​Cargo.toml Declares client dependencies and preview support.
crates/​osutils/​src/​terminal.rs Adds terminal ownership, palette, and shell helpers.
crates/​osutils/​src/​systemd.rs Adds service-stop and power-control wrappers.
crates/​osutils/​src/​lsblk.rs Adds recursive filesystem-label discovery.
crates/​osutils/​src/​lib.rs Exports terminal helpers.
crates/​osutils/​src/​dependencies.rs Supports foreground interactive commands.
crates/​osutils/​Cargo.toml Enables process and terminal support.
crates/​installer/​src/​source.rs Resolves sources and checks streaming safety.
crates/​installer/​src/​main.rs Initializes logging, runtime, and console access.
crates/​installer/​src/​demo.rs Simulates installer outcomes without machine changes.
crates/​installer/​src/​config.rs Validates configuration, overlays, and media selection.
crates/​installer/​src/​client.rs Adapts shared-client operations into installer events.
crates/​installer/​README.md Documents operation, recovery, and ISO integration.
crates/​installer/​Cargo.toml Defines the installer binary and dependencies.
Cargo.toml Registers new crates and shared dependencies.
Cargo.lock Locks the added dependency graph.

Review effort: Balanced

Comment thread crates/installer/src/client.rs Resolved
Comment thread crates/installer/src/source.rs Resolved
Comment thread test/build.py Resolved
Comment thread test/run.py Resolved
@frhuelsz
Paco Huelsz (frhuelsz) force-pushed the user/frhuelsz/trident-installer branch from 4dc2296 to c42b7de Compare November 7, 2026 18:35
Copilot AI balanced review requested due to automatic review settings November 7, 2026 18:35

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Unresolved critical issues could let changed image metadata make an excluded installer USB eligible as the installation target, while new dependencies remain missing from the packaged license notices.

6 open issues

Review effort: Balanced

Comment thread Cargo.toml Resolved
Comment thread crates/installer/src/client.rs Resolved
Copilot AI balanced review requested due to automatic review settings November 7, 2026 19:06

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

Blocking serial writes can freeze the installer indefinitely, and the service dependencies still activate on normal boots despite the kernel-command-line condition.

6 open issues
2 previously missed issues

In code that hasn't changed since last review

High severity Prevent blocked serial writes from freezing the installer loop

crates/​installer/​src/​main.rs:115

Serial mirrors are opened in blocking mode, and Output::announce in ui.rs:724–737 writes to them synchronously in the installer event loop. If serial output stalls under flow control, the write can block indefinitely, freezing recovery input, progress consumption, and automatic reboot. Open the mirrors nonblocking through an osutils helper and drop a mirror on backpressure, or use a bounded background writer so serial logging cannot stall the installer.

Medium severity Gate installer dependencies to installer boots

packaging/​systemd/​trident-installer.service:5

The kernel-command-line condition does not gate these dependency jobs. Because the RPM installs a multi-user.target.wants symlink, an unmarked normal boot still starts tridentd.socket and systemd-udev-settle.service before skipping the installer, reactivating an otherwise disabled socket and introducing a udev-settle boot wait. Gate inclusion in the boot transaction itself, for example with a marker-aware systemd generator, so these dependencies are activated only on installer boots.

Review effort: Balanced

Copilot AI balanced review requested due to automatic review settings November 8, 2026 01:41

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

Human assessment is needed because critical findings omitted from the published review identify risks of an indefinitely stopped recovery shell and frozen installer controls.

6 open issues

Review effort: Balanced

Copilot AI balanced review requested due to automatic review settings November 10, 2026 00:00

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

Human review is needed to assess sensitive URL exposure in operator-visible logs and the risk of wrapped daemon records obscuring the final result.

No open issues 🎉

6 resolved since last review

Review effort: Balanced

Add HC and COSI autorun, ISO media discovery, recovery, shell and result actions, and a safe local demo. Wire the optional installer RPM and preserve caller-managed reboot policy.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Do not supply implicit settings after a configuration failure. Keep URL-entry controls accurate and installer method visibility scoped to the crate.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Replace the demo's real shell with an inert command screen. Keep reboot and shutdown mocked, render readable structured error details, and avoid duplicating headless errors.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Use the supplied ASCII wordmark and Trident Linux Installer display name. Keep controls visible at 80x24 and fall back to a compact header for smaller terminals.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Keep all diagnostic records while selecting display verbosity live. Add coloured RPC logs and blank lines around the cyan wordmark without hiding console actions.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Build matching installer/base RPMs in Azure Linux, reuse a pre-existing non-ACL COSI, and package an autorun ISO. Provide a manual QEMU launcher using fresh storage and disk-first UEFI boot order.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Run headlessly with a loopback-only VNC listener and document the SSH tunnel. Keep GTK support and disposable storage unchanged.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Prevent getty and logind from reclaiming tty1, explicitly foreground the installer, and replace the broad blkid media probe with lsblk. Show each preparation stage on screen and serial. Start VNC guests paused until a viewer connects.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Mirror output is best-effort and warns before dropping an unwritable terminal instead of killing the interactive installer. Reproduce a tty write failure in a unit test and document the chosen test COSI's missing EFI loader.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

The installer’s disk safety, initialization, and recovery paths involve significant risks that warrant human assessment.

No open issues 🎉

Review effort: Balanced

Document autorun source selection, colored screen flows, recovery actions and safety controls; link the new page from installer configuration and crate README.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI balanced review requested due to automatic review settings November 18, 2026 19:18

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

Safety-critical disk selection and recovery behavior span several interacting paths that warrant human assessment beyond the published review.

No open issues 🎉

Review effort: Balanced

Paco Huelsz (frhuelsz) added a commit that referenced this pull request Nov 18, 2026
# 🔍 Description

Decode `file://` URLs with `Url::to_file_path()` in Trident's
`FileReader`, and reject non-local file URL hosts. Add a regression for
local filenames containing spaces and `#`. This PR changes only
`crates/trident/src/io_utils/file_reader.rs`.

# 🤔 Rationale

`Url::path()` retains `%20` and `%23`. Treating it as a literal
filesystem path makes valid local images appear missing. The fix belongs
at Trident's file-reader boundary, independently of the installer in
#819.

# 📝 Validation

**Passed (agent, `58e2d026c`):**
`CARGO_TARGET_DIR=/home/frhuelsz/repos/trident-installer/target cargo
test --locked --offline -p trident --lib io_utils::file_reader::tests
--quiet` (3 tests); `cargo fmt --all`; `cargo fmt --all -- --check`;
`git diff --cached --check`; `git diff --name-status origin/main...HEAD`
(only the file reader changed).

**Pending (CI):** Checks for `58e2d026c` have not yet completed or been
observed. **Not run:** ISO/VM boot; this change is covered by the
focused file-URL regression.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Comment thread docs/Reference/Installer.md Resolved
Name the ISO kernel boot argument directly, simplify mode wording, and introduce prerequisites and source concepts before diagrams and controls.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI balanced review requested due to automatic review settings November 18, 2026 23:22
Clarify that installer://image is the only supported reserved image URL and selects the first COSI, not a file named in the URL.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

The installer’s startup, servicing, and recovery paths present critical risks to operator access and safe recovery that require human assessment.

No open issues 🎉

Review effort: Balanced

Copilot AI balanced review requested due to automatic review settings November 18, 2026 23:38
Copilot stopped reviewing on behalf of Paco Huelsz (frhuelsz) due to an error November 18, 2026 23:38
Comment thread crates/installer/src/ui/mod.rs Resolved

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

Human assessment is needed to evaluate interacting risks around disk operations, recovery-console availability, and packaged daemon capabilities.

No open issues 🎉

Review effort: Balanced

@bfjelds

Copy link
Copy Markdown
Member

can be followup: should have a trident pipeline test to validate this

Replace the immediately invoked closure with leave_screen while preserving palette cleanup and error ordering.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

Safety-critical interactions involving reboot timing and loss of monitoring during disk writes warrant human assessment.

No open issues 🎉

Review effort: Balanced

@frhuelsz
Paco Huelsz (frhuelsz) merged commit 4c752e6 into main Nov 19, 2026
16 of 22 checks passed
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.

3 participants