[syslinux] Can PXElinux be used to dynamically pass DHCP option 252 to a PXE client?

Martijn Olivier Tigchelaar motigchelaar at hotmail.com
Sun Mar 7 09:17:36 PST 2010


 
All (and hpa in particular),
 
I know that the question in the subject line of this message may come across as a bit silly, given that PXElinux is not a DHCP server, but hear me out...
 
Those of you who have been working on PXE-booting Windows PE instances or the new Windows installer images that make use of the Windows Boot Manager and ".wim" files may have come across the general understanding that the "Boot Configuration Database" file ("BCD") has to exist on the TFTP server as "\Boot\BCD". You will also have come across the idea that the "bootmgr.exe" file HAS to exist in the root of the TFTP server as "\bootmgr.exe"... All of this is however only partially correct.
 
The default behaviour for the "pxeboot.com" (or "pxeboot.n12") NBP is to look for "bootmgr.exe" in the folder / path from which it was launched. If you launched "pxeboot.n12" from the root of your TFTP server, it will try to load "bootmgr.exe" from the root as well. If you launched "pxeboot.n12"  from a different path, then that path is where it will try to load "bootmgr.exe" from as well. This does however ONLY work when using MS-style paths (as in "\Boot\x86\pxeboot.n12" instead of "/Boot/x86/pxeboot.12"). If you don't believe me, take a good look at a running WDS server -> "bootmgr.exe" does not exist in the root of the TFTP server, nor does "BCD".
 
Now onto the reasoning behind my question...
 
When "bootmgr.exe" has been loaded, it tries to determine WHERE to find the "Boot Configuration Database" file and it has a number of options on how to do it. The LAST (and therefore default) option is to simply load the file "BCD" from the "\Boot" folder on the TFTP server ("\Boot\BCD"). However, there are other options and they appear to be as follows:"
 
Option 1) If DHCP option 252 (wpad) has been provided in the format "\path\to\BCD\file", "bootmgr.exe" will simply load that file from the TFTP server and use that as the BCD-file.
 
Option 2) If DHCP option 252 has not been provided, it will try to contact the WDS server (I think) at port 4011 to ASK for the location of the BCD file. If no response is received, it use the last option 3.
 
Option 3) load the file "BCD" from the "\Boot" folder on the TFTP server ("\Boot\BCD").
 
 
This means that if PXElinux can dynamically pass DHCP option 252 with a text like "path\to\BCD\file" to the PXE client based on a selected option in the PXE menu, then that would allow us to specify different BCD files for different situations / menu options. And THAT would actually be quite nice.
 
I have experimented with this stuff by forcing my DHCP server to provide option 252 with different paths to a VALID BCD file. Not only does that work, it also gets rid of the annoying multi-second delay when "bootmgr.exe" is started. And yes - it is during this delay that a network sniffer will show the requests go to the TFTP server at port 4011...
 
So hmm - Can this be done? Can PXElinux be used to dynamically pass DHCP option 252 to a PXE client based on for example menu choices?
 
Looking forward to responses. Thanks in advance!
 
Sincerely,
 
Matijn Tigchelaar.
 
 
  		 	   		  
_________________________________________________________________
New Windows 7: Find the right PC for you. Learn more.
http://windows.microsoft.com/shop



More information about the Syslinux mailing list