Skip to content

SRE recovery: Scrub platform-specific references - #187

Open
kat-perez wants to merge 2 commits into
OpenDevicePartnership:mainfrom
kat-perez:scrub-sensitive-references
Open

SRE recovery: Scrub platform-specific references#187
kat-perez wants to merge 2 commits into
OpenDevicePartnership:mainfrom
kat-perez:scrub-sensitive-references

Conversation

@kat-perez

Copy link
Copy Markdown
Contributor

Summary

  • remove internal onboarding material and private platform paths
  • replace device codenames and vendor-specific wording with platform-neutral terms
  • require explicit host, firmware binary, and staging inputs

Review notes

This is the first PR in the SRE public-readiness sequence.

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.

Pull request overview

This PR is part of the SRE public-readiness sequence and focuses on removing platform-/vendor-specific references from the SRE BP flashing kit, while tightening scripts to require explicit target and firmware inputs rather than relying on internal repo layouts.

Changes:

  • Removed internal onboarding material and private repo/path assumptions from scripts and docs.
  • Updated host-side orchestration to require explicit DUT host and EFI binary paths.
  • Generalized code comments across C/Rust components to be platform-neutral.

Reviewed changes

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

Show a summary per file
File Description
uefi/SrePkg/Application/NvmeBpWrite/Stage-SreflashUsb.ps1 Removes repo-walkup build-output auto-detection and keeps staging inputs platform-neutral.
uefi/SrePkg/Application/NvmeBpWrite/Set-NextBootToUsb.ps1 Generalizes firmware boot-entry description guidance and reboot rationale.
uefi/SrePkg/Application/NvmeBpWrite/README.md Updates kit description and operator guidance to avoid platform-specific wording.
uefi/SrePkg/Application/NvmeBpWrite/NvmeBpWrite.c Generalizes vendor/platform-specific comments to platform-neutral language.
uefi/SrePkg/Application/NvmeBpWrite/Flash-BP1.md Removes internal links/paths and updates procedure to require explicit tool/WIM provenance.
uefi/SrePkg/Application/NvmeBpWrite/enable-remote.ps1 Removes user-specific wording from WinRM/UAC guidance.
uefi/SrePkg/Application/BpRecoveryLoader/SRE-onboarding.md Deletes internal onboarding documentation.
uefi/SrePkg/Application/BpRecoveryLoader/Run-WinVosFromBp.ps1 Makes DUT host and EFI paths mandatory; removes internal default path resolution.
uefi/crates/patina_sre/src/lib.rs Scrubs platform-specific mention in public-facing comments (but introduces a small comment wording issue).
uefi/crates/patina_boot/src/proxy.rs Generalizes comment references to platform headers and deferred-driver behavior.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread uefi/crates/patina_sre/src/lib.rs Outdated
Comment thread uefi/SrePkg/Application/NvmeBpWrite/Flash-BP1.md Outdated

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.

Pull request overview

Copilot reviewed 10 out of 10 changed files in this pull request and generated no new comments.

Suppressed comments (2)

uefi/SrePkg/Application/NvmeBpWrite/Set-NextBootToUsb.ps1:9

  • The header comment says the script matches entries whose description is exactly "USB Storage", but the implementation actually matches a user-provided regex ($MatchPattern, default '^USB Storage$') against both Description and Device. Updating the comment avoids misleading operators about what will be matched.
# Defaults to matching firmware boot entries whose description is exactly
# "USB Storage" — a common firmware description for the USB-first alt-boot
# entry (FAT32 volume labels and vendor strings are not visible to the
# firmware boot manager). Override with -MatchPattern when needed.

uefi/SrePkg/Application/NvmeBpWrite/NvmeBpWrite.c:972

  • The comment now states that "Supported systems have a single NVMe controller", but the code actually just returns the first NVMe-class match. Rewording this as an assumption/behavior is more accurate and avoids implying a platform guarantee that may not hold on all supported dev systems.
// Find the NVMe controller's PCI IO protocol by enumerating PCI IO handles
// and matching class code 0x010802 (Mass Storage / NVM / NVMe). Supported
// systems have a single NVMe controller, so the first match is the one.
//

