User guide

9gPXE
Netbooting Over IB
IB0054606-02 A 9-13
The following is an example of a uniboot.php file:
<?
header ( 'Content-type: text/plain' );
function strleft ( $s1, $s2 ) {
return substr ( $s1, 0, strpos ( $s1, $s2 ) );
}
function baseURL() {
$s = empty ( $_SERVER["HTTPS"] ) ? '' :
( $_SERVER["HTTPS"] == "on" ) ? "s" : "";
$protocol = strleft ( strtolower (
$_SERVER["SERVER_PROTOCOL"] ), "/" ).$s;
$port = ( $_SERVER["SERVER_PORT"] == "80" ) ? "" :
( ":".$_SERVER["SERVER_PORT"] );
return $protocol."://".$_SERVER['SERVER_NAME'].$port;
}
$baseurl = baseURL();
$selfurl = $baseurl.$_SERVER['REQUEST_URI'];
$dirurl = $baseurl.( dirname ( $_SERVER['SCRIPT_NAME'] ) );
$kver = "2.6.18-164.11.1.el5";
echo <<< EOF
#!gpxe
initrd /images/initrd.img
kernel /kernels/vmlinuz-${kver} bootfile=${selfurl}
ip=\${net0/ip}::\${net0/gateway}:\${net0/netmask}:\${net0/hos
tname}:ib0:off vga=788 console=tty0 console=ttyS0,115200
debug root=/dev/hdb1
boot
EOF;
?>
The generated gPXE script tells gPXE to load
/boot/vmlinuz-2.6.18-128.el5 and /vault/images/initrd.img files
from the httpd server node and run them.
1. Copy vmlinuz-2.6.18-128.el5 to /boot on the boot server.