Selectable windows versions

This commit is contained in:
Thomas Lovén 2025-08-28 09:51:37 +02:00
parent 37a655ce02
commit deb232aa0f
5 changed files with 211 additions and 1 deletions

9
.gitignore vendored
View File

@ -1,11 +1,18 @@
**/*
**/**
!docker-compose.yaml
!.gitignore
!Readme.md
!build
!build/*
!assets/
!assets/win-pe
!assets/win-pe/configs
!assets/win-pe/configs/*
assets/win-pe/configs/*.xml
!/config
!/config/menus/
!/config/menus/windows.ipxe
!/config/menus/menu.ipxe

View File

@ -0,0 +1,16 @@
@echo off
set SERVER=10.0.0.9
set SHARE=assets
set SETUP_PATH=windows\win-os\win11
set UNATTEND_PATH=win-pe\configs
wpeinit
ping 127.0.0.1 -n 10 > nul
ping %SERVER% -n 4
net use F: \\%SERVER%\%SHARE%
F:\%SETUP_PATH%\setup.exe /unattend:F:\%UNATTEND_PATH%\autounattend_big.xml
pause

View File

@ -0,0 +1,16 @@
@echo off
set SERVER=10.0.0.9
set SHARE=assets
set SETUP_PATH=windows\win-os\win11
set UNATTEND_PATH=win-pe\configs
wpeinit
ping 127.0.0.1 -n 10 > nul
ping %SERVER% -n 4
net use F: \\%SERVER%\%SHARE%
F:\%SETUP_PATH%\setup.exe /unattend:F:\%UNATTEND_PATH%\autounattend_small.xml
pause

107
config/menus/menu.ipxe Normal file
View File

@ -0,0 +1,107 @@
#!ipxe
:start
isset ${arch} && goto skip_arch_detect ||
cpuid --ext 29 && set arch x86_64 || set arch i386
iseq ${buildarch} arm64 && set arch arm64 ||
:skip_arch_detect
chain --autofree boot.cfg ||
echo Attempting to retrieve latest upstream version number...
chain --timeout 5000 https://boot.netboot.xyz/version.ipxe ||
ntp 0.pool.ntp.org ||
iseq ${cls} serial && goto ignore_cls ||
set cls:hex 1b:5b:4a # ANSI clear screen sequence - "^[[J"
set cls ${cls:string}
:ignore_cls
isset ${menu} && goto ${menu} ||
isset ${ip} || dhcp
:main_menu
clear menu
set space:hex 20:20
set space ${space:string}
isset ${next-server} && menu ${site_name} v${version} - next-server: ${next-server} || menu ${site_name}
item --gap Default:
item local ${space} Boot from local hdd
item --gap Distributions:
iseq ${menu_linux} 1 && item linux ${space} Linux Network Installs (64-bit) ||
iseq ${menu_linux_i386} 1 && item linux-i386 ${space} Linux Network Installs (32-bit) ||
iseq ${menu_linux_arm} 1 && item linux-arm ${space} Linux Network Installs (arm64) ||
iseq ${menu_live} 1 && item live ${space} Live CDs ||
iseq ${menu_live_arm} 1 && item live-arm ${space} Live CDs ||
iseq ${menu_bsd} 1 && item bsd ${space} BSD Installs ||
iseq ${menu_unix} 1 && item unix ${space} Unix Network Installs ||
iseq ${menu_freedos} 1 && item freedos ${space} FreeDOS ||
iseq ${menu_windows} 1 && item windows ${space} Windows ||
item vdi ${space} VDI
item --gap Tools:
iseq ${menu_utils} 1 && iseq ${platform} efi && item utils-efi ${space} Utilities (UEFI) ||
iseq ${menu_utils} 1 && iseq ${platform} pcbios && iseq ${arch} x86_64 && item utils-pcbios-64 ${space} Utilities (64-bit) ||
iseq ${menu_utils} 1 && iseq ${platform} pcbios && iseq ${arch} i386 && item utils-pcbios-32 ${space} Utilities (32-bit) ||
iseq ${menu_utils_arm} 1 && item utils-arm ${space} Utilities (arm64) ||
item change_arch ${space} Architecture: ${arch}
item shell ${space} iPXE shell
item netinfo ${space} Network card info
iseq ${menu_pci} 1 && item lspci ${space} PCI Device List ||
item about ${space} About netboot.xyz
item --gap Signature Checks:
item sig_check ${space} netboot.xyz [ enabled: ${sigs_enabled} ]
isset ${github_user} && item --gap Custom Github Menu: ||
isset ${github_user} && item custom-github ${space} ${github_user}'s Custom Menu ||
isset ${custom_url} && item --gap Custom URL Menu: ||
isset ${custom_url} && item custom-url ${space} Custom URL Menu ||
isset ${menu} && set timeout 0 || set timeout ${boot_timeout}
choose --timeout ${timeout} --default ${menu} menu || goto local
echo ${cls}
goto ${menu} ||
iseq ${sigs_enabled} true && goto verify_sigs || goto change_menu
:verify_sigs
imgverify ${menu}.ipxe ${sigs}${menu}.ipxe.sig || goto error
goto change_menu
:change_menu
chain ${menu}.ipxe || goto error
goto main_menu
:error
echo Error occurred, press any key to return to menu ...
prompt
goto main_menu
:local
echo Booting from local disks ...
exit 1
:shell
echo Type "exit" to return to menu.
set menu main_menu
shell
goto main_menu
:change_arch
iseq ${arch} x86_64 && set arch i386 && set menu_linux_i386 1 && set menu_linux 0 && goto main_menu ||
iseq ${arch} i386 && set arch x86_64 && set menu_linux_i386 0 && set menu_linux 1 && goto main_menu ||
goto main_menu
:sig_check
iseq ${sigs_enabled} true && set sigs_enabled false || set sigs_enabled true
goto main_menu
:about
chain https://boot.netboot.xyz/about.ipxe || chain about.ipxe
goto main_menu
:custom-github
chain https://raw.githubusercontent.com/${github_user}/netboot.xyz-custom/master/custom.ipxe || goto error
goto main_menu
:custom-url
chain ${custom_url}/custom.ipxe || goto error
goto main_menu
:custom-user
chain custom/custom.ipxe
goto main_menu

64
config/menus/windows.ipxe Normal file
View File

@ -0,0 +1,64 @@
#!ipxe
# Microsoft Windows
# https://www.microsoft.com
set win_arch x64
set win_size small
goto ${menu} ||
:windows
set os Microsoft Windows
clear win_version
menu ${os}
item --gap Installers
item win_install ${space} Load ${os} Installer...
item --gap Options:
item arch_set ${space} Architecture [ ${win_arch} ]
imtem size_set ${space} Preinstalled software package [ ${win_size} ]
item url_set ${space} Base URL [ ${win_base_url} ]
choose win_version || goto windows_exit
goto ${win_version}
:arch_set
iseq ${win_arch} x64 && set win_arch x86 || set win_arch x64
goto windows
:size_set
iseq ${win_size} small && set win_size large || set win_size small
:url_set
echo Set the HTTP URL of an extracted Windows ISO without the trailing slash:
echo e.g. http://www.mydomain.com/windows
echo
echo -n URL: ${} && read win_base_url
echo
echo netboot.xyz will attempt to load the following files:
echo ${win_base_url}/${win_arch}/bootmgr
echo ${win_base_url}/${win_arch}/bootmgr.efi
echo ${win_base_url}/${win_arch}/boot/bcd
echo ${win_base_url}/${win_arch}/boot/boot.sdi
echo ${win_base_url}/${win_arch}/sources/boot.wim
echo
prompt Press any key to return to Windows Menu...
goto windows
:win_install
isset ${win_base_url} && goto boot || echo URL not set... && goto url_set
:boot
imgfree
kernel http://${boot_domain}/wimboot
initrd ${win_base_url}/configs/auto_${win_size}.bat auto.bat
initrd ${win_base_url}/configs/winpeshl.ini winpeshl.ini
initrd -n bootmgr ${win_base_url}/${win_arch}/bootmgr bootmgr ||
initrd -n bootmgr.efi ${win_base_url}/${win_arch}/bootmgr.efi bootmgr.efi ||
initrd -n bcd ${win_base_url}/${win_arch}/boot/bcd bcd ||
initrd -n bcd ${win_base_url}/${win_arch}/Boot/BCD bcd ||
initrd -n boot.sdi ${win_base_url}/${win_arch}/boot/boot.sdi boot.sdi ||
initrd -n boot.sdi ${win_base_url}/${win_arch}/Boot/boot.sdi boot.sdi ||
initrd -n boot.wim ${win_base_url}/${win_arch}/sources/boot.wim boot.wim
boot
:windows_exit
exit 0