[ipxe-devel] iPXE with SCCM Chaining

Robin Smidsrød robin at smidsrod.no
Wed Aug 8 10:27:49 UTC 2012


On 08.08.2012 12:21, Robin Smidsrød wrote:
> On 08.08.2012 11:46, Björn S. Hogeman wrote:
>> <?php
>> header ( "Content-type: text/plain" );
>> echo "#!gpxe\n\n";
>> echo "isset \${ip} || dhcp || echo DHCP failed\n";
>> echo "prompt --key 0x02 --timeout 2000 Press Ctrl-B for the iPXE
>> command line... && shell ||\n";
>> echo "imgfree\n";
>> echo "set next-server 172.20.52.1\n";
>> echo "echo Asset: \${asset}  Serial: \${serial}.\n";
>> echo "cpuid --ext 29 && set arch x64 || set arch x86\n";
>> echo "chain boot\\\${arch}\wdsnbp.com\n";
>> echo "boot\n";
>> echo "exit\n";
>> ?>
> 
> Why are you using PHP at all? From what I can see, this is just a static
> iPXE script, and might as well be served as a plain text file.
> 
>> Where it failed is the chain loading. It gives a file not found.
>> When pressing Ctrl-B and give above command's by hand there is no
>> problem. The F12 prompt from SCCM is shown with all other useless info
>> sccm always gives at the prompt. But from the script it is a problem.
>> Except when you embed it, then it runs fine as well, but then the
>> webserver don't get the request with the additional strings and the
>> whole point of using ipxe is gone.
> 
> The Microsoft WDS binaries does not use the traditional PXE interface to
> fetch files, it uses TFTP explicitly. You also need a TFTP server that
> supports that backslash hack, like tftpd-hpa (in Ubuntu).
> 
> I've used this URL to ensure WDS is loaded correctly:
> 
> chain tftp://${next-server}/%5CBoot%5CPXE%5Cpxeboot.n12
> 
> That requires setting up /etc/tftpd.map something like this:
> 
> # cat /etc/tftpd.map
> # Convert backslashes to slashes
> rg \\ /
> # Ensure /Boot is always mapped to uppercase
> rg /boot/boot.sdi /Boot/boot.sdi
> 
> Enabling tftpd.map should work with something like this config:
> 
> # cat /etc/default/tftpd-hpa
> TFTP_USERNAME="tftp"
> TFTP_DIRECTORY="/srv/tftp"
> TFTP_ADDRESS="0.0.0.0:69"
> TFTP_OPTIONS="-s -v -m /etc/tftpd.map"

I forgot to mention that I believe wdsnbp.com does another DHCP request,
so you setting next-server explicitly in the script will not work, it
must be delivered by the DHCP server.

See more details on the various WDS binaries available here:

http://technet.microsoft.com/en-us/library/cc732351%28v=ws.10%29.aspx

-- Robin




More information about the ipxe-devel mailing list