Compare commits

...

3 Commits

Author SHA1 Message Date
rbalsleyMSFT 65e52bb554 Updates boot file generation to use ADK BCDBoot
Addresses potential inconsistencies with Secure Boot servicing states by using the validated ADK toolset's BCDBoot instead of relying on the local OS installation. Passed ADK path and architecture parameters are now utilized to ensure boot binaries remain consistent across environments.
2026-03-13 16:32:02 -07:00
rbalsleyMSFT c20829a72c Removes WinPE-SecureBootCmdlets_en_us.cab reference as that doesn't exist. 2026-03-13 09:21:27 -07:00
rbalsleyMSFT 7670ab886c Adds Secure Boot deployment diagnostics
Includes Secure Boot support in the PE image so firmware variables can be inspected during imaging.

Captures baseline, post-apply, and final boot evidence for firmware state, storage layout, boot files, and boot configuration to explain UEFI boot failures and highlight likely dbx blocks or boot entry issues.
2026-03-12 15:59:04 -07:00
3 changed files with 1587 additions and 8 deletions
+18 -3
View File
@@ -2781,11 +2781,25 @@ function Add-BootFiles {
[string]$OsPartitionDriveLetter,
[Parameter(Mandatory = $true)]
[string]$SystemPartitionDriveLetter,
[Parameter(Mandatory = $true)]
[string]$AdkPath,
[Parameter(Mandatory = $true)]
[ValidateSet('x86', 'x64', 'arm64')]
[string]$WindowsArch,
[string]$FirmwareType = 'UEFI'
)
WriteLog "Adding boot files for `"$($OsPartitionDriveLetter):\Windows`" to System partition `"$($SystemPartitionDriveLetter):`"..."
Invoke-Process bcdboot "$($OsPartitionDriveLetter):\Windows /S $($SystemPartitionDriveLetter): /F $FirmwareType" | Out-Null
# Use the ADK copy of BCDBoot so the boot binaries come from the validated ADK toolset
# instead of the local OS installation, which can differ based on Secure Boot servicing state.
$bcdBootArchitecture = if ($WindowsArch -ieq 'arm64') { 'arm64' } else { 'amd64' }
$bcdBootPath = Join-Path $AdkPath "Assessment and Deployment Kit\Deployment Tools\$bcdBootArchitecture\BCDBoot\bcdboot.exe"
if (-not (Test-Path -Path $bcdBootPath)) {
throw "ADK BCDBoot was not found at $bcdBootPath"
}
WriteLog "Adding boot files for `"$($OsPartitionDriveLetter):\Windows`" to System partition `"$($SystemPartitionDriveLetter):`" using ADK BCDBoot at `"$bcdBootPath`"..."
Invoke-Process $bcdBootPath "$($OsPartitionDriveLetter):\Windows /S $($SystemPartitionDriveLetter): /F $FirmwareType" | Out-Null
WriteLog "Done."
}
@@ -3414,6 +3428,7 @@ function New-PEMedia {
"en-us\WinPE-Scripting_en-us.cab",
"WinPE-PowerShell.cab",
"en-us\WinPE-PowerShell_en-us.cab",
"WinPE-SecureBootCmdlets.cab",
"WinPE-StorageWMI.cab",
"en-us\WinPE-StorageWMI_en-us.cab",
"WinPE-DismCmdlets.cab",
@@ -7025,7 +7040,7 @@ try {
WriteLog 'All necessary partitions created.'
Add-BootFiles -OsPartitionDriveLetter $osPartitionDriveLetter -SystemPartitionDriveLetter $systemPartitionDriveLetter[1]
Add-BootFiles -OsPartitionDriveLetter $osPartitionDriveLetter -SystemPartitionDriveLetter $systemPartitionDriveLetter[1] -AdkPath $adkPath -WindowsArch $WindowsArch
#Add Windows packages
if ($UpdateLatestCU -or $UpdateLatestNet -or $UpdatePreviewCU ) {
+1
View File
@@ -115,6 +115,7 @@ function New-PEMedia {
"en-us\WinPE-Scripting_en-us.cab",
"WinPE-PowerShell.cab",
"en-us\WinPE-PowerShell_en-us.cab",
"WinPE-SecureBootCmdlets.cab",
"WinPE-StorageWMI.cab",
"en-us\WinPE-StorageWMI_en-us.cab",
"WinPE-DismCmdlets.cab",
File diff suppressed because it is too large Load Diff