From f295d1c034d19167fc24beb728bc4fefb6521035 Mon Sep 17 00:00:00 2001 From: Bernhard Suttner Date: Thu, 26 Sep 2024 11:50:28 +0200 Subject: [PATCH] Fixes #37862 - Support EFI boot on windows --- .../provisioning_templates/iPXE/windows_default_ipxe.erb | 8 ++++++++ .../iPXE/windows_default_ipxe_httpboot.erb | 8 ++++++++ 2 files changed, 16 insertions(+) diff --git a/app/views/unattended/provisioning_templates/iPXE/windows_default_ipxe.erb b/app/views/unattended/provisioning_templates/iPXE/windows_default_ipxe.erb index 5268d03a907..f14de11bd63 100644 --- a/app/views/unattended/provisioning_templates/iPXE/windows_default_ipxe.erb +++ b/app/views/unattended/provisioning_templates/iPXE/windows_default_ipxe.erb @@ -19,8 +19,16 @@ ping --count 1 ${netX/dns} || echo Ping to DNS failed or ping command not availa set boot-url tftp://<%= foreman_request_addr %>/ kernel ${boot-url}<%= @host.operatingsystem.bootfile(medium_provider,:kernel) %> +iseq ${platform} efi && goto win_efi || goto win_legacy + +:win_efi +initrd -n peSetup.cmd <%= foreman_url('script') %> peSetup.cmd +goto boot + +:win_legacy initrd <%= foreman_url('script') %> peSetup.cmd +:boot initrd ${boot-url}<%= @host.operatingsystem.bootfile(medium_provider,:bcd) %> BCD initrd ${boot-url}<%= @host.operatingsystem.bootfile(medium_provider,:bootsdi) %> boot.sdi initrd ${boot-url}<%= @host.operatingsystem.bootfile(medium_provider,:bootwim) %> boot.wim diff --git a/app/views/unattended/provisioning_templates/iPXE/windows_default_ipxe_httpboot.erb b/app/views/unattended/provisioning_templates/iPXE/windows_default_ipxe_httpboot.erb index 8e9bbba3632..0be17ad4357 100644 --- a/app/views/unattended/provisioning_templates/iPXE/windows_default_ipxe_httpboot.erb +++ b/app/views/unattended/provisioning_templates/iPXE/windows_default_ipxe_httpboot.erb @@ -14,8 +14,16 @@ description: | set boot-url http://<%= foreman_request_addr %>/httpboot/ kernel ${boot-url}<%= @host.operatingsystem.bootfile(medium_provider,:kernel) %> +iseq ${platform} efi && goto win_efi || goto win_legacy + +:win_efi +initrd -n peSetup.cmd <%= foreman_url('script') %> peSetup.cmd +goto boot + +:win_legacy initrd <%= foreman_url('script') %> peSetup.cmd +:boot initrd ${boot-url}<%= @host.operatingsystem.bootfile(medium_provider,:bcd) %> BCD initrd ${boot-url}<%= @host.operatingsystem.bootfile(medium_provider,:bootsdi) %> boot.sdi initrd ${boot-url}<%= @host.operatingsystem.bootfile(medium_provider,:bootwim) %> boot.wim