mirror of
https://github.com/rbalsleyMSFT/FFU.git
synced 2026-06-14 02:09:35 -06:00
fixed a bug when $installdrivers set to $false the FFU would fail to optimize
This commit is contained in:
@@ -854,15 +854,16 @@ function New-FFU {
|
|||||||
Dismount-ScratchVhdx -VhdxPath $VHDXPath
|
Dismount-ScratchVhdx -VhdxPath $VHDXPath
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#Without this 120 second sleep, we sometimes see an error when mounting the FFU due to a file handle lock. Needed for both driver and optimize steps.
|
||||||
|
WriteLog 'Sleeping 2 minutes to prevent file handle lock'
|
||||||
|
Start-Sleep 120
|
||||||
|
|
||||||
#Add drivers
|
#Add drivers
|
||||||
If ($InstallDrivers) {
|
If ($InstallDrivers) {
|
||||||
WriteLog 'Adding drivers'
|
WriteLog 'Adding drivers'
|
||||||
WriteLog "Creating $FFUDevelopmentPath\Mount directory"
|
WriteLog "Creating $FFUDevelopmentPath\Mount directory"
|
||||||
New-Item -Path "$FFUDevelopmentPath\Mount" -ItemType Directory -Force | Out-Null
|
New-Item -Path "$FFUDevelopmentPath\Mount" -ItemType Directory -Force | Out-Null
|
||||||
WriteLog "Created $FFUDevelopmentPath\Mount directory"
|
WriteLog "Created $FFUDevelopmentPath\Mount directory"
|
||||||
#Without this 120 second sleep, we sometimes see an error when mounting the FFU due to a file handle lock
|
|
||||||
WriteLog 'Sleeping 2 minutes to prevent file handle lock'
|
|
||||||
Start-Sleep 120
|
|
||||||
WriteLog "Mounting $FFUFile to $FFUDevelopmentPath\Mount"
|
WriteLog "Mounting $FFUFile to $FFUDevelopmentPath\Mount"
|
||||||
Mount-WindowsImage -ImagePath $FFUFile -Index 1 -Path "$FFUDevelopmentPath\Mount" | Out-null
|
Mount-WindowsImage -ImagePath $FFUFile -Index 1 -Path "$FFUDevelopmentPath\Mount" | Out-null
|
||||||
WriteLog 'Mounting complete'
|
WriteLog 'Mounting complete'
|
||||||
|
|||||||
Reference in New Issue
Block a user