๐ Trouble with Syslinux PXEBOOT: Need Help Combining EFI and Legacy Modes
๐ก Newskategorie: Linux Tipps
๐ Quelle: reddit.com
Hi guys,
I created a small batch file for deploying Syslinux PXEBOOT for WDS. It works partially; I am able to boot in EFI mode, and Syslinux shows up. I can also boot into Blancco, the Ubuntu installer, and load a Windows ISO, but I am unable to use the first menu.
As you can see in the script, nearly all files are copied from efi64, and probably this is the issue. When the client is booted in EFI mode, it uses EFI files and interpreters. Therefore, when selecting "Windows Deployment Services," nothing happens. At this moment, Legacy mode also doesn't work.
Is there any way to combine both EFI and Legacy modes? What should I do to make the first entry work in EFI mode?
โ
:: Download syslinux version 6.03
echo Downloading syslinux-6.03...
powershell -Command "Invoke-WebRequest
https://mirrors.edge.kernel.org/pub/linux/utils/boot/syslinux/syslinux-6.03.zip
-OutFile
syslinux-6.03.zip
"
:: Extract files from the syslinux archive
echo Extracting syslinux-6.03...
powershell Expand-Archive -Path "
syslinux-6.03.zip
" -DestinationPath "syslinux-6.03"
:: Copy EFI syslinux files for x64
โ
net stop wdsserver
โ
copy "syslinux-6.03\bios\core\pxelinux.0" "c:\remoteinstall\boot\x64\pxelinux.0"
copy "syslinux-6.03\efi64\efi\syslinux.efi" "c:\remoteinstall\boot\x64\syslinux.efi"
copy "syslinux-6.03\efi64\com32\elflink\ldlinux\ldlinux.e64" "c:\remoteinstall\boot\x64\ldlinux.e64"
copy "syslinux-6.03\efi32\com32\elflink\ldlinux\ldlinux.e32" "c:\remoteinstall\boot\x64\ldlinux.e32"
copy "syslinux-6.03\bios\com32\elflink\ldlinux\ldlinux.c32" "c:\remoteinstall\boot\x64\ldlinux.c32"
copy "syslinux-6.03\efi64\com32\menu\menu.c32" "c:\remoteinstall\boot\x64\menu.c32"
copy "syslinux-6.03\efi64\com32\menu\vesamenu.c32" "c:\remoteinstall\boot\x64\vesamenu.c32"
copy "syslinux-6.03\efi64\com32\chain\chain.c32" "c:\remoteinstall\boot\x64\chain.c32"
copy "syslinux-6.03\efi64\com32\modules\reboot.c32" "c:\remoteinstall\boot\x64\reboot.c32"
copy "syslinux-6.03\efi64\com32\modules\poweroff.c32" "c:\remoteinstall\boot\x64\poweroff.c32"
copy "syslinux-6.03\efi64\com32\lib\libcom32.c32" "c:\remoteinstall\boot\x64\libcom32.c32"
copy "syslinux-6.03\efi64\com32\libutil\libutil.c32" "c:\remoteinstall\boot\x64\libutil.c32"
copy "syslinux-6.03\efi64\com32\modules\linux.c32" "c:\remoteinstall\boot\x64\linux.c32"
copy "syslinux-6.03\efi64\com32\cmenu\libmenu\libmenu.c32" "c:\remoteinstall\boot\x64\libmenu.c32"
copy "syslinux-6.03\efi64\com32\gpllib\libgpl.c32" "c:\remoteinstall\boot\x64\libgpl.c32"
copy "syslinux-6.03\efi64\com32\lua\src\liblua.c32" "c:\remoteinstall\boot\x64\liblua.c32"
copy "syslinux-6.03\bios\memdisk\memdisk" "c:\remoteinstall\boot\x64\memdisk"
โ
:: Copy EFI syslinux files for x86
โ
copy "syslinux-6.03\bios\core\pxelinux.0" "c:\remoteinstall\boot\x86\pxelinux.0"
copy "syslinux-6.03\efi32\efi\syslinux.efi" "c:\remoteinstall\boot\x86\syslinux.efi"
copy "syslinux-6.03\efi32\com32\elflink\ldlinux\ldlinux.e32" "c:\remoteinstall\boot\x86\ldlinux.e32"
copy "syslinux-6.03\bios\com32\elflink\ldlinux\ldlinux.c32" "c:\remoteinstall\boot\x86\ldlinux.c32"
copy "syslinux-6.03\efi32\com32\menu\menu.c32" "c:\remoteinstall\boot\x86\menu.c32"
copy "syslinux-6.03\efi32\com32\menu\vesamenu.c32" "c:\remoteinstall\boot\x86\vesamenu.c32"
copy "syslinux-6.03\efi32\com32\chain\chain.c32" "c:\remoteinstall\boot\x86\chain.c32"
copy "syslinux-6.03\efi32\com32\modules\reboot.c32" "c:\remoteinstall\boot\x86\reboot.c32"
copy "syslinux-6.03\efi32\com32\modules\poweroff.c32" "c:\remoteinstall\boot\x86\poweroff.c32"
copy "syslinux-6.03\efi32\com32\lib\libcom32.c32" "c:\remoteinstall\boot\x86\libcom32.c32"
copy "syslinux-6.03\efi32\com32\libutil\libutil.c32" "c:\remoteinstall\boot\x86\libutil.c32"
copy "syslinux-6.03\efi32\com32\modules\linux.c32" "c:\remoteinstall\boot\x86\linux.c32"
copy "syslinux-6.03\efi32\com32\cmenu\libmenu\libmenu.c32" "c:\remoteinstall\boot\x86\libmenu.c32"
copy "syslinux-6.03\efi32\com32\gpllib\libgpl.c32" "c:\remoteinstall\boot\x86\libgpl.c32"
copy "syslinux-6.03\efi32\com32\lua\src\liblua.c32" "c:\remoteinstall\boot\x86\liblua.c32"
copy "syslinux-6.03\bios\memdisk\memdisk" "c:\remoteinstall\boot\x86\memdisk"
โ
:: Rename files
โ
echo Renaming files...
โ
copy /y c:\RemoteInstall\boot\x64\pxeboot.n12 c:\remoteinstall\boot\x64\pxeboot.0
copy /y c:\RemoteInstall\boot\x64\
abortpxe.com
c:\remoteinstall\boot\x64\abortpxe.0
copy /y c:\RemoteInstall\boot\x86\pxeboot.n12 c:\remoteinstall\boot\x86\pxeboot.0
copy /y c:\RemoteInstall\boot\x86\
abortpxe.com
c:\remoteinstall\boot\x86\abortpxe.0
โ
::
โ
rem Create the "pxelinux.cfg" and "Images1" folders in the location c:\RemoteInstall\boot\x64
mkdir "c:\RemoteInstall\boot\x64\pxelinux.cfg"
mkdir "c:\RemoteInstall\boot\x64\Images1"
โ
rem Create the "default" file inside the "pxelinux.cfg" folder with the desired content
(
echo DEFAULT vesamenu.c32
echo PROMPT 0
echo NOESCAPE 0
echo ALLOWOPTIONS 1
echo REM Timeout in units of 1/10 s
echo TIMEOUT 300
echo MENU MARGIN 10
echo MENU ROWS 16
echo MENU TABMSGROW 21
echo MENU TIMEOUTROW 26
echo MENU COLOR BORDER 30;44 #20ffffff #00000000 none
echo MENU COLOR SCROLLBAR 30;44 #20ffffff #00000000 none
echo MENU COLOR TITLE 0 #ffffffff #00000000 none
echo MENU COLOR SEL 30;47 #40000000 #20ffffff
echo MENU TITLE PXE Boot Menu
echo REM ---
echo LABEL wds
echo MENU LABEL Windows Deployment Services
echo KERNEL pxeboot.0
echo REM ---
echo LABEL Blancco
echo MENU LABEL Blancco
echo LINUX memdisk
echo INITRD bde.ISO
echo APPEND iso
echo REM ---
echo REM ---
echo LABEL "Windows TEST"
echo MENU LABEL "Windows Test"
echo linux memdisk
echo initrd ISO/Windows10_DE_20H1.iso
echo append iso raw
echo REM ---
echo LABEL "Ubuntu Server 22.04"
echo kernel /Linux/UbuntuServer2204/casper/vmlinuz
echo append root=/dev/nfs boot=casper netboot=nfs nfsroot=1.1.1.1:/volume4/pxe/Linux/UbuntuServer2204 initrd=/Linux/UbuntuServer2204/casper/initrd ip=dhcp
echo REM ---
echo REM ---
echo LABEL "Memtest86 6.3."
echo kernel memdisk
echo INITRD Linux/ISO/Memtest86-4.3.7.iso
echo APPEND iso raw
echo REM ---
echo LABEL Abort
echo MENU LABEL AbortPXE
echo Kernel abortpxe.0
echo REM ---
echo LABEL local
echo MENU DEFAULT
echo MENU LABEL Boot from Harddisk
echo LOCALBOOT 0
echo Type 0x80
) > "c:\RemoteInstall\boot\x64\pxelinux.cfg\default"
โ
rem Create a symlink in the location c:\RemoteInstall\boot\x86 to the "pxelinux.cfg" folder
mklink /D "c:\RemoteInstall\boot\x86\pxelinux.cfg" "c:\RemoteInstall\boot\x64\pxelinux.cfg"
mklink /D "c:\RemoteInstall\boot\x86\Images1" "c:\RemoteInstall\boot\x64\Images1"
โ
:: Set the server boot program
โ
echo Setting PXE default path...
wdsutil /set-server /bootprogram:boot\x86\pxelinux.0 /architecture:x86
wdsutil /set-server /bootprogram:boot\x64\pxelinux.0 /architecture:x64
wdsutil /set-server /N12bootprogram:boot\x86\pxelinux.0 /architecture:x86
wdsutil /set-server /N12bootprogram:boot\x64\pxelinux.0 /architecture:x64
wdsutil /set-server /bootprogram:boot\x64\syslinux.efi /architecture:x64UEFI
wdsutil /set-server /N12bootprogram:boot\x64\syslinux.efi /architecture:x64UEFI
wdsutil /set-server /bootprogram:boot\x86\syslinux.efi /architecture:x86UEFI
wdsutil /set-server /N12bootprogram:boot\x86\syslinux.efi /architecture:x86UEFI
โ
rem Restart the WDS service to apply the changes
net start wdsserver
โ
echo The WDS service has been restarted. Please check the WDS console for the changes to take effect.
pause
[link] [comments] ...