iPXE discussion forum
Simple HTTP Chainload scheme... - Printable Version

+- iPXE discussion forum (http://forum.ipxe.org)
+-- Forum: iPXE user forums (/forumdisplay.php?fid=1)
+--- Forum: General (/forumdisplay.php?fid=2)
+--- Thread: Simple HTTP Chainload scheme... (/showthread.php?tid=1074)



Simple HTTP Chainload scheme... - MultimediaMan - 2011-12-17 09:57

Just thought I'd share:

Embedded code in iPXE:

Code:
#!ipxe
#Generic Boot Script
:retry
dhcp
chain http://%WEBSERVER_DNS_NAME%/ipxe/boot/${uuid}.ipxe || goto retry

In WebServer Directory:

%WEB_ROOT_DIRECTORY%/ipxe/boot/%UUID%.ipxe

Code:
#!ipxe
goto startme
:retry
sleep 5
:startme
set keep-san 1
set initiator-iqn %IQN_QUALIFIER:%CLIENT_DNS_NAME%
sanboot --drive 0x80 iscsi:%TARGET_DNS_NAME%::::%IQN_QUALIFIER%:%TARGET_NAME% ||
sanboot --drive 0x81 --no-describe http://%TARGET_DNS_NAME%/scientific_linux/6.1/x86_64/iso/SL-61-x86_64-2011-07-27-boot.iso || goto retry

This is working very well whilst I get my PHP environment working...


RE: Simple HTTP Chainload scheme... - robinsmidsrod - 2011-12-18 20:24

Quite ingenious, I'd say. I'd choose something else than Scientific Linux, but to each his own. Smile


RE: Simple HTTP Chainload scheme... - MultimediaMan - 2011-12-18 23:51

(2011-12-18 20:24)robinsmidsrod Wrote:  Quite ingenious, I'd say. I'd choose something else than Scientific Linux, but to each his own. Smile

SL isn't too bad... I'm an enterprise customer at work, so I gravitate towards RHEL, and SLES/SLED and derivatives.


RE: Simple HTTP Chainload scheme... - lstraath - 2011-12-20 18:40

I still hate the fact that you get a infinite loop by default when chainloading. And because i keep changing my mind for home usage (just fooling around with it's possibilities), i don't want to embed a new script every time. So i wrote this.Blush

#!ipxe
:retry_dhcp
dhcp || goto retry_dhcp
iseq ${filename} undionly.kpxe && set filename ${filename}.script
chain ${filename}

this way you can break the loop in the dhcp server as discribed in the manuals, and if you have a dhcp server that does not have this option the embeded script will break it for you. I would be nice if the dhcp+autoboot that is run when there is no embeded script would have something like this because the loop is just stupid.Sad