Skip to content

engineering: Propagate flexible ESP mount path#591

Open
frhuelsz wants to merge 87 commits intomainfrom
user/frhuelsz/efi-path-enginecontext
Open

engineering: Propagate flexible ESP mount path#591
frhuelsz wants to merge 87 commits intomainfrom
user/frhuelsz/efi-path-enginecontext

Conversation

@frhuelsz
Copy link
Copy Markdown
Contributor

@frhuelsz frhuelsz commented Apr 7, 2026

🔍 Description

Allow for different ESP mount points.

Propagate the changes in #586 to all the trivial locations in trident so that we may change the ESP mount point as required by the distro.

Depends on:

@frhuelsz frhuelsz changed the title engineering: Use context to resolve ESP mount path feature: Flexible ESP mount path Apr 9, 2026
@frhuelsz frhuelsz marked this pull request as ready for review April 9, 2026 20:45
@frhuelsz frhuelsz requested a review from a team as a code owner April 9, 2026 20:45
Copilot AI review requested due to automatic review settings April 9, 2026 20:45
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Propagates the flexible ESP (EFI System Partition) mount path work (from #586) across Trident, replacing remaining /boot/efi assumptions with a graph-/context-derived ESP mount path and adding a per-filesystem override mechanism for ESP detection.

Changes:

  • Introduces/propagates is_esp and overrideEspMount semantics through host-config (de)serialization, validation, and storage-graph building.
  • Plumbs esp_mount_path into EngineContext and updates engine/subsystem codepaths to use it instead of ESP_MOUNT_POINT_PATH.
  • Updates schemas/docs and removes the docbuilder “Filesystem Source Requirements” rule/section that no longer applies.

Reviewed changes

Copilot reviewed 76 out of 76 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
report/esp-constant-usages.md Adds a tracking report for remaining ESP constant usages and migration status.
docs/Reference/Host-Configuration/Storage-Rules.md Removes the “Filesystem Source Requirements” section from the docs.
docs/Reference/Host-Configuration/API-Reference/VerityDevice.md Sidebar ordering update (generated doc).
docs/Reference/Host-Configuration/API-Reference/VerityCorruptionOption.md Sidebar ordering update (generated doc).
docs/Reference/Host-Configuration/API-Reference/User.md Sidebar ordering update (generated doc).
docs/Reference/Host-Configuration/API-Reference/UefiFallbackMode.md Sidebar ordering update (generated doc).
docs/Reference/Host-Configuration/API-Reference/Trident.md Sidebar ordering update (generated doc).
docs/Reference/Host-Configuration/API-Reference/SystemdCheck.md Sidebar ordering update (generated doc).
docs/Reference/Host-Configuration/API-Reference/Swap.md Sidebar ordering update (generated doc).
docs/Reference/Host-Configuration/API-Reference/Storage.md Sidebar ordering update (generated doc).
docs/Reference/Host-Configuration/API-Reference/SshMode.md Sidebar ordering update (generated doc).
docs/Reference/Host-Configuration/API-Reference/SoftwareRaidArray.md Sidebar ordering update (generated doc).
docs/Reference/Host-Configuration/API-Reference/ServicingTypeSelection.md Sidebar ordering update (generated doc).
docs/Reference/Host-Configuration/API-Reference/Services.md Sidebar ordering update (generated doc).
docs/Reference/Host-Configuration/API-Reference/SelinuxMode.md Sidebar ordering update (generated doc).
docs/Reference/Host-Configuration/API-Reference/Selinux.md Sidebar ordering update (generated doc).
docs/Reference/Host-Configuration/API-Reference/Scripts.md Sidebar ordering update (generated doc).
docs/Reference/Host-Configuration/API-Reference/Script.md Sidebar ordering update (generated doc).
docs/Reference/Host-Configuration/API-Reference/RaidLevel.md Sidebar ordering update (generated doc).
docs/Reference/Host-Configuration/API-Reference/Raid.md Sidebar ordering update (generated doc).
docs/Reference/Host-Configuration/API-Reference/Pcr.md Sidebar ordering update (generated doc).
docs/Reference/Host-Configuration/API-Reference/Password.md Sidebar ordering update (generated doc).
docs/Reference/Host-Configuration/API-Reference/PartitionType.md Sidebar ordering update (generated doc).
docs/Reference/Host-Configuration/API-Reference/PartitionTableType.md Sidebar ordering update (generated doc).
docs/Reference/Host-Configuration/API-Reference/PartitionSize.md Sidebar ordering update (generated doc).
docs/Reference/Host-Configuration/API-Reference/Partition.md Sidebar ordering update (generated doc).
docs/Reference/Host-Configuration/API-Reference/OverrideEspMount.md Adds generated API reference page for OverrideEspMount.
docs/Reference/Host-Configuration/API-Reference/FileSystem.md Documents the new overrideEspMount field.
crates/trident/src/subsystems/storage/osimage.rs Uses fs.is_esp field and updates tests accordingly.
crates/trident/src/subsystems/storage/mod.rs Updates tests for FileSystem { is_esp: ... } field.
crates/trident/src/subsystems/storage/fstab.rs Updates tests to include is_esp on filesystems.
crates/trident/src/subsystems/selinux.rs Updates tests to include is_esp on filesystems.
crates/trident/src/subsystems/esp.rs Updates install-index test usage to pass ctx.esp_mount_path.
crates/trident/src/osimage/cosi/derived_hc.rs Derives ESP selection from GPT partition type; warns/picks first when multiple ESPs present; adds tests.
crates/trident/src/offline_init/mod.rs Marks ESP filesystem in generated HostStatus based on Prism partition types.
crates/trident/src/engine/storage/verity.rs Uses ctx.esp_mount_path for ESP-path checks and updates tests.
crates/trident/src/engine/storage/rebuild.rs Updates tests to include is_esp on filesystems.
crates/trident/src/engine/storage/partitioning/repart_mode.rs Switches to PartitionType::as_dps() and removes local conversion helper.
crates/trident/src/engine/storage/image.rs Replaces constant ESP mount path usage with ctx.esp_mount_path.
crates/trident/src/engine/storage/filesystem.rs Replaces ESP detection via is_esp() with ctx.esp_mount_path comparison; updates tests.
crates/trident/src/engine/storage/encryption.rs Replaces constant ESP mount path usage with ctx.esp_mount_path; updates tests/imports.
crates/trident/src/engine/rollback.rs Updates tests to include is_esp on filesystems.
crates/trident/src/engine/newroot.rs Updates tests to include is_esp on filesystems.
crates/trident/src/engine/install_index.rs Makes install index computation accept ESP mount path (relative/absolute) and updates tests.
crates/trident/src/engine/context/mod.rs Adds esp_mount_path to EngineContext derived from the storage graph.
crates/trident/src/engine/context/image.rs Updates tests to include is_esp on filesystems.
crates/trident/src/engine/context/filesystem.rs Removes constant-based ESP helpers; uses self.esp_mount_path to find ESP filesystem.
crates/trident/src/engine/clean_install.rs Uses ctx.esp_mount_path when staging and validating ESP contents.
crates/trident/src/engine/bootentries.rs Uses ctx.esp_mount_path when constructing boot entry paths; updates tests/imports.
crates/trident/src/engine/boot/grub.rs Uses ctx.esp_mount_path for GRUB config path; updates functional test fixtures.
crates/trident/src/engine/ab_update.rs Uses ctx.esp_mount_path when computing host-relative ESP path.
crates/trident_api/src/samples/sample_hc.rs Updates samples to explicitly set is_esp on filesystems.
crates/trident_api/src/config/host/storage/storage_graph/validation_tests.rs Adds/updates tests for ESP validation (multiple ESPs, ESP without mount point, etc.).
crates/trident_api/src/config/host/storage/storage_graph/types.rs Removes now-unused FileSystemSourceKind.
crates/trident_api/src/config/host/storage/storage_graph/rules/mod.rs Makes expected ESP partition typing depend on discovered ESP mount path.
crates/trident_api/src/config/host/storage/storage_graph/graph.rs Stores and exposes esp_mount_path on the built StorageGraph.
crates/trident_api/src/config/host/storage/storage_graph/error.rs Adds ESP-specific build errors; removes obsolete filesystem source/verity variants.
crates/trident_api/src/config/host/storage/storage_graph/documentation.rs Removes FileSystemSourceKind doc plumbing.
crates/trident_api/src/config/host/storage/storage_graph/display.rs Removes FileSystemSourceKind display formatting.
crates/trident_api/src/config/host/storage/storage_graph/conversions.rs Uses fs.is_esp field for referrer-kind classification.
crates/trident_api/src/config/host/storage/storage_graph/cardinality.rs Adds ValidCardinality::new_any().
crates/trident_api/src/config/host/storage/storage_graph/builder/partition.rs Threads esp_mount_path into partition-type checks.
crates/trident_api/src/config/host/storage/storage_graph/builder/mod.rs Captures esp_mount_path during filesystem checks and stores it in the graph.
crates/trident_api/src/config/host/storage/storage_graph/builder/filesystems.rs Validates ESP uniqueness and mount-point presence; returns discovered ESP mount path.
crates/trident_api/src/config/host/storage/partitions.rs Adds PartitionType::as_dps() and conversion to DiscoverablePartitionType.
crates/trident_api/src/config/host/storage/mod.rs Validation now requires an ESP mount path from the graph; esp_filesystem() uses is_esp.
crates/trident_api/src/config/host/storage/filesystem.rs Adds is_esp to FileSystem and implements overrideEspMount via custom serde.
crates/trident_api/src/config/host/storage/filesystem_types.rs Uses Display impls for filesystem-type stringification.
crates/trident_api/src/config/host/mod.rs Minor formatting + test fixtures updated for is_esp.
crates/trident_api/src/config/host/error.rs Adds EspMountPointNotFound static validation error.
crates/trident_api/schemas/host-config-schema.json Adds overrideEspMount schema and internal doc tag usage for PartitionType.
crates/sysdefs/src/partition_types.rs Adds try_from_string_name_or_uuid helper for partition-type parsing.
crates/docbuilder/src/schema_renderer/node.rs Strips schema description text after # INTERNAL when generating docs.
crates/docbuilder/src/host_config/storage_rules/mod.rs Removes the filesystem source-requirements rule from generated storage rules.
crates/docbuilder/src/host_config/storage_rules/filesystems.rs Removes rule generation for filesystem source requirements.
.vscode/settings.json Adds terminal auto-approval config for cargo fmt.

Copilot AI review requested due to automatic review settings April 9, 2026 22:42
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 14 out of 14 changed files in this pull request and generated 2 comments.

Comments suppressed due to low confidence (1)

crates/trident/src/engine/storage/encryption.rs:734

  • Issue: EngineContext is constructed in functional tests without setting esp_mount_path, but get_binary_paths_pcrlock() now derives the ESP location from ctx.esp_mount_path. With the current ..Default::default() this will be an empty path, causing the helper to look under the wrong directory and likely breaking these functional tests (and potentially hiding regressions).

Evidence: test_get_uki_paths() and test_get_binary_paths_pcrlock() build EngineContext { ..Default::default() } and never set esp_mount_path.

Suggestion: set esp_mount_path in these functional tests (e.g., to PathBuf::from(ESP_MOUNT_POINT_PATH)/esp_path.clone()), or provide a non-empty default for EngineContext in test/functional-test builds.

    use pytest_gen::functional_test;
    use trident_api::{constants::ESP_MOUNT_POINT_PATH, status::ServicingType};

    #[functional_test(feature = "helpers")]
    fn test_get_uki_paths() {
        let mut ctx = EngineContext {
            ab_active_volume: None,
            install_index: 0,
            servicing_type: ServicingType::CleanInstall,
            ..Default::default()
        };

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings April 9, 2026 22:48
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 14 out of 14 changed files in this pull request and generated 3 comments.

@frhuelsz frhuelsz changed the title feature: Flexible ESP mount path engineering: Propagate flexible ESP mount path Apr 9, 2026
Copilot AI review requested due to automatic review settings April 9, 2026 23:27
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 14 out of 14 changed files in this pull request and generated 1 comment.

@frhuelsz
Copy link
Copy Markdown
Contributor Author

/AzurePipelines run [GITHUB]-trident-pr-e2e

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

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.

2 participants