@kat-perez kat-perez self-assigned this Aug 13, 2026
@kat-perez
kat-perez marked this pull request as ready for review August 13, 2026 18:47
@kat-perez
kat-perez requested a review from a team as a code owner August 13, 2026 18:47
@kat-perez
kat-perez force-pushed the scrub-sensitive-references branch from b27609c to 330953e Compare August 13, 2026 18:47

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.

Pull request overview

Copilot reviewed 10 out of 10 changed files in this pull request and generated no new comments.

Suppressed comments (2)

uefi/crates/patina_sre/src/lib.rs:27

  • Minor grammar issue in this comment: “the same patina source patina_sre uses” reads awkwardly and is missing “that”.
// Re-export the patina device-path types SreBootManager::new consumes so
// platform binaries don't need to depend on the same patina source patina_sre
// uses. Constructing DevicePathBuf via these re-exports

uefi/SrePkg/Application/NvmeBpWrite/Flash-BP1.md:77

  • In this table row, SRE_NVMEBPWRITE_EFI is an environment variable, but it’s formatted differently than later references ($env:SRE_NVMEBPWRITE_EFI). Using the $env: form here would be clearer and consistent.
| [`Stage-SreflashUsb.ps1`](./Stage-SreflashUsb.ps1) | workstation | Format-free staging: copies the tool, the WIM, and the three target-side helpers onto a removable FAT32 USB. Accepts `-ToolPath`, `SRE_NVMEBPWRITE_EFI`, or a sibling binary. Replaces Section 1. |

Remove internal onboarding details, private platform paths, device codenames, and hard-coded test environment defaults. Keep reusable recovery tooling platform-neutral through explicit inputs.

Assisted-by: GitHub Copilot:gpt-5.6-sol
Correct the patina_sre re-export comment and describe the recovery artifact without referring to a removed zip or internal artifact system.

Assisted-by: GitHub Copilot:gpt-5.6-sol
Copilot AI review requested due to automatic review settings August 13, 2026 21:25
@kat-perez
kat-perez force-pushed the scrub-sensitive-references branch from 330953e to a7e10c0 Compare August 13, 2026 21:25

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.

Pull request overview

Copilot reviewed 10 out of 10 changed files in this pull request and generated no new comments.

Suppressed comments (3)

uefi/SrePkg/Application/BpRecoveryLoader/Run-WinVosFromBp.ps1:70

  • These mandatory parameters are intended to be explicitly provided, but PowerShell will still accept empty strings and only fail later with harder-to-diagnose errors (e.g., New-PSSession with an empty computer name). Add ValidateNotNullOrEmpty for earlier, clearer validation.
    [Parameter(Mandatory = $true)] [string] $DutHost,
    [System.Management.Automation.PSCredential] $DutCredential,
    [string] $UsbDrive,
    [Parameter(Mandatory = $true)] [string] $NvmeBpWriteEfi,
    [Parameter(Mandatory = $true)] [string] $BpRecoveryLoaderEfi,

uefi/SrePkg/Application/BpRecoveryLoader/Run-WinVosFromBp.ps1:65

  • Mandatory string parameters can still be passed as an empty string (e.g., -WimFile ''), which defeats the intent of requiring explicit inputs and leads to less clear failures later (like Test-Path on an empty path). Add ValidateNotNullOrEmpty to enforce a real value at argument binding time.

This issue also appears on line 66 of the same file.

    [Parameter(Mandatory = $true)] [string] $WimFile,

uefi/SrePkg/Application/BpRecoveryLoader/Run-WinVosFromBp.ps1:89

  • The updated exception message for missing EFI files no longer gives the operator any hint on how to resolve it. Keeping the error platform-neutral is fine, but it should still say that the caller must pass paths to the built .efi binaries via the script parameters.
foreach ($p in @($NvmeBpWriteEfi, $BpRecoveryLoaderEfi)) {
    if (-not (Test-Path $p)) { throw "Required EFI not found: $p" }
}

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