iPXE discussion forum

Full Version: Simple HTTP Chainload scheme...
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
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...
Quite ingenious, I'd say. I'd choose something else than Scientific Linux, but to each his own. Smile
(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.
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
Reference URL's