Forum Discussion
MBR2GPT Disk layout validation failed
Last but not least, an x86 (32-bit) WinPE ISO creation script / batch file for MBR2GPT tasks, or other things like that. These all use the latest ADK. I also did not find any big issues so far. For the ARM / ARM64 images, there was only a single bootloader available unfortunately (which probably doesn't matter.) This seems like a recurring issue btw, which is why it may look like I'm necroing an old post (I'm just updating this to make the same problem a lot easier to solve in 2022.) This and the 64-bit one both have MBR and UEFI bootloaders on the same image. There is only a choice of UEFI with the ARM / ARM64 ones anyways. I would've customized them in the same way, but I don't think that even matters, given ARM PCs and embedded boards are relatively new. There would be no BSP files (Board Support Package files,) anyways if it didn't support it to begin with, so you would already KNOW what you were installing this on before you started (typically it's a tablet, a small server board, HTPC, or some type of newer SBC / Single Board Computer.) Feel free to edit these to your liking (add cumulative updates, power profiles and whatnot, etc.)
@ECHO OFF
SETLOCAL
REM NOTE: This could ONLY work when the ADK with the WinPE addon is ALREADY installed, and this batch file is run from the environment itself.
REM NOTE: Some of the syntax / arguments have to be changed, such as the path for the USB Drive (if this is going to work properly.)
REM NOTE: These 3 lines below show how to INSTALL the ADK and WinPE Addon first ->
REM "Download the Windows ADK for Windows 11" -> https://docs.microsoft.com/en-us/windows-hardware/get-started/adk-install#download-the-adk-for-windows-11
REM "Download the Windows ADK for Windows 11" -> https://go.microsoft.com/fwlink/?linkid=2165884
REM "Download the Windows PE add-on for the ADK" -> https://go.microsoft.com/fwlink/?linkid=2166133
REM https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/winpe-create-usb-bootable-drive#create-a-bootable-winpe-usb-drive
REM https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/winpe-adding-powershell-support-to-windows-pe
REM https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/winpe-mount-and-customize
REM https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/winpe-optimize
REM NOTE: Run this first from the "Deployment and Imaging Tools Environment" Command Prompt: copype X86 "C:\WinPE_X86_PS"
REM ----------------------------------------------------------------------------------------------------
DISM /Mount-Image /ImageFile:"C:\WinPE_X86_PS\media\sources\boot.wim" /Index:1 /MountDir:"C:\WinPE_X86_PS\mount"
REM NOTE: "By default, this is 512MB for PCs with more than 1GB of RAM, otherwise the default is 32MB. Valid values are 32, 64, 128, 256, or 512."
REM DISM /Set-ScratchSpace:64 /Image:"C:\WinPE_X86_PS\mount"
MKDIR "C:\Scritch_Scratch"
DISM /Add-Package /Image:"C:\WinPE_X86_PS\mount" /ScratchDir:"C:\Scritch_Scratch" /PackagePath:"C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment\x86\WinPE_OCs\en-us\lp.cab"
DISM /Add-Package /Image:"C:\WinPE_X86_PS\mount" /ScratchDir:"C:\Scritch_Scratch" /PackagePath:"C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment\x86\WinPE_OCs\WinPE-Fonts-Legacy.cab"
DISM /Add-Package /Image:"C:\WinPE_X86_PS\mount" /ScratchDir:"C:\Scritch_Scratch" /PackagePath:"C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment\x86\WinPE_OCs\WinPE-FontSupport-WinRE.cab"
DISM /Add-Package /Image:"C:\WinPE_X86_PS\mount" /ScratchDir:"C:\Scritch_Scratch" /PackagePath:"C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment\x86\WinPE_OCs\WinPE-WMI.cab"
DISM /Add-Package /Image:"C:\WinPE_X86_PS\mount" /ScratchDir:"C:\Scritch_Scratch" /PackagePath:"C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment\x86\WinPE_OCs\en-us\WinPE-WMI_en-us.cab"
DISM /Add-Package /Image:"C:\WinPE_X86_PS\mount" /ScratchDir:"C:\Scritch_Scratch" /PackagePath:"C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment\x86\WinPE_OCs\WinPE-NetFx.cab"
DISM /Add-Package /Image:"C:\WinPE_X86_PS\mount" /ScratchDir:"C:\Scritch_Scratch" /PackagePath:"C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment\x86\WinPE_OCs\en-us\WinPE-NetFx_en-us.cab"
DISM /Add-Package /Image:"C:\WinPE_X86_PS\mount" /ScratchDir:"C:\Scritch_Scratch" /PackagePath:"C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment\x86\WinPE_OCs\WinPE-Scripting.cab"
DISM /Add-Package /Image:"C:\WinPE_X86_PS\mount" /ScratchDir:"C:\Scritch_Scratch" /PackagePath:"C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment\x86\WinPE_OCs\en-us\WinPE-Scripting_en-us.cab"
DISM /Add-Package /Image:"C:\WinPE_X86_PS\mount" /ScratchDir:"C:\Scritch_Scratch" /PackagePath:"C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment\x86\WinPE_OCs\WinPE-PowerShell.cab"
DISM /Add-Package /Image:"C:\WinPE_X86_PS\mount" /ScratchDir:"C:\Scritch_Scratch" /PackagePath:"C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment\x86\WinPE_OCs\en-us\WinPE-PowerShell_en-us.cab"
DISM /Add-Package /Image:"C:\WinPE_X86_PS\mount" /ScratchDir:"C:\Scritch_Scratch" /PackagePath:"C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment\x86\WinPE_OCs\WinPE-StorageWMI.cab"
DISM /Add-Package /Image:"C:\WinPE_X86_PS\mount" /ScratchDir:"C:\Scritch_Scratch" /PackagePath:"C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment\x86\WinPE_OCs\en-us\WinPE-StorageWMI_en-us.cab"
DISM /Add-Package /Image:"C:\WinPE_X86_PS\mount" /ScratchDir:"C:\Scritch_Scratch" /PackagePath:"C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment\x86\WinPE_OCs\WinPE-DISMCmdlets.cab"
DISM /Add-Package /Image:"C:\WinPE_X86_PS\mount" /ScratchDir:"C:\Scritch_Scratch" /PackagePath:"C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment\x86\WinPE_OCs\en-us\WinPE-DISMCmdlets_en-us.cab"
DISM /Add-Package /Image:"C:\WinPE_X86_PS\mount" /ScratchDir:"C:\Scritch_Scratch" /PackagePath:"C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment\x86\WinPE_OCs\WinPE-SecureBootCmdlets.cab"
DISM /Add-Package /Image:"C:\WinPE_X86_PS\mount" /ScratchDir:"C:\Scritch_Scratch" /PackagePath:"C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment\x86\WinPE_OCs\WinPE-SecureStartup.cab"
DISM /Add-Package /Image:"C:\WinPE_X86_PS\mount" /ScratchDir:"C:\Scritch_Scratch" /PackagePath:"C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment\x86\WinPE_OCs\en-us\WinPE-SecureStartup_en-us.cab"
DISM /Add-Package /Image:"C:\WinPE_X86_PS\mount" /ScratchDir:"C:\Scritch_Scratch" /PackagePath:"C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment\x86\WinPE_OCs\WinPE-PlatformId.cab"
DISM /Add-Package /Image:"C:\WinPE_X86_PS\mount" /ScratchDir:"C:\Scritch_Scratch" /PackagePath:"C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment\x86\WinPE_OCs\WinPE-WinReCfg.cab"
DISM /Add-Package /Image:"C:\WinPE_X86_PS\mount" /ScratchDir:"C:\Scritch_Scratch" /PackagePath:"C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment\x86\WinPE_OCs\en-us\WinPE-WinReCfg_en-us.cab"
DISM /Add-Package /Image:"C:\WinPE_X86_PS\mount" /ScratchDir:"C:\Scritch_Scratch" /PackagePath:"C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment\x86\WinPE_OCs\WinPE-PPPoE.cab"
DISM /Add-Package /Image:"C:\WinPE_X86_PS\mount" /ScratchDir:"C:\Scritch_Scratch" /PackagePath:"C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment\x86\WinPE_OCs\en-us\WinPE-PPPoE_en-us.cab"
DISM /Add-Package /Image:"C:\WinPE_X86_PS\mount" /ScratchDir:"C:\Scritch_Scratch" /PackagePath:"C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment\x86\WinPE_OCs\WinPE-RNDIS.cab"
DISM /Add-Package /Image:"C:\WinPE_X86_PS\mount" /ScratchDir:"C:\Scritch_Scratch" /PackagePath:"C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment\x86\WinPE_OCs\en-us\WinPE-RNDIS_en-us.cab"
DISM /Add-Package /Image:"C:\WinPE_X86_PS\mount" /ScratchDir:"C:\Scritch_Scratch" /PackagePath:"C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment\x86\WinPE_OCs\WinPE-HTA.cab"
DISM /Add-Package /Image:"C:\WinPE_X86_PS\mount" /ScratchDir:"C:\Scritch_Scratch" /PackagePath:"C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment\x86\WinPE_OCs\en-us\WinPE-HTA_en-us.cab"
DISM /Add-Package /Image:"C:\WinPE_X86_PS\mount" /ScratchDir:"C:\Scritch_Scratch" /PackagePath:"C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment\x86\WinPE_OCs\WinPE-Dot3Svc.cab"
DISM /Add-Package /Image:"C:\WinPE_X86_PS\mount" /ScratchDir:"C:\Scritch_Scratch" /PackagePath:"C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment\x86\WinPE_OCs\en-us\WinPE-Dot3Svc_en-us.cab"
DISM /Add-Package /Image:"C:\WinPE_X86_PS\mount" /ScratchDir:"C:\Scritch_Scratch" /PackagePath:"C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment\x86\WinPE_OCs\WinPE-EnhancedStorage.cab"
DISM /Add-Package /Image:"C:\WinPE_X86_PS\mount" /ScratchDir:"C:\Scritch_Scratch" /PackagePath:"C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment\x86\WinPE_OCs\en-us\WinPE-EnhancedStorage_en-us.cab"
DISM /Add-Package /Image:"C:\WinPE_X86_PS\mount" /ScratchDir:"C:\Scritch_Scratch" /PackagePath:"C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment\x86\WinPE_OCs\WinPE-FMAPI.cab"
DISM /Add-Package /Image:"C:\WinPE_X86_PS\mount" /ScratchDir:"C:\Scritch_Scratch" /PackagePath:"C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment\x86\WinPE_OCs\WinPE-WDS-Tools.cab"
DISM /Add-Package /Image:"C:\WinPE_X86_PS\mount" /ScratchDir:"C:\Scritch_Scratch" /PackagePath:"C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment\x86\WinPE_OCs\en-us\WinPE-WDS-Tools_en-us.cab"
DISM /Cleanup-Image /Image:"C:\WinPE_X86_PS\mount" /ScratchDir:"C:\Scritch_Scratch" /StartComponentCleanup /ResetBase
REM NOTE: The following requires: "Sysinternals Suite" -> https://docs.microsoft.com/en-us/sysinternals/downloads/sysinternals-suite
COPY "C:\SysinternalsSuite\Sdelete.exe" "C:\WinPE_X86_PS\mount\windows\system32"
DISM /Image:"C:\WinPE_X86_PS\mount" /ScratchDir:"C:\Scritch_Scratch" /Optimize-Image /Boot
DISM /Unmount-Image /MountDir:"C:\WinPE_X86_PS\mount" /Commit
DISM /Cleanup-Mountpoints
RMDIR /S /Q "C:\Scritch_Scratch"
DISM /Export-Image /SourceImageFile:"C:\WinPE_X86_PS\media\sources\boot.wim" /SourceIndex:1 /DestinationImageFile:"C:\WinPE_X86_PS\mount\boot2.wim"
DEL "C:\WinPE_X86_PS\media\sources\boot.wim"
COPY "C:\WinPE_X86_PS\mount\boot2.wim" "C:\WinPE_X86_PS\media\sources\boot.wim"
DEL "C:\WinPE_X86_PS\mount\boot2.wim"
REM NOTE: The following can only be run from the "Deployment and Imaging Tools Environment" Command Prompt:
REM NOTE: Choose one or the other below, pick whatever output directory and name works:
REM MakeWinPEMedia /ISO C:\WinPE_x86_PS C:\WinPE_X86_PS\WinPE_X86_PS.iso
REM MakeWinPEMedia /UFD C:\WinPE_x86_PS G:
REM oscdimg -m -o -u1 -udfver102 -lWIN_PE_X86 -bootdata:2#p0,e,b"C:\WinPE_X86_PS\fwfiles\etfsboot.com"#pEF,e,b"C:\WinPE_X86_PS\fwfiles\efisys.bin" "C:\WinPE_X86_PS\media" "C:\ISO\WinPE_English_x86.iso"