mirror of
https://github.com/rbalsleyMSFT/FFU.git
synced 2026-06-13 18:07:20 -06:00
Uses ADK BCDBoot to prevent issues with devices that have updated Secureboot certificates from using 2023 signed boot files
This commit is contained in:
@@ -464,7 +464,7 @@ param(
|
|||||||
[switch]$Cleanup
|
[switch]$Cleanup
|
||||||
)
|
)
|
||||||
$ProgressPreference = 'SilentlyContinue'
|
$ProgressPreference = 'SilentlyContinue'
|
||||||
$version = '2603.1'
|
$version = '2603.2'
|
||||||
|
|
||||||
# Remove any existing modules to avoid conflicts
|
# Remove any existing modules to avoid conflicts
|
||||||
if (Get-Module -Name 'FFU.Common.Core' -ErrorAction SilentlyContinue) {
|
if (Get-Module -Name 'FFU.Common.Core' -ErrorAction SilentlyContinue) {
|
||||||
@@ -2781,11 +2781,25 @@ function Add-BootFiles {
|
|||||||
[string]$OsPartitionDriveLetter,
|
[string]$OsPartitionDriveLetter,
|
||||||
[Parameter(Mandatory = $true)]
|
[Parameter(Mandatory = $true)]
|
||||||
[string]$SystemPartitionDriveLetter,
|
[string]$SystemPartitionDriveLetter,
|
||||||
|
[Parameter(Mandatory = $true)]
|
||||||
|
[string]$AdkPath,
|
||||||
|
[Parameter(Mandatory = $true)]
|
||||||
|
[ValidateSet('x86', 'x64', 'arm64')]
|
||||||
|
[string]$WindowsArch,
|
||||||
[string]$FirmwareType = 'UEFI'
|
[string]$FirmwareType = 'UEFI'
|
||||||
)
|
)
|
||||||
|
|
||||||
WriteLog "Adding boot files for `"$($OsPartitionDriveLetter):\Windows`" to System partition `"$($SystemPartitionDriveLetter):`"..."
|
# Use the ADK copy of BCDBoot so the boot binaries come from the validated ADK toolset
|
||||||
Invoke-Process bcdboot "$($OsPartitionDriveLetter):\Windows /S $($SystemPartitionDriveLetter): /F $FirmwareType" | Out-Null
|
# 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."
|
WriteLog "Done."
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -7025,7 +7039,7 @@ try {
|
|||||||
|
|
||||||
WriteLog 'All necessary partitions created.'
|
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
|
#Add Windows packages
|
||||||
if ($UpdateLatestCU -or $UpdateLatestNet -or $UpdatePreviewCU ) {
|
if ($UpdateLatestCU -or $UpdateLatestNet -or $UpdatePreviewCU ) {
|
||||||
|
|||||||
@@ -835,7 +835,7 @@ $LogFileName = 'ScriptLog.txt'
|
|||||||
$USBDrive = Get-USBDrive
|
$USBDrive = Get-USBDrive
|
||||||
New-item -Path $USBDrive -Name $LogFileName -ItemType "file" -Force | Out-Null
|
New-item -Path $USBDrive -Name $LogFileName -ItemType "file" -Force | Out-Null
|
||||||
$LogFile = $USBDrive + $LogFilename
|
$LogFile = $USBDrive + $LogFilename
|
||||||
$version = '2603.1'
|
$version = '2603.2'
|
||||||
WriteLog 'Begin Logging'
|
WriteLog 'Begin Logging'
|
||||||
WriteLog "Script version: $version"
|
WriteLog "Script version: $version"
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user