From eeb31e1e6ff5ffbdeaedbfa8a3191196c03827af Mon Sep 17 00:00:00 2001
From: Luc Ducazu <lducazu@gmail.com>
Date: Tue, 31 May 2016 00:08:55 +0200
Subject: [PATCH] Support for ipxe config files/scripting language.

---
 src/Makefile.am      |   2 +-
 src/ipxe.lang        |  48 ++++
 src/lang.map         |   1 +
 tests/Makefile.am    |   7 +
 tests/lang.list      |   1 +
 tests/test.ipxe      | 624 ++++++++++++++++++++++++++++++++++++++++++++++++++
 tests/test.ipxe.html | 629 +++++++++++++++++++++++++++++++++++++++++++++++++++
 7 files changed, 1311 insertions(+), 1 deletion(-)
 create mode 100644 src/ipxe.lang
 create mode 100644 tests/test.ipxe
 create mode 100644 tests/test.ipxe.html

diff --git a/src/Makefile.am b/src/Makefile.am
index 3053dc1..2ec955d 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -86,7 +86,7 @@ vbscript.lang awk.lang bat.lang clipper.lang cobol.lang d.lang \
 errors.lang erlang.lang proto.lang vala.lang lisp.lang islisp.lang \
 scheme.lang po.lang opa.lang javalog.lang upc.lang tml.lang \
 lilypond.lang coffeescript.lang go.lang \
-r.lang s.lang zsh.lang groovy.lang json.lang feature.lang
+r.lang s.lang zsh.lang groovy.lang json.lang feature.lang ipxe.lang
 
 LANGFILES_NOTTOCHECK= \
 tml_formatting_all.lang  tml_macrolinks.lang      tml_macrosdelayed2.lang \
diff --git a/src/ipxe.lang b/src/ipxe.lang
new file mode 100644
index 0000000..84112f4
--- /dev/null
+++ b/src/ipxe.lang
@@ -0,0 +1,48 @@
+# iPXE scripts (http://ipxe.org/)
+
+vardef VAR = '\$\{[^\}]+\}'
+vardef SEP = ';|&&|\|\|'
+vardef ID = '[-/:\w]+'
+vardef KW = "autoboot|boot|chain|choose|colour|config|console|cpair|cpuid",
+            "dhcp|echo|exit|fcels|fcstat|gdbstub|help|ifclose|ifconf|ifopen",
+            "ifstat|imgargs|imgexec|imgfetch|imgfree|imgload|imgselect|imgstat",
+            "imgtrust|imgverify|initrd|ipstat|iseq|isset|item|kernel|login",
+            "lotest|menu|module|nslookup|nstat|param|params|pciscan|ping|poweroff",
+            "profstat|prompt|pxebs|read|reboot|route|sanboot|sanhook|sanunhook",
+            "shell|sleep|sync|time|vcreate|vdestroy"
+
+# comments
+environment comment start "#"
+begin
+  include "url.lang"
+end
+
+# labels and goto
+label start '^\s*:'
+(keyword, normal, variable) = `(\bgoto)(\s+)(\$\{[^\}]+\})`
+(keyword, normal, label) = `(\bgoto)(\s+)([-/:\w]+)`
+
+# variables
+(keyword, normal, variable) = `(\b(?:clear|inc|show))(\s+)([-/:\w]+)`
+state keyword = "set"
+begin
+   state variable = $ID
+   begin
+     include "number.lang"
+     variable = $VAR
+     symbol = $SEP         exitall
+     normal = '$'          exitall
+   end
+end
+
+# keywords and statements
+state keyword = $KW
+begin
+   include "number.lang"
+   variable = $VAR
+   symbol = $SEP         exit
+   normal = '$'          exit
+end
+
+symbol = $SEP
+
diff --git a/src/lang.map b/src/lang.map
index e84ded8..26fe7b2 100644
--- a/src/lang.map
+++ b/src/lang.map
@@ -169,3 +169,4 @@ ly = lilypond.lang
 groovy = groovy.lang
 json = json.lang
 feature = feature.lang
+ipxe = ipxe.lang
diff --git a/tests/Makefile.am b/tests/Makefile.am
index d57ccd7..9bc9ed6 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -261,6 +261,7 @@ test.go test.go.html \
 test.groovy test.groovy.html \
 test.json test.json.html \
 test.feature test.feature.html \
+test.ipxe test.ipxe.html \
 $(WRONGFILES) \
 $(WRONGFILESOUT) \
 $(WRONGSTYLES) $(WRONGSTYLESOUT) \
@@ -434,6 +435,7 @@ check_go \
 check_groovy \
 check_json \
 check_feature \
+check_ipxe \
 check_docbook \
 check_namedgroups \
 check_slang \
@@ -1000,6 +1002,11 @@ check_feature:
 	@echo expect no output from diff
 	$(DIFF) $(srcdir)/test.feature.html test.feature.out.html
 
+check_ipxe:
+	$(PROGNAME) -i $(srcdir)/test.ipxe -o test.ipxe.out.html
+	@echo expect no output from diff
+	$(DIFF) $(srcdir)/test.ipxe.html test.ipxe.out.html
+
 check_lang:
 	$(LANG2HTML) -i $(top_srcdir)/src/log.lang -o log.lang.out.html
 	$(LANG2HTML) -i $(top_srcdir)/src/c.lang -o c.lang.out.html
diff --git a/tests/lang.list b/tests/lang.list
index 5f2c632..091db0a 100644
--- a/tests/lang.list
+++ b/tests/lang.list
@@ -67,6 +67,7 @@ hx = haxe.lang
 hxx = cpp.lang
 in = makefile.lang
 ini = desktop.lang
+ipxe = ipxe.lang
 islisp = islisp.lang
 java = java.lang
 javalog = javalog.lang
diff --git a/tests/test.ipxe b/tests/test.ipxe
new file mode 100644
index 0000000..9375af9
--- /dev/null
+++ b/tests/test.ipxe
@@ -0,0 +1,624 @@
+#!ipxe
+
+# menu.ipxe
+#
+# Author: Robin Smidsrod
+# Source: https://gist.github.com/robinsmidsrod/2234639
+
+# Variables are specified in boot.ipxe.cfg
+
+# Some menu defaults
+set menu-timeout 5000
+set submenu-timeout ${menu-timeout}
+isset ${menu-default} || set menu-default exit
+
+# Figure out if client is 64-bit capable
+cpuid --ext 29 && set arch x64 || set arch x86
+cpuid --ext 29 && set archl amd64 || set archl i386
+
+###################### MAIN MENU ####################################
+
+:start
+menu iPXE boot menu for ${initiator-iqn}
+item --gap --             ------------------------- Operating systems ------------------------------
+item --key f freedos      Boot FreeDOS from iSCSI
+item --key m msdos        Boot MS-DOS from iSCSI
+item --key u ubuntu       Boot Ubuntu from iSCSI
+item --key v vmware       Boot VMware ESXi from iSCSI
+item --key w windows7     Boot Windows 7 from iSCSI
+item --key l menu-live    Live environments...
+item --gap --             ------------------------- Tools and utilities ----------------------------
+item --key p pxelinux     Load PXELinux menu
+item --key r menu-recovery Recovery tools...
+item --key d menu-diag    Diagnostics tools...
+item --key i menu-install Installers...
+item --gap --             ------------------------- Advanced options -------------------------------
+item --key c config       Configure settings
+item shell                Drop to iPXE shell
+item reboot               Reboot computer
+item
+item --key x exit         Exit iPXE and continue BIOS boot
+choose --timeout ${menu-timeout} --default ${menu-default} selected || goto cancel
+set menu-timeout 0
+goto ${selected}
+
+:cancel
+echo You cancelled the menu, dropping you to a shell
+
+:shell
+echo Type 'exit' to get the back to the menu
+shell
+set menu-timeout 0
+set submenu-timeout 0
+goto start
+
+:failed
+echo Booting failed, dropping to shell
+goto shell
+
+:reboot
+reboot
+
+:exit
+exit
+
+:config
+config
+goto start
+
+:back
+set submenu-timeout 0
+clear submenu-default
+goto start
+
+############ MAIN MENU ITEMS ############
+
+:freedos
+echo Booting FreeDOS from iSCSI for ${initiator-iqn}
+set root-path ${base-iscsi}:${hostname}.boot.freedos
+sanboot ${root-path} || goto failed
+goto start
+
+:msdos
+echo Booting MS-DOS from iSCSI for ${initiator-iqn}
+set root-path ${base-iscsi}:${hostname}.boot.msdos
+sanboot ${root-path} || goto failed
+goto start
+
+:ubuntu
+echo Booting Ubuntu from iSCSI for ${initiator-iqn}
+set root-path ${base-iscsi}:${hostname}.boot.ubuntu
+sanboot ${root-path} || goto failed
+goto start
+
+:vmware
+echo Booting VMware ESXi from iSCSI for ${initiator-iqn}
+set root-path ${base-iscsi}:${hostname}.boot.vmware
+sanboot ${root-path} || goto failed
+goto start
+
+:windows7
+echo Booting Windows 7 from iSCSI for ${initiator-iqn}
+# Force gateway to be the iSCSI target server (kludge for stupid window behavior)
+set netX/gateway ${iscsi-server}
+set root-path ${base-iscsi}:${hostname}.boot.windows7
+sanboot ${root-path} || goto failed
+goto start
+
+:pxelinux
+set 210:string tftp://${next-server}/
+chain ${210:string}pxelinux.0 || goto failed
+goto start
+
+###################### RECOVERY MENU ################################
+
+:menu-recovery
+menu Recovery tools
+item sysrcd          SystemRescueCD ${sysrcd-version}
+item spinrite        SpinRite ${spinrite-version}
+item spinrite-msdos  SpinRite ${spinrite-version} (using MS-DOS 6.22)
+item macrium-winpe Macrium Reflect ${macrium-version} Rescue CD (WinPE 4.0 ${arch})
+item macrium-winpe-sanboot   Macrium Reflect ${macrium-version} Rescue CD (WinPE 4.0 ${arch} with sanboot)
+item macrium-linux   Macrium Reflect ${macrium-version} Rescue CD (Linux ${arch})
+item macrium-linux-sanboot   Macrium Reflect ${macrium-version} Rescue CD (Linux ${arch} with sanboot)
+item firefly         Firefly IllumOS recovery environment ${firefly-version}
+item freedos-direct  FreeDOS 1.1 (directly using iPXE)
+item
+item --key 0x08 back Back to top menu...
+iseq ${menu-default} menu-recovery && isset ${submenu-default} && goto menu-recovery-timed ||
+choose selected && goto ${selected} || goto start
+:menu-recovery-timed
+choose --timeout ${submenu-timeout} --default ${submenu-default} selected && goto ${selected} || goto start
+
+:spinrite
+sanboot --no-describe --drive 0x00 ${sanboot-url}spinrite-${spinrite-version}/spinrite-${spinrite-version}.img || goto failed
+#sanboot --no-describe --drive 0x081 ${sanboot-url}spinrite-${spinrite-version}/spinrite-${spinrite-version}.iso
+#initrd spinrite/spinrite-${spinrite-version}.img
+#chain memdisk
+goto start
+
+:spinrite-msdos
+sanboot --no-describe --drive 0x00 ${sanboot-url}spinrite-${spinrite-version}/spinrite-${spinrite-version}-msdos.img || goto failed
+goto start
+
+:sysrcd
+echo Booting SystemRescueCD ${sysrcd-version} x86 for ${initiator-iqn}
+# Fixup needed after copying files from downloaded ISO to directory:
+#  cd path/to/sysrcd-iso-unpacked-files/isolinux && \
+#   perl -p -i -e 's{/bootdisk}{../bootdisk}' isolinux.cfg && \
+#   perl -p -i -e 's{scandelay=1}{scandelay=1 dodhcp netboot=nfs://nas.smidsrod.lan:/raid/boot/sysrcd-3.8.0-x86}g' isolinux.cfg && \
+#   perl -p -i -e 's{setkmap=us}{setkmap=us dodhcp netboot=nfs://nas.smidsrod.lan:/raid/boot/sysrcd-3.8.0-x86}g' isolinux.cfg && \
+#   perl -p -i -e 's{rescuecd_us}{rescuecd_no}; s{US}{NO}; s{setkmap=us}{setkmap=no}g; s{american}{norwegian};' isolinux.cfg && \
+#   cd -
+# PXELinux options, see http://syslinux.zytor.com/wiki/index.php/PXELINUX for details
+set 210:string ${boot-url}sysrcd-${sysrcd-version}-x86/isolinux/
+set 209:string isolinux.cfg
+set filename ${210:string}pxelinux.0
+chain ${filename} || goto failed
+goto start
+
+:macrium-winpe
+echo Booting Macrium Reflect ${macrium-version} (WinPE 4.0 ${arch}) for ${initiator-iqn}
+set base-url macrium-${macrium-version}/macrium-${macrium-version}-rescue-winpe-4.0-${arch}
+kernel wimboot
+initrd ${base-url}/bootmgr          bootmgr
+initrd ${base-url}/Boot/BCD         BCD
+initrd ${base-url}/Boot/boot.sdi    boot.sdi
+initrd ${base-url}/sources/boot.wim boot.wim
+boot || goto failed
+goto start
+
+:macrium-linux
+echo Booting Macrium Reflect ${macrium-version} (Linux ${arch}) for ${initiator-iqn}
+set base-url macrium-${macrium-version}/macrium-${macrium-version}-rescue-linux
+kernel ${base-url}/vmlinuz
+initrd ${base-url}/initramfs.xz
+imgargs vmlinuz vga=0x317
+boot || goto failed
+goto start
+
+:macrium-winpe-sanboot
+sanboot --no-describe ${sanboot-url}macrium-${macrium-version}/macrium-${macrium-version}-rescue-winpe-4.0-${arch}.iso || goto failed
+goto start
+
+:macrium-linux-sanboot
+sanboot --no-describe ${sanboot-url}macrium-${macrium-version}/macrium-${macrium-version}-rescue-linux.iso || goto failed
+goto start
+
+:firefly
+echo Booting Firefly ${firefly-version} for ${initiator-iqn}
+set base-url firefly-${firefly-version}/boot
+# http://alexeremin.blogspot.no/2013/05/firefly-failsafe-image-for-illumos.html
+# http://sourceforge.net/projects/fireflyfailsafe/files/
+# Download ISO, unpack ISO and copy files to boot-url
+# The ramdisk is compressed with gzip, which must be unpacked
+# to work with iPXE
+# mv firefly firefly.gz
+# gunzip firefly.gz
+kernel ${base-url}/platform/i86pc/kernel/amd64/unix
+module ${base-url}/firefly
+boot || goto failed
+goto start
+
+:freedos-direct
+echo Booting FreeDOS 1.1 KERNEL.SYS for ${initiator-iqn}
+set base-url freedos-1.1/fd11src/FREEDOS/SETUP/ODIN
+# TODO: Work-in-progress
+kernel ${base-url}/KERNEL.SYS
+boot || goto failed
+goto start
+
+###################### DIAGNOSTICS MENU #############################
+
+:menu-diag
+menu Diagnostic tools
+item hdt           HDT ${hdt-version}
+item memtest       Memtest86+ 4.20
+item memtest-ipxe  Memtest86+ 4.20 (iPXE)
+item breakin       Breakin 3.71
+item dban          Darik's Boot and Nuke 2.2.7
+item etdump        Bart's etdump 1.2
+item wdcdiag       Western Digital Diagnostics 5.04f
+item
+item --key 0x08 back Back to top menu...
+iseq ${menu-default} menu-diag && isset ${submenu-default} && goto menu-diag-timed ||
+choose selected && goto ${selected} || goto start
+:menu-diag-timed
+choose --timeout ${submenu-timeout} --default ${submenu-default} selected && goto ${selected} || goto start
+
+:hdt
+# http://hdt-project.org/
+sanboot --no-describe --drive 0x00 ${sanboot-url}hdt-${hdt-version}.img || goto failed
+goto start
+
+:memtest
+# TODO: Fix the URI parser to make the + sign work
+#chain memtest86+-4.20.elf.img - || goto failed
+chain memtest86plus-4.20.elf.img - || goto failed
+goto start
+
+:memtest-ipxe
+chain memtest.0 passes=1 && set memtest GOOD || set memtest BAD
+set memtest_errno:uint8 ${errno}
+iseq ${memtest} GOOD && goto memtest-info ||
+iseq ${memtest_errno} 0x1 && set memtest BAD || set memtest UNKNOWN
+:memtest-info
+menu Your memory seems to be ${memtest}
+item memtest-report   Report memtest result to web service
+item --key 0x08 menu-diag Back to diagnostics menu...
+choose --default menu-diag selected && goto ${selected} || goto start
+
+:memtest-report
+chain ${memtest-report-url}?result=${memtest}&mac=${mac}&uuid=${uuid}&hostname=${hostname} ||
+goto menu-diag
+
+:breakin
+# Stress-testing and diagnostics utility
+# http://www.advancedclustering.com/software/breakin.html
+# Set sshpasswd=yourpassword for remote access
+# Set startup= to 'cloner' or 'rescue' for more features
+# When startup=cloner, server= and image= can also be set
+# http://www.advancedclustering.com/software/cloner.html
+kernel breakin-3.71/kernel-3.71
+initrd breakin-3.71/initrd-3.71.cpio.lzma
+imgargs kernel-3.71 startup=breakin
+boot || goto failed
+goto start
+
+:dban
+kernel dban-2.2.7/DBAN.BZI
+imgargs DBAN.BZI nuke="dwipe --method gutmann --rounds 2 --verify last" silent vga=785
+boot || goto failed
+goto start
+
+:etdump
+# Booting it with memdisk makes it read/write, while sanboot forces read/only
+#sanboot --drive 0x00 ${sanboot-url}freedos-etdump-floppy.img
+initrd freedos-etdump-floppy.img
+chain memdisk || goto failed
+goto start
+
+:wdcdiag
+# Extracted the bootable floppy image from diag-5.04f.iso
+sanboot --drive 0x00 ${sanboot-url}western-digital/diag-5.04f.img || goto failed
+goto start
+
+############################ INSTALLER MENU #########################
+
+:menu-install
+menu Installers for ${initiator-iqn}
+item freedos-install      Install FreeDOS 1.1 to iSCSI
+item msdos-install        Install MS-DOS 6.22 to iSCSI
+item ubuntu-install       Install Ubuntu 12.04 ${archl} to iSCSI
+item windows7-install     Install Windows 7 to iSCSI
+item vmware-x64-install   Install VMware ESXi 5.0 (x64) to iSCSI
+item vmware-x86-install   Install VMware ESXi 3.5 (x86) to iSCSI
+item winpe                Hook Windows 7 iSCSI and boot WinPE
+item winpe-wimboot        Boot WinPE ${arch} using wimboot
+item ubuntu-installer-remote Install Ubuntu 12.04 ${archl} from public archive
+item ubuntu-install-local Install Ubuntu 12.04 ${archl} to local drive(s)
+item xenclient-install   Install XenClient 2.1 to local drive
+item windows7-hookonly   Hook Windows 7 iSCSI and boot local CD
+item
+item --key 0x08 back      Back to top menu...
+iseq ${menu-default} menu-install && isset ${submenu-default} && goto menu-install-timed ||
+choose selected && goto ${selected} || goto start
+:menu-install-timed
+choose --timeout ${submenu-timeout} --default ${submenu-default} selected && goto ${selected} || goto start
+
+:freedos-install
+echo Booting FreeDOS 1.1 installer to iSCSI for ${initiator-iqn}
+set root-path ${base-iscsi}:${hostname}.boot.freedos
+sanhook ${root-path} || goto failed
+sanboot --drive 0x81 ${sanboot-url}freedos-1.1/fd11src.iso || goto failed
+goto start
+
+:msdos-install
+echo Booting MS-DOS 6.22 installer to iSCSI for ${initiator-iqn}
+set root-path ${base-iscsi}:${hostname}.boot.msdos
+sanhook ${root-path} || goto failed
+sanboot --no-describe --drive 0x00 ${sanboot-url}msdos-6.22/disk1.img || goto failed
+goto start
+
+:ubuntu-install
+echo Starting Ubuntu 12.04 ${archl} installer for ${initiator-iqn}
+# Hook iSCSI drive
+set root-path ${base-iscsi}:${hostname}.boot.ubuntu
+#sanhook ${root-path} || goto failed
+# Start ubuntu-installer. Remember that the iSCSI target must be writable
+# by anyone, as debian-installer generates a randomized initiator-iqn in
+# /etc/iscsi/initiatorname.iscsi
+# The preseed script used takes care of rewriting it to the
+# hostname-based IQN used in this script.
+# This kernel param which open-iscsi README.Debian mentions doesn't work
+# inside debian-installer, unfortunately: iscsi_initiator=${initiator-iqn}
+# Hard workaround available here:
+# http://umfcloudpilot.eduserv.org.uk/entries/20299686-enable-pre-seed-or-kickstart-seeding-of-iscsi-intiator-iqn-in-ubuntu-server
+set base-url ${boot-url}ubuntu-12.04-server-${archl}
+kernel ${base-url}/install/netboot/ubuntu-installer/${archl}/linux
+initrd ${base-url}/install/netboot/ubuntu-installer/${archl}/initrd.gz
+imgargs linux auto=true fb=false url=${base-url}/./preseed.cfg DEBCONF_DEBUG=5 netcfg/get_hostname=${hostname} partman-iscsi/login/address=${iscsi-server} partman-iscsi/login/targets=${base-iqn}:${hostname}.boot.ubuntu partman-iscsi/login/username=${username} partman-iscsi/login/password=${password}
+boot || goto failed
+goto start
+
+:ubuntu-install-local
+echo Starting Ubuntu 12.04 ${archl} local installer for ${initiator-iqn}
+set base-url ${boot-url}ubuntu-12.04-server-${archl}
+kernel ${base-url}/install/netboot/ubuntu-installer/${archl}/linux
+initrd ${base-url}/install/netboot/ubuntu-installer/${archl}/initrd.gz
+imgargs linux auto=true fb=false url=${base-url}/./preseed.cfg
+boot || goto failed
+goto start
+
+:windows7-install
+echo Starting Windows 7 ${arch} installer for ${initiator-iqn}
+# Force gateway to be the iSCSI target server (kludge for stupid window behavior)
+set netX/gateway ${iscsi-server}
+# Hook iSCSI drive
+set root-path ${base-iscsi}:${hostname}.boot.windows7
+sanhook ${root-path} || goto failed
+# Start Windows 7 installer DVD
+#sanboot --no-describe --drive 0x81 ${sanboot-url}windows-7/ultimate-${arch}-en.iso || goto failed
+# Better solution, according to Oliver Rath on the mailing-list
+# Requires massive amounts of RAM, though
+#initrd windows-7/ultimate-${arch}-en.iso
+#chain memdisk iso raw || goto failed
+# This method uses wimboot
+set base-url windows-7/ultimate-${arch}-en
+kernel wimboot
+initrd ${base-url}/bootmgr                     bootmgr
+initrd ${base-url}/boot/bcd                    BCD
+initrd ${base-url}/boot/fonts/wgl4_boot.ttf    wgl4_boot.ttf
+initrd ${base-url}/boot/boot.sdi               boot.sdi
+initrd ${base-url}/sources/boot.wim            boot.wim
+boot || goto failed
+goto start
+
+:vmware-x64-install
+echo Booting VMware 64-bit installer for ${initiator-iqn}
+set root-path ${base-iscsi}:${hostname}.boot.vmware
+sanhook ${root-path} || goto failed
+initrd vmware/vmware-esxi-5.0-x64.iso
+chain memdisk iso || goto failed
+goto start
+
+:vmware-x86-install
+echo Booting VMware 32-bit installer for ${initiator-iqn}
+set root-path ${base-iscsi}:${hostname}.boot.vmware
+sanhook ${root-path} || goto failed
+initrd vmware/vmware-esxi-3.5-x86.iso
+chain memdisk iso || goto failed
+goto start
+
+:winpe
+echo Booting Windows PE ${arch} installer for ${initiator-iqn}
+echo (for installing Windows 7)
+# Force gateway to be the iSCSI target server (kludge for stupid window behavior)
+set netX/gateway ${iscsi-server}
+
+set root-path ${base-iscsi}:${hostname}.boot.windows7
+sanhook ${root-path} || goto failed
+
+# Remember to map the install volume with the following command:
+# net use y: \\nas\wds /user:NAS\robin
+# Use Y:\Operating Systems\Windows 7 x64\setup.exe to install
+
+# Boots WinPE via native MS TFTP support
+#chain tftp://${next-server}/%5CBoot%5CPXE%5Cpxeboot.n12
+# Better solution, according to Oliver Rath on the mailing-list
+# Requires decent amounts of RAM, though
+# Details on how to generate winpe-x64.iso from you Windows 7 install DVD
+# can be found here: http://technet.microsoft.com/en-us/library/cc722358%28v=ws.10%29.aspx
+initrd windows-7/winpe-${arch}.iso
+chain memdisk iso raw || goto failed
+goto start
+
+:winpe-wimboot
+echo Booting Windows PE ${arch} installer for ${initiator-iqn}
+#echo (for installing Windows 7)
+
+# Force gateway to be the iSCSI target server (kludge for stupid window behavior)
+set netX/gateway ${iscsi-server}
+
+set root-path ${base-iscsi}:${hostname}.boot.windows7
+sanhook ${root-path} || goto failed
+
+# Remember to map the install volume with the following command:
+# net use y: \\nas\wds /user:NAS\robin
+# Use Y:\Operating Systems\Windows 7 x64\setup.exe to install
+
+# Boots WinPE via iPXE wimboot binary
+# BCD is from http://www.fensystems.co.uk/~mcb30/BCD
+# wimboot prebuilt from http://www.fensystems.co.uk/~mcb30/wimboot
+#         source at http://git.ipxe.org/wimboot.git
+# bootmgr.exe from the same package that enables PXE booting for Windows
+#             (most likely WDS tools)
+set base-url winpe/${arch}
+kernel wimboot
+initrd ${base-url}/media/bootmgr                     bootmgr
+initrd ${base-url}/media/Boot/BCD                    BCD
+initrd ${base-url}/media/Boot/Fonts/segmono_boot.ttf segmono_boot.ttf
+initrd ${base-url}/media/Boot/Fonts/segoe_slboot.ttf segoe_slboot.ttf
+initrd ${base-url}/media/Boot/Fonts/wgl4_boot.ttf    wgl4_boot.ttf
+initrd ${base-url}/media/Boot/boot.sdi               boot.sdi
+initrd ${base-url}/media/sources/boot.wim            boot.wim
+boot || goto failed
+goto start
+
+:ubuntu-installer-remote
+echo Starting Ubuntu 12.04 ${archl} installer for ${initiator-iqn}
+set base-url http://no.archive.ubuntu.com/ubuntu/dists/precise/main/installer-${archl}/current/images/netboot/ubuntu-installer/${archl}
+kernel ${base-url}/linux
+initrd ${base-url}/initrd.gz
+#imgargs linux auto=true url=http://yourserver/some/path/preseed.cfg
+boot || goto failed
+goto start
+
+:xenclient-install
+echo Booting XenClient 2.1 installer for ${initiator-iqn}
+# XenClient doesn't seem to support installing to iSCSI volumes
+# It only supports installing using iBFT
+#set root-path ${base-iscsi}:${hostname}.boot.xenclient
+#sanhook ${root-path} || goto failed
+# The xenclient-2.1 folder is just the unpacked contents of the installer ISO
+# Make sure you modify the isolinux.cfg and point it at your answer file URL
+# You can find an example of the answer file in the "Setup and Usage Guide"
+set 210:string ${boot-url}xenclient-2.1/isolinux/
+set 209:string isolinux.cfg
+set filename ${210:string}pxelinux.0
+chain ${filename} || goto failed
+goto start
+
+:windows7-hookonly
+echo Hooking Windows 7 iSCSI volume for ${initiator-iqn}
+# Force gateway to be the iSCSI target server (kludge for stupid window behavior)
+set netX/gateway ${iscsi-server}
+# Hook iSCSI drive
+set root-path ${base-iscsi}:${hostname}.boot.windows7
+sanhook --drive 0x81 ${root-path} || goto failed
+echo Start Windows 7 installer DVD from local drive
+sanboot --no-describe --drive 0x80 ${sanboot-url}windows-7/ultimate-${arch}-en.iso || goto failed
+goto start
+
+###################### LIVE ENVIRONMENT MENU ########################
+
+:menu-live
+menu Live environments for ${initiator-iqn}
+item openelec-generic-live     Boot OpenELEC Generic ${openelec-version} ${archl}
+item ubuntu-live-1204          Boot Ubuntu LiveCD 12.04 ${archl}
+item slitaz-live               Boot SliTaz 4.0 LiveCD
+item smartos                   Boot SmartOS
+item smartos-pre-ept           Boot SmartOS (pre-ept)
+item kms-test                  Boot KMS test kernel
+item tinycore-live-core        Boot TinyCoreLinux ${tc-version} Core
+item tinycore-live-tinycore    Boot TinyCoreLinux ${tc-version} TinyCore
+item tinycore-live-coreplus    Boot TinyCoreLinux ${tc-version} CorePlus
+item coreos                    Boot CoreOS ${coreos-version}
+item
+item --key 0x08 back      Back to top menu...
+iseq ${menu-default} menu-live && isset ${submenu-default} && goto menu-live-timed ||
+choose selected && goto ${selected} || goto start
+:menu-live-timed
+choose --timeout ${submenu-timeout} --default ${submenu-default} selected && goto ${selected} || goto start
+
+:openelec-generic-live
+echo Booting OpenELEC Generic ${openelec-version} for ${initiator-iqn}
+set base-url openelec-generic-${archl}-${openelec-version}
+kernel ${base-url}/target/KERNEL
+initrd ${base-url}/target/SYSTEM
+# Config from: http://wiki.openelec.tv/index.php?title=Network_Boot_-_NFS
+# and http://wiki.openelec.tv/index.php?title=Installation#Network_Boot_.28PXE.29
+# NFS/NBD/iSCSI boot support only works on version >= 2 of OpenELEC
+# The NFS server must be specified as an IP, name resolution doesn't work :(
+imgargs KERNEL ip=dhcp boot=NFS=${nfs-server}:${nfs-root}${base-url}/target disk=NFS=${openelec-storage-dir} overlay
+boot || goto failed
+goto start
+
+:ubuntu-live-1204
+# See http://manpages.ubuntu.com/manpages/precise/man7/casper.7.html for casper cmdline details
+echo Booting Ubuntu Live 12.04 ${archl} for ${initiator-iqn}
+set base-url ubuntu-12.04-dvd-${archl}
+kernel ${base-url}/casper/vmlinuz
+initrd ${base-url}/casper/initrd.lz
+imgargs vmlinuz root=/dev/nfs boot=casper netboot=nfs nfsroot=${nfs-server}:${nfs-root}${base-url} locale=en_US.UTF-8 keyboard-configuration/layoutcode=no mirror/country=NO
+shell
+boot || goto failed
+goto start
+
+:slitaz-live
+echo Booting SliTaz 4.0 LiveCD for ${initiator-iqn}
+set base-url slitaz-4.0/
+kernel ${base-url}/boot/bzImage
+initrd ${base-url}/boot/rootfs4.gz
+initrd ${base-url}/boot/rootfs3.gz
+initrd ${base-url}/boot/rootfs2.gz
+initrd ${base-url}/boot/rootfs1.gz
+imgargs bzImage rw root=/dev/null vga=normal autologin lang=en_US kmap=no-latin1
+boot || goto failed
+goto start
+
+:smartos
+echo Booting SmartOS for ${initiator-iqn}
+# Hook iSCSI root volume (optional, not yet working)
+sanhook ${base-iscsi}:${hostname}.boot.smartos ||
+set base-url smartos
+# See http://nahamu.github.com/2011/08/17/smartos-pxe.html for details
+# See http://wiki.smartos.org/display/DOC/Getting+Started+with+SmartOS
+# http://wiki.smartos.org/display/DOC/PXE+Booting+SmartOS
+# http://wiki.smartos.org/display/DOC/SmartOS+Command+Line+Tips#SmartOSCommandLineTips-FiguringoutwheretoconfigureadditionalNetworkinterfacesorVLANs
+# http://wiki.smartos.org/display/DOC/extra+configuration+options
+# http://wiki.smartos.org/display/DOC/Managing+NICs
+kernel ${base-url}/platform/i86pc/kernel/amd64/unix
+initrd ${base-url}/platform/i86pc/amd64/boot_archive
+# This doesn't work, but I would very much like it to
+#initrd ${base-url}/config/${hostname}.txt /usbkey/config
+# smartos=true to run smartos "installer" (and disable noimport=true)
+# You can also run it manually, it's at /smartdc/bin/smartos_prompt_config.sh
+# keyboard-layout=norway doesn't work anymore (it used to)
+#imgargs unix -v -B console=text,standalone=true,noimport=true,keyboard-layout=norway,hostname=${hostname},root_shadow='${root-shadow}'
+imgargs unix -B console=text,standalone=true,hostname=${hostname},admin_nic=${mac},admin_ip=dhcp,admin_gateway=dhcp,external_nic=${mac},external_ip=dhcp,external_gateway=dhcp,dns_resolvers=${dns},dns_domain=${domain},ntp_hosts=pool.ntp.org,root_shadow='${root-shadow}'
+boot || goto failed
+goto start
+
+:smartos-pre-ept
+echo Starting SmartOS (pre-ept branch) for ${initiator-iqn}
+# pre-ept image downloaded from http://alpha.sysmgr.org/smartos-20120223-jmc2.iso
+# Posted by LeftWing on #illumos / FreeNode at 2012-04-11 09:09 UTC+2
+set base-url smartos/pre-ept
+kernel ${base-url}/platform/i86pc/kernel/amd64/unix
+module ${base-url}/platform/i86pc/amd64/boot_archive
+imgargs unix -v -B console=text,standalone=true,noimport=true,root_shadow='${root-shadow}'
+boot || goto failed
+goto start
+
+:kms-test
+echo Booting KMS-enabled Linux kernel for ${initiator-iqn}
+set base-url kms_test
+kernel ${base-url}/vmlinuz
+initrd ${base-url}/initrd ||
+imgargs vmlinuz rw root=/dev/nfs nfsroot=${nfs-server}:/raid/kms_test ip=dhcp ||
+boot || goto failed
+goto start
+
+# TinyCore is work-in-progress
+# Current problems is that tce=/mnt/nfs/cde works, but dir is not writable by tc user,
+# keymap is not loaded, and it seems like there is something I'm not understanding properly
+# about the TC boot process
+# More to read on http://distro.ibiblio.org/tinycorelinux/concepts.html
+# and http://wiki.tinycorelinux.net/wiki:netbooting
+:tinycore-live-core
+echo Booting TinyCoreLinux Live Core ${tc-version} for ${inititator-iqn}
+set base-url tinycore/Core-${tc-version}/
+kernel ${base-url}/boot/vmlinuz
+initrd ${base-url}/boot/core.gz
+imgargs vmlinuz loglevel=3
+boot || goto failed
+goto start
+
+:tinycore-live-tinycore
+echo Booting TinyCoreLinux Live TinyCore ${tc-version} for ${inititator-iqn}
+set base-url tinycore/TinyCore-${tc-version}
+kernel ${base-url}/boot/vmlinuz
+initrd ${base-url}/boot/core.gz
+imgargs vmlinuz nfsmount=${nfs-server}:${nfs-root}${base-url} host=${hostname} lang=us kmap=nb loglevel=3 syslog  tce=/mnt/nfs/cde
+boot || goto failed
+goto start
+
+:tinycore-live-coreplus
+echo Booting TinyCoreLinux Live CorePlus ${tc-version} for ${inititator-iqn}
+set base-url tinycore/CorePlus-${tc-version}
+kernel ${base-url}/boot/vmlinuz
+initrd ${base-url}/boot/core.gz
+imgargs vmlinuz nfsmount=${nfs-server}:${nfs-root}${base-url} host=${hostname} lang=us kmap=nb loglevel=3 syslog  tce=/mnt/nfs/cde showapps desktop=flwm_topside
+boot || goto failed
+goto start
+
+:coreos
+echo Booting CoresOS ${coreos-version} for ${inititator-iqn}
+#set base-url ${boot-url}/coreos/CorePlus-${tc-version}
+set base-url http://storage.core-os.net/coreos/${archl}-generic/${coreos-version}
+kernel ${base-url}/coreos_production_pxe.vmlinuz
+initrd ${base-url}/coreos_production_pxe_image.cpio.gz
+imgargs coreos_production_pxe.vmlinuz root=squashfs: state=tmpfs: sshkey="${coreos-sshkey}"
+boot || goto failed
+goto start
diff --git a/tests/test.ipxe.html b/tests/test.ipxe.html
new file mode 100644
index 0000000..7f84001
--- /dev/null
+++ b/tests/test.ipxe.html
@@ -0,0 +1,629 @@
+<!-- Generator: GNU source-highlight 
+by Lorenzo Bettini
+http://www.lorenzobettini.it
+http://www.gnu.org/software/src-highlite -->
+<pre><tt><i><font color="#9A1900">#!ipxe</font></i>
+
+<i><font color="#9A1900"># menu.ipxe</font></i>
+<i><font color="#9A1900">#</font></i>
+<i><font color="#9A1900"># Author: Robin Smidsrod</font></i>
+<i><font color="#9A1900"># Source: </font></i><u><font color="#0000FF">https://gist.github.com/robinsmidsrod/2234639</font></u>
+
+<i><font color="#9A1900"># Variables are specified in boot.ipxe.cfg</font></i>
+
+<i><font color="#9A1900"># Some menu defaults</font></i>
+<b><font color="#0000FF">set</font></b> <font color="#009900">menu-timeout</font> <font color="#993399">5000</font>
+<b><font color="#0000FF">set</font></b> <font color="#009900">submenu-timeout</font> <font color="#009900">${menu-timeout}</font>
+<b><font color="#0000FF">isset</font></b> <font color="#009900">${menu-default}</font> <font color="#990000">||</font> <b><font color="#0000FF">set</font></b> <font color="#009900">menu-default</font> exit
+
+<i><font color="#9A1900"># Figure out if client is 64-bit capable</font></i>
+<b><font color="#0000FF">cpuid</font></b> --ext <font color="#993399">29</font> <font color="#990000">&amp;&amp;</font> <b><font color="#0000FF">set</font></b> <font color="#009900">arch</font> x64 <font color="#990000">||</font> <b><font color="#0000FF">set</font></b> <font color="#009900">arch</font> x86
+<b><font color="#0000FF">cpuid</font></b> --ext <font color="#993399">29</font> <font color="#990000">&amp;&amp;</font> <b><font color="#0000FF">set</font></b> <font color="#009900">archl</font> amd64 <font color="#990000">||</font> <b><font color="#0000FF">set</font></b> <font color="#009900">archl</font> i386
+
+<i><font color="#9A1900">###################### MAIN MENU ####################################</font></i>
+
+<b><font color="#008080">:start</font></b>
+<b><font color="#0000FF">menu</font></b> iPXE boot menu for <font color="#009900">${initiator-iqn}</font>
+<b><font color="#0000FF">item</font></b> --gap --             ------------------------- Operating systems ------------------------------
+<b><font color="#0000FF">item</font></b> --key f freedos      Boot FreeDOS from iSCSI
+<b><font color="#0000FF">item</font></b> --key m msdos        Boot MS-DOS from iSCSI
+<b><font color="#0000FF">item</font></b> --key u ubuntu       Boot Ubuntu from iSCSI
+<b><font color="#0000FF">item</font></b> --key v vmware       Boot VMware ESXi from iSCSI
+<b><font color="#0000FF">item</font></b> --key w windows7     Boot Windows <font color="#993399">7</font> from iSCSI
+<b><font color="#0000FF">item</font></b> --key l menu-live    Live environments...
+<b><font color="#0000FF">item</font></b> --gap --             ------------------------- Tools and utilities ----------------------------
+<b><font color="#0000FF">item</font></b> --key p pxelinux     Load PXELinux menu
+<b><font color="#0000FF">item</font></b> --key r menu-recovery Recovery tools...
+<b><font color="#0000FF">item</font></b> --key d menu-diag    Diagnostics tools...
+<b><font color="#0000FF">item</font></b> --key i menu-install Installers...
+<b><font color="#0000FF">item</font></b> --gap --             ------------------------- Advanced options -------------------------------
+<b><font color="#0000FF">item</font></b> --key c config       Configure settings
+<b><font color="#0000FF">item</font></b> shell                Drop to iPXE shell
+<b><font color="#0000FF">item</font></b> reboot               Reboot computer
+<b><font color="#0000FF">item</font></b>
+<b><font color="#0000FF">item</font></b> --key x exit         Exit iPXE and continue BIOS boot
+<b><font color="#0000FF">choose</font></b> --timeout <font color="#009900">${menu-timeout}</font> --default <font color="#009900">${menu-default}</font> selected <font color="#990000">||</font> <b><font color="#0000FF">goto</font></b> <b><font color="#008080">cancel</font></b>
+<b><font color="#0000FF">set</font></b> <font color="#009900">menu-timeout</font> <font color="#993399">0</font>
+<b><font color="#0000FF">goto</font></b> <font color="#009900">${selected}</font>
+
+<b><font color="#008080">:cancel</font></b>
+<b><font color="#0000FF">echo</font></b> You cancelled the menu, dropping you to a shell
+
+<b><font color="#008080">:shell</font></b>
+<b><font color="#0000FF">echo</font></b> Type 'exit' to get the back to the menu
+<b><font color="#0000FF">shell</font></b>
+<b><font color="#0000FF">set</font></b> <font color="#009900">menu-timeout</font> <font color="#993399">0</font>
+<b><font color="#0000FF">set</font></b> <font color="#009900">submenu-timeout</font> <font color="#993399">0</font>
+<b><font color="#0000FF">goto</font></b> <b><font color="#008080">start</font></b>
+
+<b><font color="#008080">:failed</font></b>
+<b><font color="#0000FF">echo</font></b> Booting failed, dropping to shell
+<b><font color="#0000FF">goto</font></b> <b><font color="#008080">shell</font></b>
+
+<b><font color="#008080">:reboot</font></b>
+<b><font color="#0000FF">reboot</font></b>
+
+<b><font color="#008080">:exit</font></b>
+<b><font color="#0000FF">exit</font></b>
+
+<b><font color="#008080">:config</font></b>
+<b><font color="#0000FF">config</font></b>
+<b><font color="#0000FF">goto</font></b> <b><font color="#008080">start</font></b>
+
+<b><font color="#008080">:back</font></b>
+<b><font color="#0000FF">set</font></b> <font color="#009900">submenu-timeout</font> <font color="#993399">0</font>
+<b><font color="#0000FF">clear</font></b> <font color="#009900">submenu-default</font>
+<b><font color="#0000FF">goto</font></b> <b><font color="#008080">start</font></b>
+
+<i><font color="#9A1900">############ MAIN MENU ITEMS ############</font></i>
+
+<b><font color="#008080">:freedos</font></b>
+<b><font color="#0000FF">echo</font></b> Booting FreeDOS from iSCSI for <font color="#009900">${initiator-iqn}</font>
+<b><font color="#0000FF">set</font></b> <font color="#009900">root-path</font> <font color="#009900">${base-iscsi}</font>:<font color="#009900">${hostname}</font>.boot.freedos
+<b><font color="#0000FF">sanboot</font></b> <font color="#009900">${root-path}</font> <font color="#990000">||</font> <b><font color="#0000FF">goto</font></b> <b><font color="#008080">failed</font></b>
+<b><font color="#0000FF">goto</font></b> <b><font color="#008080">start</font></b>
+
+<b><font color="#008080">:msdos</font></b>
+<b><font color="#0000FF">echo</font></b> Booting MS-DOS from iSCSI for <font color="#009900">${initiator-iqn}</font>
+<b><font color="#0000FF">set</font></b> <font color="#009900">root-path</font> <font color="#009900">${base-iscsi}</font>:<font color="#009900">${hostname}</font>.boot.msdos
+<b><font color="#0000FF">sanboot</font></b> <font color="#009900">${root-path}</font> <font color="#990000">||</font> <b><font color="#0000FF">goto</font></b> <b><font color="#008080">failed</font></b>
+<b><font color="#0000FF">goto</font></b> <b><font color="#008080">start</font></b>
+
+<b><font color="#008080">:ubuntu</font></b>
+<b><font color="#0000FF">echo</font></b> Booting Ubuntu from iSCSI for <font color="#009900">${initiator-iqn}</font>
+<b><font color="#0000FF">set</font></b> <font color="#009900">root-path</font> <font color="#009900">${base-iscsi}</font>:<font color="#009900">${hostname}</font>.boot.ubuntu
+<b><font color="#0000FF">sanboot</font></b> <font color="#009900">${root-path}</font> <font color="#990000">||</font> <b><font color="#0000FF">goto</font></b> <b><font color="#008080">failed</font></b>
+<b><font color="#0000FF">goto</font></b> <b><font color="#008080">start</font></b>
+
+<b><font color="#008080">:vmware</font></b>
+<b><font color="#0000FF">echo</font></b> Booting VMware ESXi from iSCSI for <font color="#009900">${initiator-iqn}</font>
+<b><font color="#0000FF">set</font></b> <font color="#009900">root-path</font> <font color="#009900">${base-iscsi}</font>:<font color="#009900">${hostname}</font>.boot.vmware
+<b><font color="#0000FF">sanboot</font></b> <font color="#009900">${root-path}</font> <font color="#990000">||</font> <b><font color="#0000FF">goto</font></b> <b><font color="#008080">failed</font></b>
+<b><font color="#0000FF">goto</font></b> <b><font color="#008080">start</font></b>
+
+<b><font color="#008080">:windows7</font></b>
+<b><font color="#0000FF">echo</font></b> Booting Windows <font color="#993399">7</font> from iSCSI for <font color="#009900">${initiator-iqn}</font>
+<i><font color="#9A1900"># Force gateway to be the iSCSI target server (kludge for stupid window behavior)</font></i>
+<b><font color="#0000FF">set</font></b> <font color="#009900">netX/gateway</font> <font color="#009900">${iscsi-server}</font>
+<b><font color="#0000FF">set</font></b> <font color="#009900">root-path</font> <font color="#009900">${base-iscsi}</font>:<font color="#009900">${hostname}</font>.boot.windows7
+<b><font color="#0000FF">sanboot</font></b> <font color="#009900">${root-path}</font> <font color="#990000">||</font> <b><font color="#0000FF">goto</font></b> <b><font color="#008080">failed</font></b>
+<b><font color="#0000FF">goto</font></b> <b><font color="#008080">start</font></b>
+
+<b><font color="#008080">:pxelinux</font></b>
+<b><font color="#0000FF">set</font></b> <font color="#009900">210:string</font> tftp://<font color="#009900">${next-server}</font>/
+<b><font color="#0000FF">chain</font></b> <font color="#009900">${210:string}</font>pxelinux.<font color="#993399">0</font> <font color="#990000">||</font> <b><font color="#0000FF">goto</font></b> <b><font color="#008080">failed</font></b>
+<b><font color="#0000FF">goto</font></b> <b><font color="#008080">start</font></b>
+
+<i><font color="#9A1900">###################### RECOVERY MENU ################################</font></i>
+
+<b><font color="#008080">:menu-recovery</font></b>
+<b><font color="#0000FF">menu</font></b> Recovery tools
+<b><font color="#0000FF">item</font></b> sysrcd          SystemRescueCD <font color="#009900">${sysrcd-version}</font>
+<b><font color="#0000FF">item</font></b> spinrite        SpinRite <font color="#009900">${spinrite-version}</font>
+<b><font color="#0000FF">item</font></b> spinrite-msdos  SpinRite <font color="#009900">${spinrite-version}</font> (using MS-DOS <font color="#993399">6.22</font>)
+<b><font color="#0000FF">item</font></b> macrium-winpe Macrium Reflect <font color="#009900">${macrium-version}</font> Rescue CD (WinPE <font color="#993399">4.0</font> <font color="#009900">${arch}</font>)
+<b><font color="#0000FF">item</font></b> macrium-winpe-sanboot   Macrium Reflect <font color="#009900">${macrium-version}</font> Rescue CD (WinPE <font color="#993399">4.0</font> <font color="#009900">${arch}</font> with sanboot)
+<b><font color="#0000FF">item</font></b> macrium-linux   Macrium Reflect <font color="#009900">${macrium-version}</font> Rescue CD (Linux <font color="#009900">${arch}</font>)
+<b><font color="#0000FF">item</font></b> macrium-linux-sanboot   Macrium Reflect <font color="#009900">${macrium-version}</font> Rescue CD (Linux <font color="#009900">${arch}</font> with sanboot)
+<b><font color="#0000FF">item</font></b> firefly         Firefly IllumOS recovery environment <font color="#009900">${firefly-version}</font>
+<b><font color="#0000FF">item</font></b> freedos-direct  FreeDOS <font color="#993399">1.1</font> (directly using iPXE)
+<b><font color="#0000FF">item</font></b>
+<b><font color="#0000FF">item</font></b> --key <font color="#993399">0x08</font> back Back to top menu...
+<b><font color="#0000FF">iseq</font></b> <font color="#009900">${menu-default}</font> menu-recovery <font color="#990000">&amp;&amp;</font> <b><font color="#0000FF">isset</font></b> <font color="#009900">${submenu-default}</font> <font color="#990000">&amp;&amp;</font> <b><font color="#0000FF">goto</font></b> <b><font color="#008080">menu-recovery-timed</font></b> <font color="#990000">||</font>
+<b><font color="#0000FF">choose</font></b> selected <font color="#990000">&amp;&amp;</font> <b><font color="#0000FF">goto</font></b> <font color="#009900">${selected}</font> <font color="#990000">||</font> <b><font color="#0000FF">goto</font></b> <b><font color="#008080">start</font></b>
+<b><font color="#008080">:menu-recovery-timed</font></b>
+<b><font color="#0000FF">choose</font></b> --timeout <font color="#009900">${submenu-timeout}</font> --default <font color="#009900">${submenu-default}</font> selected <font color="#990000">&amp;&amp;</font> <b><font color="#0000FF">goto</font></b> <font color="#009900">${selected}</font> <font color="#990000">||</font> <b><font color="#0000FF">goto</font></b> <b><font color="#008080">start</font></b>
+
+<b><font color="#008080">:spinrite</font></b>
+<b><font color="#0000FF">sanboot</font></b> --no-describe --drive <font color="#993399">0x00</font> <font color="#009900">${sanboot-url}</font>spinrite-<font color="#009900">${spinrite-version}</font>/spinrite-<font color="#009900">${spinrite-version}</font>.img <font color="#990000">||</font> <b><font color="#0000FF">goto</font></b> <b><font color="#008080">failed</font></b>
+<i><font color="#9A1900">#sanboot --no-describe --drive 0x081 ${sanboot-url}spinrite-${spinrite-version}/spinrite-${spinrite-version}.iso</font></i>
+<i><font color="#9A1900">#initrd spinrite/spinrite-${spinrite-version}.img</font></i>
+<i><font color="#9A1900">#chain memdisk</font></i>
+<b><font color="#0000FF">goto</font></b> <b><font color="#008080">start</font></b>
+
+<b><font color="#008080">:spinrite-msdos</font></b>
+<b><font color="#0000FF">sanboot</font></b> --no-describe --drive <font color="#993399">0x00</font> <font color="#009900">${sanboot-url}</font>spinrite-<font color="#009900">${spinrite-version}</font>/spinrite-<font color="#009900">${spinrite-version}</font>-msdos.img <font color="#990000">||</font> <b><font color="#0000FF">goto</font></b> <b><font color="#008080">failed</font></b>
+<b><font color="#0000FF">goto</font></b> <b><font color="#008080">start</font></b>
+
+<b><font color="#008080">:sysrcd</font></b>
+<b><font color="#0000FF">echo</font></b> Booting SystemRescueCD <font color="#009900">${sysrcd-version}</font> x86 for <font color="#009900">${initiator-iqn}</font>
+<i><font color="#9A1900"># Fixup needed after copying files from downloaded ISO to directory:</font></i>
+<i><font color="#9A1900">#  cd path/to/sysrcd-iso-unpacked-files/isolinux &amp;&amp; \</font></i>
+<i><font color="#9A1900">#   perl -p -i -e 's{/bootdisk}{../bootdisk}' isolinux.cfg &amp;&amp; \</font></i>
+<i><font color="#9A1900">#   perl -p -i -e 's{scandelay=1}{scandelay=1 dodhcp netboot=</font></i><u><font color="#0000FF">nfs://nas.smidsrod.lan</font></u><i><font color="#9A1900">:/raid/boot/sysrcd-3.8.0-x86}g' isolinux.cfg &amp;&amp; \</font></i>
+<i><font color="#9A1900">#   perl -p -i -e 's{setkmap=us}{setkmap=us dodhcp netboot=</font></i><u><font color="#0000FF">nfs://nas.smidsrod.lan</font></u><i><font color="#9A1900">:/raid/boot/sysrcd-3.8.0-x86}g' isolinux.cfg &amp;&amp; \</font></i>
+<i><font color="#9A1900">#   perl -p -i -e 's{rescuecd_us}{rescuecd_no}; s{US}{NO}; s{setkmap=us}{setkmap=no}g; s{american}{norwegian};' isolinux.cfg &amp;&amp; \</font></i>
+<i><font color="#9A1900">#   cd -</font></i>
+<i><font color="#9A1900"># PXELinux options, see </font></i><u><font color="#0000FF">http://syslinux.zytor.com/wiki/index.php/PXELINUX</font></u><i><font color="#9A1900"> for details</font></i>
+<b><font color="#0000FF">set</font></b> <font color="#009900">210:string</font> <font color="#009900">${boot-url}</font>sysrcd-<font color="#009900">${sysrcd-version}</font>-x86/isolinux/
+<b><font color="#0000FF">set</font></b> <font color="#009900">209:string</font> isolinux.cfg
+<b><font color="#0000FF">set</font></b> <font color="#009900">filename</font> <font color="#009900">${210:string}</font>pxelinux.<font color="#993399">0</font>
+<b><font color="#0000FF">chain</font></b> <font color="#009900">${filename}</font> <font color="#990000">||</font> <b><font color="#0000FF">goto</font></b> <b><font color="#008080">failed</font></b>
+<b><font color="#0000FF">goto</font></b> <b><font color="#008080">start</font></b>
+
+<b><font color="#008080">:macrium-winpe</font></b>
+<b><font color="#0000FF">echo</font></b> Booting Macrium Reflect <font color="#009900">${macrium-version}</font> (WinPE <font color="#993399">4.0</font> <font color="#009900">${arch}</font>) for <font color="#009900">${initiator-iqn}</font>
+<b><font color="#0000FF">set</font></b> <font color="#009900">base-url</font> macrium-<font color="#009900">${macrium-version}</font>/macrium-<font color="#009900">${macrium-version}</font>-rescue-winpe-<font color="#993399">4.0</font>-<font color="#009900">${arch}</font>
+<b><font color="#0000FF">kernel</font></b> wimboot
+<b><font color="#0000FF">initrd</font></b> <font color="#009900">${base-url}</font>/bootmgr          bootmgr
+<b><font color="#0000FF">initrd</font></b> <font color="#009900">${base-url}</font>/Boot/BCD         BCD
+<b><font color="#0000FF">initrd</font></b> <font color="#009900">${base-url}</font>/Boot/boot.sdi    boot.sdi
+<b><font color="#0000FF">initrd</font></b> <font color="#009900">${base-url}</font>/sources/boot.wim boot.wim
+<b><font color="#0000FF">boot</font></b> <font color="#990000">||</font> <b><font color="#0000FF">goto</font></b> <b><font color="#008080">failed</font></b>
+<b><font color="#0000FF">goto</font></b> <b><font color="#008080">start</font></b>
+
+<b><font color="#008080">:macrium-linux</font></b>
+<b><font color="#0000FF">echo</font></b> Booting Macrium Reflect <font color="#009900">${macrium-version}</font> (Linux <font color="#009900">${arch}</font>) for <font color="#009900">${initiator-iqn}</font>
+<b><font color="#0000FF">set</font></b> <font color="#009900">base-url</font> macrium-<font color="#009900">${macrium-version}</font>/macrium-<font color="#009900">${macrium-version}</font>-rescue-linux
+<b><font color="#0000FF">kernel</font></b> <font color="#009900">${base-url}</font>/vmlinuz
+<b><font color="#0000FF">initrd</font></b> <font color="#009900">${base-url}</font>/initramfs.xz
+<b><font color="#0000FF">imgargs</font></b> vmlinuz vga=<font color="#993399">0x317</font>
+<b><font color="#0000FF">boot</font></b> <font color="#990000">||</font> <b><font color="#0000FF">goto</font></b> <b><font color="#008080">failed</font></b>
+<b><font color="#0000FF">goto</font></b> <b><font color="#008080">start</font></b>
+
+<b><font color="#008080">:macrium-winpe-sanboot</font></b>
+<b><font color="#0000FF">sanboot</font></b> --no-describe <font color="#009900">${sanboot-url}</font>macrium-<font color="#009900">${macrium-version}</font>/macrium-<font color="#009900">${macrium-version}</font>-rescue-winpe-<font color="#993399">4.0</font>-<font color="#009900">${arch}</font>.iso <font color="#990000">||</font> <b><font color="#0000FF">goto</font></b> <b><font color="#008080">failed</font></b>
+<b><font color="#0000FF">goto</font></b> <b><font color="#008080">start</font></b>
+
+<b><font color="#008080">:macrium-linux-sanboot</font></b>
+<b><font color="#0000FF">sanboot</font></b> --no-describe <font color="#009900">${sanboot-url}</font>macrium-<font color="#009900">${macrium-version}</font>/macrium-<font color="#009900">${macrium-version}</font>-rescue-linux.iso <font color="#990000">||</font> <b><font color="#0000FF">goto</font></b> <b><font color="#008080">failed</font></b>
+<b><font color="#0000FF">goto</font></b> <b><font color="#008080">start</font></b>
+
+<b><font color="#008080">:firefly</font></b>
+<b><font color="#0000FF">echo</font></b> Booting Firefly <font color="#009900">${firefly-version}</font> for <font color="#009900">${initiator-iqn}</font>
+<b><font color="#0000FF">set</font></b> <font color="#009900">base-url</font> firefly-<font color="#009900">${firefly-version}</font>/boot
+<i><font color="#9A1900"># </font></i><u><font color="#0000FF">http://alexeremin.blogspot.no/2013/05/firefly-failsafe-image-for-illumos.html</font></u>
+<i><font color="#9A1900"># </font></i><u><font color="#0000FF">http://sourceforge.net/projects/fireflyfailsafe/files/</font></u>
+<i><font color="#9A1900"># Download ISO, unpack ISO and copy files to boot-url</font></i>
+<i><font color="#9A1900"># The ramdisk is compressed with gzip, which must be unpacked</font></i>
+<i><font color="#9A1900"># to work with iPXE</font></i>
+<i><font color="#9A1900"># mv firefly firefly.gz</font></i>
+<i><font color="#9A1900"># gunzip firefly.gz</font></i>
+<b><font color="#0000FF">kernel</font></b> <font color="#009900">${base-url}</font>/platform/i86pc/kernel/amd64/unix
+<b><font color="#0000FF">module</font></b> <font color="#009900">${base-url}</font>/firefly
+<b><font color="#0000FF">boot</font></b> <font color="#990000">||</font> <b><font color="#0000FF">goto</font></b> <b><font color="#008080">failed</font></b>
+<b><font color="#0000FF">goto</font></b> <b><font color="#008080">start</font></b>
+
+<b><font color="#008080">:freedos-direct</font></b>
+<b><font color="#0000FF">echo</font></b> Booting FreeDOS <font color="#993399">1.1</font> KERNEL.SYS for <font color="#009900">${initiator-iqn}</font>
+<b><font color="#0000FF">set</font></b> <font color="#009900">base-url</font> freedos-<font color="#993399">1.1</font>/fd11src/FREEDOS/SETUP/ODIN
+<i><font color="#9A1900"># TODO: Work-in-progress</font></i>
+<b><font color="#0000FF">kernel</font></b> <font color="#009900">${base-url}</font>/KERNEL.SYS
+<b><font color="#0000FF">boot</font></b> <font color="#990000">||</font> <b><font color="#0000FF">goto</font></b> <b><font color="#008080">failed</font></b>
+<b><font color="#0000FF">goto</font></b> <b><font color="#008080">start</font></b>
+
+<i><font color="#9A1900">###################### DIAGNOSTICS MENU #############################</font></i>
+
+<b><font color="#008080">:menu-diag</font></b>
+<b><font color="#0000FF">menu</font></b> Diagnostic tools
+<b><font color="#0000FF">item</font></b> hdt           HDT <font color="#009900">${hdt-version}</font>
+<b><font color="#0000FF">item</font></b> memtest       Memtest86+ <font color="#993399">4.20</font>
+<b><font color="#0000FF">item</font></b> memtest-ipxe  Memtest86+ <font color="#993399">4.20</font> (iPXE)
+<b><font color="#0000FF">item</font></b> breakin       Breakin <font color="#993399">3.71</font>
+<b><font color="#0000FF">item</font></b> dban          Darik's Boot and Nuke <font color="#993399">2.2</font>.<font color="#993399">7</font>
+<b><font color="#0000FF">item</font></b> etdump        Bart's etdump <font color="#993399">1.2</font>
+<b><font color="#0000FF">item</font></b> wdcdiag       Western Digital Diagnostics <font color="#993399">5</font>.04f
+<b><font color="#0000FF">item</font></b>
+<b><font color="#0000FF">item</font></b> --key <font color="#993399">0x08</font> back Back to top menu...
+<b><font color="#0000FF">iseq</font></b> <font color="#009900">${menu-default}</font> menu-diag <font color="#990000">&amp;&amp;</font> <b><font color="#0000FF">isset</font></b> <font color="#009900">${submenu-default}</font> <font color="#990000">&amp;&amp;</font> <b><font color="#0000FF">goto</font></b> <b><font color="#008080">menu-diag-timed</font></b> <font color="#990000">||</font>
+<b><font color="#0000FF">choose</font></b> selected <font color="#990000">&amp;&amp;</font> <b><font color="#0000FF">goto</font></b> <font color="#009900">${selected}</font> <font color="#990000">||</font> <b><font color="#0000FF">goto</font></b> <b><font color="#008080">start</font></b>
+<b><font color="#008080">:menu-diag-timed</font></b>
+<b><font color="#0000FF">choose</font></b> --timeout <font color="#009900">${submenu-timeout}</font> --default <font color="#009900">${submenu-default}</font> selected <font color="#990000">&amp;&amp;</font> <b><font color="#0000FF">goto</font></b> <font color="#009900">${selected}</font> <font color="#990000">||</font> <b><font color="#0000FF">goto</font></b> <b><font color="#008080">start</font></b>
+
+<b><font color="#008080">:hdt</font></b>
+<i><font color="#9A1900"># </font></i><u><font color="#0000FF">http://hdt-project.org/</font></u>
+<b><font color="#0000FF">sanboot</font></b> --no-describe --drive <font color="#993399">0x00</font> <font color="#009900">${sanboot-url}</font>hdt-<font color="#009900">${hdt-version}</font>.img <font color="#990000">||</font> <b><font color="#0000FF">goto</font></b> <b><font color="#008080">failed</font></b>
+<b><font color="#0000FF">goto</font></b> <b><font color="#008080">start</font></b>
+
+<b><font color="#008080">:memtest</font></b>
+<i><font color="#9A1900"># TODO: Fix the URI parser to make the + sign work</font></i>
+<i><font color="#9A1900">#chain memtest86+-4.20.elf.img - || goto failed</font></i>
+<b><font color="#0000FF">chain</font></b> memtest86plus-<font color="#993399">4.20</font>.elf.img - <font color="#990000">||</font> <b><font color="#0000FF">goto</font></b> <b><font color="#008080">failed</font></b>
+<b><font color="#0000FF">goto</font></b> <b><font color="#008080">start</font></b>
+
+<b><font color="#008080">:memtest-ipxe</font></b>
+<b><font color="#0000FF">chain</font></b> memtest.<font color="#993399">0</font> passes=<font color="#993399">1</font> <font color="#990000">&amp;&amp;</font> <b><font color="#0000FF">set</font></b> <font color="#009900">memtest</font> GOOD <font color="#990000">||</font> <b><font color="#0000FF">set</font></b> <font color="#009900">memtest</font> BAD
+<b><font color="#0000FF">set</font></b> <font color="#009900">memtest_errno:uint8</font> <font color="#009900">${errno}</font>
+<b><font color="#0000FF">iseq</font></b> <font color="#009900">${memtest}</font> GOOD <font color="#990000">&amp;&amp;</font> <b><font color="#0000FF">goto</font></b> <b><font color="#008080">memtest-info</font></b> <font color="#990000">||</font>
+<b><font color="#0000FF">iseq</font></b> <font color="#009900">${memtest_errno}</font> <font color="#993399">0x1</font> <font color="#990000">&amp;&amp;</font> <b><font color="#0000FF">set</font></b> <font color="#009900">memtest</font> BAD <font color="#990000">||</font> <b><font color="#0000FF">set</font></b> <font color="#009900">memtest</font> UNKNOWN
+<b><font color="#008080">:memtest-info</font></b>
+<b><font color="#0000FF">menu</font></b> Your memory seems to be <font color="#009900">${memtest}</font>
+<b><font color="#0000FF">item</font></b> memtest-report   Report memtest result to web service
+<b><font color="#0000FF">item</font></b> --key <font color="#993399">0x08</font> menu-diag Back to diagnostics menu...
+<b><font color="#0000FF">choose</font></b> --default menu-diag selected <font color="#990000">&amp;&amp;</font> <b><font color="#0000FF">goto</font></b> <font color="#009900">${selected}</font> <font color="#990000">||</font> <b><font color="#0000FF">goto</font></b> <b><font color="#008080">start</font></b>
+
+<b><font color="#008080">:memtest-report</font></b>
+<b><font color="#0000FF">chain</font></b> <font color="#009900">${memtest-report-url}</font>?result=<font color="#009900">${memtest}</font>&amp;mac=<font color="#009900">${mac}</font>&amp;uuid=<font color="#009900">${uuid}</font>&amp;hostname=<font color="#009900">${hostname}</font> <font color="#990000">||</font>
+<b><font color="#0000FF">goto</font></b> <b><font color="#008080">menu-diag</font></b>
+
+<b><font color="#008080">:breakin</font></b>
+<i><font color="#9A1900"># Stress-testing and diagnostics utility</font></i>
+<i><font color="#9A1900"># </font></i><u><font color="#0000FF">http://www.advancedclustering.com/software/breakin.html</font></u>
+<i><font color="#9A1900"># Set sshpasswd=yourpassword for remote access</font></i>
+<i><font color="#9A1900"># Set startup= to 'cloner' or 'rescue' for more features</font></i>
+<i><font color="#9A1900"># When startup=cloner, server= and image= can also be set</font></i>
+<i><font color="#9A1900"># </font></i><u><font color="#0000FF">http://www.advancedclustering.com/software/cloner.html</font></u>
+<b><font color="#0000FF">kernel</font></b> breakin-<font color="#993399">3.71</font>/kernel-<font color="#993399">3.71</font>
+<b><font color="#0000FF">initrd</font></b> breakin-<font color="#993399">3.71</font>/initrd-<font color="#993399">3.71</font>.cpio.lzma
+<b><font color="#0000FF">imgargs</font></b> kernel-<font color="#993399">3.71</font> startup=breakin
+<b><font color="#0000FF">boot</font></b> <font color="#990000">||</font> <b><font color="#0000FF">goto</font></b> <b><font color="#008080">failed</font></b>
+<b><font color="#0000FF">goto</font></b> <b><font color="#008080">start</font></b>
+
+<b><font color="#008080">:dban</font></b>
+<b><font color="#0000FF">kernel</font></b> dban-<font color="#993399">2.2</font>.<font color="#993399">7</font>/DBAN.BZI
+<b><font color="#0000FF">imgargs</font></b> DBAN.BZI nuke="dwipe --method gutmann --rounds <font color="#993399">2</font> --verify last" silent vga=<font color="#993399">785</font>
+<b><font color="#0000FF">boot</font></b> <font color="#990000">||</font> <b><font color="#0000FF">goto</font></b> <b><font color="#008080">failed</font></b>
+<b><font color="#0000FF">goto</font></b> <b><font color="#008080">start</font></b>
+
+<b><font color="#008080">:etdump</font></b>
+<i><font color="#9A1900"># Booting it with memdisk makes it read/write, while sanboot forces read/only</font></i>
+<i><font color="#9A1900">#sanboot --drive 0x00 ${sanboot-url}freedos-etdump-floppy.img</font></i>
+<b><font color="#0000FF">initrd</font></b> freedos-etdump-floppy.img
+<b><font color="#0000FF">chain</font></b> memdisk <font color="#990000">||</font> <b><font color="#0000FF">goto</font></b> <b><font color="#008080">failed</font></b>
+<b><font color="#0000FF">goto</font></b> <b><font color="#008080">start</font></b>
+
+<b><font color="#008080">:wdcdiag</font></b>
+<i><font color="#9A1900"># Extracted the bootable floppy image from diag-5.04f.iso</font></i>
+<b><font color="#0000FF">sanboot</font></b> --drive <font color="#993399">0x00</font> <font color="#009900">${sanboot-url}</font>western-digital/diag-<font color="#993399">5</font>.04f.img <font color="#990000">||</font> <b><font color="#0000FF">goto</font></b> <b><font color="#008080">failed</font></b>
+<b><font color="#0000FF">goto</font></b> <b><font color="#008080">start</font></b>
+
+<i><font color="#9A1900">############################ INSTALLER MENU #########################</font></i>
+
+<b><font color="#008080">:menu-install</font></b>
+<b><font color="#0000FF">menu</font></b> Installers for <font color="#009900">${initiator-iqn}</font>
+<b><font color="#0000FF">item</font></b> freedos-install      Install FreeDOS <font color="#993399">1.1</font> to iSCSI
+<b><font color="#0000FF">item</font></b> msdos-install        Install MS-DOS <font color="#993399">6.22</font> to iSCSI
+<b><font color="#0000FF">item</font></b> ubuntu-install       Install Ubuntu <font color="#993399">12.04</font> <font color="#009900">${archl}</font> to iSCSI
+<b><font color="#0000FF">item</font></b> windows7-install     Install Windows <font color="#993399">7</font> to iSCSI
+<b><font color="#0000FF">item</font></b> vmware-x64-install   Install VMware ESXi <font color="#993399">5.0</font> (x64) to iSCSI
+<b><font color="#0000FF">item</font></b> vmware-x86-install   Install VMware ESXi <font color="#993399">3.5</font> (x86) to iSCSI
+<b><font color="#0000FF">item</font></b> winpe                Hook Windows <font color="#993399">7</font> iSCSI and boot WinPE
+<b><font color="#0000FF">item</font></b> winpe-wimboot        Boot WinPE <font color="#009900">${arch}</font> using wimboot
+<b><font color="#0000FF">item</font></b> ubuntu-installer-remote Install Ubuntu <font color="#993399">12.04</font> <font color="#009900">${archl}</font> from public archive
+<b><font color="#0000FF">item</font></b> ubuntu-install-local Install Ubuntu <font color="#993399">12.04</font> <font color="#009900">${archl}</font> to local drive(s)
+<b><font color="#0000FF">item</font></b> xenclient-install   Install XenClient <font color="#993399">2.1</font> to local drive
+<b><font color="#0000FF">item</font></b> windows7-hookonly   Hook Windows <font color="#993399">7</font> iSCSI and boot local CD
+<b><font color="#0000FF">item</font></b>
+<b><font color="#0000FF">item</font></b> --key <font color="#993399">0x08</font> back      Back to top menu...
+<b><font color="#0000FF">iseq</font></b> <font color="#009900">${menu-default}</font> menu-install <font color="#990000">&amp;&amp;</font> <b><font color="#0000FF">isset</font></b> <font color="#009900">${submenu-default}</font> <font color="#990000">&amp;&amp;</font> <b><font color="#0000FF">goto</font></b> <b><font color="#008080">menu-install-timed</font></b> <font color="#990000">||</font>
+<b><font color="#0000FF">choose</font></b> selected <font color="#990000">&amp;&amp;</font> <b><font color="#0000FF">goto</font></b> <font color="#009900">${selected}</font> <font color="#990000">||</font> <b><font color="#0000FF">goto</font></b> <b><font color="#008080">start</font></b>
+<b><font color="#008080">:menu-install-timed</font></b>
+<b><font color="#0000FF">choose</font></b> --timeout <font color="#009900">${submenu-timeout}</font> --default <font color="#009900">${submenu-default}</font> selected <font color="#990000">&amp;&amp;</font> <b><font color="#0000FF">goto</font></b> <font color="#009900">${selected}</font> <font color="#990000">||</font> <b><font color="#0000FF">goto</font></b> <b><font color="#008080">start</font></b>
+
+<b><font color="#008080">:freedos-install</font></b>
+<b><font color="#0000FF">echo</font></b> Booting FreeDOS <font color="#993399">1.1</font> installer to iSCSI for <font color="#009900">${initiator-iqn}</font>
+<b><font color="#0000FF">set</font></b> <font color="#009900">root-path</font> <font color="#009900">${base-iscsi}</font>:<font color="#009900">${hostname}</font>.boot.freedos
+<b><font color="#0000FF">sanhook</font></b> <font color="#009900">${root-path}</font> <font color="#990000">||</font> <b><font color="#0000FF">goto</font></b> <b><font color="#008080">failed</font></b>
+<b><font color="#0000FF">sanboot</font></b> --drive <font color="#993399">0x81</font> <font color="#009900">${sanboot-url}</font>freedos-<font color="#993399">1.1</font>/fd11src.iso <font color="#990000">||</font> <b><font color="#0000FF">goto</font></b> <b><font color="#008080">failed</font></b>
+<b><font color="#0000FF">goto</font></b> <b><font color="#008080">start</font></b>
+
+<b><font color="#008080">:msdos-install</font></b>
+<b><font color="#0000FF">echo</font></b> Booting MS-DOS <font color="#993399">6.22</font> installer to iSCSI for <font color="#009900">${initiator-iqn}</font>
+<b><font color="#0000FF">set</font></b> <font color="#009900">root-path</font> <font color="#009900">${base-iscsi}</font>:<font color="#009900">${hostname}</font>.boot.msdos
+<b><font color="#0000FF">sanhook</font></b> <font color="#009900">${root-path}</font> <font color="#990000">||</font> <b><font color="#0000FF">goto</font></b> <b><font color="#008080">failed</font></b>
+<b><font color="#0000FF">sanboot</font></b> --no-describe --drive <font color="#993399">0x00</font> <font color="#009900">${sanboot-url}</font>msdos-<font color="#993399">6.22</font>/disk1.img <font color="#990000">||</font> <b><font color="#0000FF">goto</font></b> <b><font color="#008080">failed</font></b>
+<b><font color="#0000FF">goto</font></b> <b><font color="#008080">start</font></b>
+
+<b><font color="#008080">:ubuntu-install</font></b>
+<b><font color="#0000FF">echo</font></b> Starting Ubuntu <font color="#993399">12.04</font> <font color="#009900">${archl}</font> installer for <font color="#009900">${initiator-iqn}</font>
+<i><font color="#9A1900"># Hook iSCSI drive</font></i>
+<b><font color="#0000FF">set</font></b> <font color="#009900">root-path</font> <font color="#009900">${base-iscsi}</font>:<font color="#009900">${hostname}</font>.boot.ubuntu
+<i><font color="#9A1900">#sanhook ${root-path} || goto failed</font></i>
+<i><font color="#9A1900"># Start ubuntu-installer. Remember that the iSCSI target must be writable</font></i>
+<i><font color="#9A1900"># by anyone, as debian-installer generates a randomized initiator-iqn in</font></i>
+<i><font color="#9A1900"># /etc/iscsi/initiatorname.iscsi</font></i>
+<i><font color="#9A1900"># The preseed script used takes care of rewriting it to the</font></i>
+<i><font color="#9A1900"># hostname-based IQN used in this script.</font></i>
+<i><font color="#9A1900"># This kernel param which open-iscsi README.Debian mentions doesn't work</font></i>
+<i><font color="#9A1900"># inside debian-installer, unfortunately: iscsi_initiator=${initiator-iqn}</font></i>
+<i><font color="#9A1900"># Hard workaround available here:</font></i>
+<i><font color="#9A1900"># </font></i><u><font color="#0000FF">http://umfcloudpilot.eduserv.org.uk/entries/20299686-enable-pre-seed-or-kickstart-seeding-of-iscsi-intiator-iqn-in-ubuntu-server</font></u>
+<b><font color="#0000FF">set</font></b> <font color="#009900">base-url</font> <font color="#009900">${boot-url}</font>ubuntu-<font color="#993399">12.04</font>-server-<font color="#009900">${archl}</font>
+<b><font color="#0000FF">kernel</font></b> <font color="#009900">${base-url}</font>/install/netboot/ubuntu-installer/<font color="#009900">${archl}</font>/linux
+<b><font color="#0000FF">initrd</font></b> <font color="#009900">${base-url}</font>/install/netboot/ubuntu-installer/<font color="#009900">${archl}</font>/initrd.gz
+<b><font color="#0000FF">imgargs</font></b> linux auto=true fb=false url=<font color="#009900">${base-url}</font>/./preseed.cfg DEBCONF_DEBUG=<font color="#993399">5</font> netcfg/get_hostname=<font color="#009900">${hostname}</font> partman-iscsi/login/address=<font color="#009900">${iscsi-server}</font> partman-iscsi/login/targets=<font color="#009900">${base-iqn}</font>:<font color="#009900">${hostname}</font>.boot.ubuntu partman-iscsi/login/username=<font color="#009900">${username}</font> partman-iscsi/login/password=<font color="#009900">${password}</font>
+<b><font color="#0000FF">boot</font></b> <font color="#990000">||</font> <b><font color="#0000FF">goto</font></b> <b><font color="#008080">failed</font></b>
+<b><font color="#0000FF">goto</font></b> <b><font color="#008080">start</font></b>
+
+<b><font color="#008080">:ubuntu-install-local</font></b>
+<b><font color="#0000FF">echo</font></b> Starting Ubuntu <font color="#993399">12.04</font> <font color="#009900">${archl}</font> local installer for <font color="#009900">${initiator-iqn}</font>
+<b><font color="#0000FF">set</font></b> <font color="#009900">base-url</font> <font color="#009900">${boot-url}</font>ubuntu-<font color="#993399">12.04</font>-server-<font color="#009900">${archl}</font>
+<b><font color="#0000FF">kernel</font></b> <font color="#009900">${base-url}</font>/install/netboot/ubuntu-installer/<font color="#009900">${archl}</font>/linux
+<b><font color="#0000FF">initrd</font></b> <font color="#009900">${base-url}</font>/install/netboot/ubuntu-installer/<font color="#009900">${archl}</font>/initrd.gz
+<b><font color="#0000FF">imgargs</font></b> linux auto=true fb=false url=<font color="#009900">${base-url}</font>/./preseed.cfg
+<b><font color="#0000FF">boot</font></b> <font color="#990000">||</font> <b><font color="#0000FF">goto</font></b> <b><font color="#008080">failed</font></b>
+<b><font color="#0000FF">goto</font></b> <b><font color="#008080">start</font></b>
+
+<b><font color="#008080">:windows7-install</font></b>
+<b><font color="#0000FF">echo</font></b> Starting Windows <font color="#993399">7</font> <font color="#009900">${arch}</font> installer for <font color="#009900">${initiator-iqn}</font>
+<i><font color="#9A1900"># Force gateway to be the iSCSI target server (kludge for stupid window behavior)</font></i>
+<b><font color="#0000FF">set</font></b> <font color="#009900">netX/gateway</font> <font color="#009900">${iscsi-server}</font>
+<i><font color="#9A1900"># Hook iSCSI drive</font></i>
+<b><font color="#0000FF">set</font></b> <font color="#009900">root-path</font> <font color="#009900">${base-iscsi}</font>:<font color="#009900">${hostname}</font>.boot.windows7
+<b><font color="#0000FF">sanhook</font></b> <font color="#009900">${root-path}</font> <font color="#990000">||</font> <b><font color="#0000FF">goto</font></b> <b><font color="#008080">failed</font></b>
+<i><font color="#9A1900"># Start Windows 7 installer DVD</font></i>
+<i><font color="#9A1900">#sanboot --no-describe --drive 0x81 ${sanboot-url}windows-7/ultimate-${arch}-en.iso || goto failed</font></i>
+<i><font color="#9A1900"># Better solution, according to Oliver Rath on the mailing-list</font></i>
+<i><font color="#9A1900"># Requires massive amounts of RAM, though</font></i>
+<i><font color="#9A1900">#initrd windows-7/ultimate-${arch}-en.iso</font></i>
+<i><font color="#9A1900">#chain memdisk iso raw || goto failed</font></i>
+<i><font color="#9A1900"># This method uses wimboot</font></i>
+<b><font color="#0000FF">set</font></b> <font color="#009900">base-url</font> windows-<font color="#993399">7</font>/ultimate-<font color="#009900">${arch}</font>-en
+<b><font color="#0000FF">kernel</font></b> wimboot
+<b><font color="#0000FF">initrd</font></b> <font color="#009900">${base-url}</font>/bootmgr                     bootmgr
+<b><font color="#0000FF">initrd</font></b> <font color="#009900">${base-url}</font>/boot/bcd                    BCD
+<b><font color="#0000FF">initrd</font></b> <font color="#009900">${base-url}</font>/boot/fonts/wgl4_boot.ttf    wgl4_boot.ttf
+<b><font color="#0000FF">initrd</font></b> <font color="#009900">${base-url}</font>/boot/boot.sdi               boot.sdi
+<b><font color="#0000FF">initrd</font></b> <font color="#009900">${base-url}</font>/sources/boot.wim            boot.wim
+<b><font color="#0000FF">boot</font></b> <font color="#990000">||</font> <b><font color="#0000FF">goto</font></b> <b><font color="#008080">failed</font></b>
+<b><font color="#0000FF">goto</font></b> <b><font color="#008080">start</font></b>
+
+<b><font color="#008080">:vmware-x64-install</font></b>
+<b><font color="#0000FF">echo</font></b> Booting VMware <font color="#993399">64</font>-bit installer for <font color="#009900">${initiator-iqn}</font>
+<b><font color="#0000FF">set</font></b> <font color="#009900">root-path</font> <font color="#009900">${base-iscsi}</font>:<font color="#009900">${hostname}</font>.boot.vmware
+<b><font color="#0000FF">sanhook</font></b> <font color="#009900">${root-path}</font> <font color="#990000">||</font> <b><font color="#0000FF">goto</font></b> <b><font color="#008080">failed</font></b>
+<b><font color="#0000FF">initrd</font></b> vmware/vmware-esxi-<font color="#993399">5.0</font>-x64.iso
+<b><font color="#0000FF">chain</font></b> memdisk iso <font color="#990000">||</font> <b><font color="#0000FF">goto</font></b> <b><font color="#008080">failed</font></b>
+<b><font color="#0000FF">goto</font></b> <b><font color="#008080">start</font></b>
+
+<b><font color="#008080">:vmware-x86-install</font></b>
+<b><font color="#0000FF">echo</font></b> Booting VMware <font color="#993399">32</font>-bit installer for <font color="#009900">${initiator-iqn}</font>
+<b><font color="#0000FF">set</font></b> <font color="#009900">root-path</font> <font color="#009900">${base-iscsi}</font>:<font color="#009900">${hostname}</font>.boot.vmware
+<b><font color="#0000FF">sanhook</font></b> <font color="#009900">${root-path}</font> <font color="#990000">||</font> <b><font color="#0000FF">goto</font></b> <b><font color="#008080">failed</font></b>
+<b><font color="#0000FF">initrd</font></b> vmware/vmware-esxi-<font color="#993399">3.5</font>-x86.iso
+<b><font color="#0000FF">chain</font></b> memdisk iso <font color="#990000">||</font> <b><font color="#0000FF">goto</font></b> <b><font color="#008080">failed</font></b>
+<b><font color="#0000FF">goto</font></b> <b><font color="#008080">start</font></b>
+
+<b><font color="#008080">:winpe</font></b>
+<b><font color="#0000FF">echo</font></b> Booting Windows PE <font color="#009900">${arch}</font> installer for <font color="#009900">${initiator-iqn}</font>
+<b><font color="#0000FF">echo</font></b> (for installing Windows <font color="#993399">7</font>)
+<i><font color="#9A1900"># Force gateway to be the iSCSI target server (kludge for stupid window behavior)</font></i>
+<b><font color="#0000FF">set</font></b> <font color="#009900">netX/gateway</font> <font color="#009900">${iscsi-server}</font>
+
+<b><font color="#0000FF">set</font></b> <font color="#009900">root-path</font> <font color="#009900">${base-iscsi}</font>:<font color="#009900">${hostname}</font>.boot.windows7
+<b><font color="#0000FF">sanhook</font></b> <font color="#009900">${root-path}</font> <font color="#990000">||</font> <b><font color="#0000FF">goto</font></b> <b><font color="#008080">failed</font></b>
+
+<i><font color="#9A1900"># Remember to map the install volume with the following command:</font></i>
+<i><font color="#9A1900"># net use y: \\nas\wds /user:NAS\robin</font></i>
+<i><font color="#9A1900"># Use Y:\Operating Systems\Windows 7 x64\setup.exe to install</font></i>
+
+<i><font color="#9A1900"># Boots WinPE via native MS TFTP support</font></i>
+<i><font color="#9A1900">#chain tftp://${next-server}/%5CBoot%5CPXE%5Cpxeboot.n12</font></i>
+<i><font color="#9A1900"># Better solution, according to Oliver Rath on the mailing-list</font></i>
+<i><font color="#9A1900"># Requires decent amounts of RAM, though</font></i>
+<i><font color="#9A1900"># Details on how to generate winpe-x64.iso from you Windows 7 install DVD</font></i>
+<i><font color="#9A1900"># can be found here: </font></i><u><font color="#0000FF">http://technet.microsoft.com/en-us/library/cc722358</font></u><i><font color="#9A1900">%28v=ws.10%29.aspx</font></i>
+<b><font color="#0000FF">initrd</font></b> windows-<font color="#993399">7</font>/winpe-<font color="#009900">${arch}</font>.iso
+<b><font color="#0000FF">chain</font></b> memdisk iso raw <font color="#990000">||</font> <b><font color="#0000FF">goto</font></b> <b><font color="#008080">failed</font></b>
+<b><font color="#0000FF">goto</font></b> <b><font color="#008080">start</font></b>
+
+<b><font color="#008080">:winpe-wimboot</font></b>
+<b><font color="#0000FF">echo</font></b> Booting Windows PE <font color="#009900">${arch}</font> installer for <font color="#009900">${initiator-iqn}</font>
+<i><font color="#9A1900">#echo (for installing Windows 7)</font></i>
+
+<i><font color="#9A1900"># Force gateway to be the iSCSI target server (kludge for stupid window behavior)</font></i>
+<b><font color="#0000FF">set</font></b> <font color="#009900">netX/gateway</font> <font color="#009900">${iscsi-server}</font>
+
+<b><font color="#0000FF">set</font></b> <font color="#009900">root-path</font> <font color="#009900">${base-iscsi}</font>:<font color="#009900">${hostname}</font>.boot.windows7
+<b><font color="#0000FF">sanhook</font></b> <font color="#009900">${root-path}</font> <font color="#990000">||</font> <b><font color="#0000FF">goto</font></b> <b><font color="#008080">failed</font></b>
+
+<i><font color="#9A1900"># Remember to map the install volume with the following command:</font></i>
+<i><font color="#9A1900"># net use y: \\nas\wds /user:NAS\robin</font></i>
+<i><font color="#9A1900"># Use Y:\Operating Systems\Windows 7 x64\setup.exe to install</font></i>
+
+<i><font color="#9A1900"># Boots WinPE via iPXE wimboot binary</font></i>
+<i><font color="#9A1900"># BCD is from </font></i><u><font color="#0000FF">http://www.fensystems.co.uk/~mcb30/BCD</font></u>
+<i><font color="#9A1900"># wimboot prebuilt from </font></i><u><font color="#0000FF">http://www.fensystems.co.uk/~mcb30/wimboot</font></u>
+<i><font color="#9A1900">#         source at </font></i><u><font color="#0000FF">http://git.ipxe.org/wimboot.git</font></u>
+<i><font color="#9A1900"># bootmgr.exe from the same package that enables PXE booting for Windows</font></i>
+<i><font color="#9A1900">#             (most likely WDS tools)</font></i>
+<b><font color="#0000FF">set</font></b> <font color="#009900">base-url</font> winpe/<font color="#009900">${arch}</font>
+<b><font color="#0000FF">kernel</font></b> wimboot
+<b><font color="#0000FF">initrd</font></b> <font color="#009900">${base-url}</font>/media/bootmgr                     bootmgr
+<b><font color="#0000FF">initrd</font></b> <font color="#009900">${base-url}</font>/media/Boot/BCD                    BCD
+<b><font color="#0000FF">initrd</font></b> <font color="#009900">${base-url}</font>/media/Boot/Fonts/segmono_boot.ttf segmono_boot.ttf
+<b><font color="#0000FF">initrd</font></b> <font color="#009900">${base-url}</font>/media/Boot/Fonts/segoe_slboot.ttf segoe_slboot.ttf
+<b><font color="#0000FF">initrd</font></b> <font color="#009900">${base-url}</font>/media/Boot/Fonts/wgl4_boot.ttf    wgl4_boot.ttf
+<b><font color="#0000FF">initrd</font></b> <font color="#009900">${base-url}</font>/media/Boot/boot.sdi               boot.sdi
+<b><font color="#0000FF">initrd</font></b> <font color="#009900">${base-url}</font>/media/sources/boot.wim            boot.wim
+<b><font color="#0000FF">boot</font></b> <font color="#990000">||</font> <b><font color="#0000FF">goto</font></b> <b><font color="#008080">failed</font></b>
+<b><font color="#0000FF">goto</font></b> <b><font color="#008080">start</font></b>
+
+<b><font color="#008080">:ubuntu-installer-remote</font></b>
+<b><font color="#0000FF">echo</font></b> Starting Ubuntu <font color="#993399">12.04</font> <font color="#009900">${archl}</font> installer for <font color="#009900">${initiator-iqn}</font>
+<b><font color="#0000FF">set</font></b> <font color="#009900">base-url</font> http://no.archive.ubuntu.com/ubuntu/dists/precise/main/installer-<font color="#009900">${archl}</font>/current/images/netboot/ubuntu-installer/<font color="#009900">${archl}</font>
+<b><font color="#0000FF">kernel</font></b> <font color="#009900">${base-url}</font>/linux
+<b><font color="#0000FF">initrd</font></b> <font color="#009900">${base-url}</font>/initrd.gz
+<i><font color="#9A1900">#imgargs linux auto=true url=</font></i><u><font color="#0000FF">http://yourserver/some/path/preseed.cfg</font></u>
+<b><font color="#0000FF">boot</font></b> <font color="#990000">||</font> <b><font color="#0000FF">goto</font></b> <b><font color="#008080">failed</font></b>
+<b><font color="#0000FF">goto</font></b> <b><font color="#008080">start</font></b>
+
+<b><font color="#008080">:xenclient-install</font></b>
+<b><font color="#0000FF">echo</font></b> Booting XenClient <font color="#993399">2.1</font> installer for <font color="#009900">${initiator-iqn}</font>
+<i><font color="#9A1900"># XenClient doesn't seem to support installing to iSCSI volumes</font></i>
+<i><font color="#9A1900"># It only supports installing using iBFT</font></i>
+<i><font color="#9A1900">#set root-path ${base-iscsi}:${hostname}.boot.xenclient</font></i>
+<i><font color="#9A1900">#sanhook ${root-path} || goto failed</font></i>
+<i><font color="#9A1900"># The xenclient-2.1 folder is just the unpacked contents of the installer ISO</font></i>
+<i><font color="#9A1900"># Make sure you modify the isolinux.cfg and point it at your answer file URL</font></i>
+<i><font color="#9A1900"># You can find an example of the answer file in the "Setup and Usage Guide"</font></i>
+<b><font color="#0000FF">set</font></b> <font color="#009900">210:string</font> <font color="#009900">${boot-url}</font>xenclient-<font color="#993399">2.1</font>/isolinux/
+<b><font color="#0000FF">set</font></b> <font color="#009900">209:string</font> isolinux.cfg
+<b><font color="#0000FF">set</font></b> <font color="#009900">filename</font> <font color="#009900">${210:string}</font>pxelinux.<font color="#993399">0</font>
+<b><font color="#0000FF">chain</font></b> <font color="#009900">${filename}</font> <font color="#990000">||</font> <b><font color="#0000FF">goto</font></b> <b><font color="#008080">failed</font></b>
+<b><font color="#0000FF">goto</font></b> <b><font color="#008080">start</font></b>
+
+<b><font color="#008080">:windows7-hookonly</font></b>
+<b><font color="#0000FF">echo</font></b> Hooking Windows <font color="#993399">7</font> iSCSI volume for <font color="#009900">${initiator-iqn}</font>
+<i><font color="#9A1900"># Force gateway to be the iSCSI target server (kludge for stupid window behavior)</font></i>
+<b><font color="#0000FF">set</font></b> <font color="#009900">netX/gateway</font> <font color="#009900">${iscsi-server}</font>
+<i><font color="#9A1900"># Hook iSCSI drive</font></i>
+<b><font color="#0000FF">set</font></b> <font color="#009900">root-path</font> <font color="#009900">${base-iscsi}</font>:<font color="#009900">${hostname}</font>.boot.windows7
+<b><font color="#0000FF">sanhook</font></b> --drive <font color="#993399">0x81</font> <font color="#009900">${root-path}</font> <font color="#990000">||</font> <b><font color="#0000FF">goto</font></b> <b><font color="#008080">failed</font></b>
+<b><font color="#0000FF">echo</font></b> Start Windows <font color="#993399">7</font> installer DVD from local drive
+<b><font color="#0000FF">sanboot</font></b> --no-describe --drive <font color="#993399">0x80</font> <font color="#009900">${sanboot-url}</font>windows-<font color="#993399">7</font>/ultimate-<font color="#009900">${arch}</font>-en.iso <font color="#990000">||</font> <b><font color="#0000FF">goto</font></b> <b><font color="#008080">failed</font></b>
+<b><font color="#0000FF">goto</font></b> <b><font color="#008080">start</font></b>
+
+<i><font color="#9A1900">###################### LIVE ENVIRONMENT MENU ########################</font></i>
+
+<b><font color="#008080">:menu-live</font></b>
+<b><font color="#0000FF">menu</font></b> Live environments for <font color="#009900">${initiator-iqn}</font>
+<b><font color="#0000FF">item</font></b> openelec-generic-live     Boot OpenELEC Generic <font color="#009900">${openelec-version}</font> <font color="#009900">${archl}</font>
+<b><font color="#0000FF">item</font></b> ubuntu-live-<font color="#993399">1204</font>          Boot Ubuntu LiveCD <font color="#993399">12.04</font> <font color="#009900">${archl}</font>
+<b><font color="#0000FF">item</font></b> slitaz-live               Boot SliTaz <font color="#993399">4.0</font> LiveCD
+<b><font color="#0000FF">item</font></b> smartos                   Boot SmartOS
+<b><font color="#0000FF">item</font></b> smartos-pre-ept           Boot SmartOS (pre-ept)
+<b><font color="#0000FF">item</font></b> kms-test                  Boot KMS test kernel
+<b><font color="#0000FF">item</font></b> tinycore-live-core        Boot TinyCoreLinux <font color="#009900">${tc-version}</font> Core
+<b><font color="#0000FF">item</font></b> tinycore-live-tinycore    Boot TinyCoreLinux <font color="#009900">${tc-version}</font> TinyCore
+<b><font color="#0000FF">item</font></b> tinycore-live-coreplus    Boot TinyCoreLinux <font color="#009900">${tc-version}</font> CorePlus
+<b><font color="#0000FF">item</font></b> coreos                    Boot CoreOS <font color="#009900">${coreos-version}</font>
+<b><font color="#0000FF">item</font></b>
+<b><font color="#0000FF">item</font></b> --key <font color="#993399">0x08</font> back      Back to top menu...
+<b><font color="#0000FF">iseq</font></b> <font color="#009900">${menu-default}</font> menu-live <font color="#990000">&amp;&amp;</font> <b><font color="#0000FF">isset</font></b> <font color="#009900">${submenu-default}</font> <font color="#990000">&amp;&amp;</font> <b><font color="#0000FF">goto</font></b> <b><font color="#008080">menu-live-timed</font></b> <font color="#990000">||</font>
+<b><font color="#0000FF">choose</font></b> selected <font color="#990000">&amp;&amp;</font> <b><font color="#0000FF">goto</font></b> <font color="#009900">${selected}</font> <font color="#990000">||</font> <b><font color="#0000FF">goto</font></b> <b><font color="#008080">start</font></b>
+<b><font color="#008080">:menu-live-timed</font></b>
+<b><font color="#0000FF">choose</font></b> --timeout <font color="#009900">${submenu-timeout}</font> --default <font color="#009900">${submenu-default}</font> selected <font color="#990000">&amp;&amp;</font> <b><font color="#0000FF">goto</font></b> <font color="#009900">${selected}</font> <font color="#990000">||</font> <b><font color="#0000FF">goto</font></b> <b><font color="#008080">start</font></b>
+
+<b><font color="#008080">:openelec-generic-live</font></b>
+<b><font color="#0000FF">echo</font></b> Booting OpenELEC Generic <font color="#009900">${openelec-version}</font> for <font color="#009900">${initiator-iqn}</font>
+<b><font color="#0000FF">set</font></b> <font color="#009900">base-url</font> openelec-generic-<font color="#009900">${archl}</font>-<font color="#009900">${openelec-version}</font>
+<b><font color="#0000FF">kernel</font></b> <font color="#009900">${base-url}</font>/target/KERNEL
+<b><font color="#0000FF">initrd</font></b> <font color="#009900">${base-url}</font>/target/SYSTEM
+<i><font color="#9A1900"># Config from: </font></i><u><font color="#0000FF">http://wiki.openelec.tv/index.php</font></u><i><font color="#9A1900">?title=Network_Boot_-_NFS</font></i>
+<i><font color="#9A1900"># and </font></i><u><font color="#0000FF">http://wiki.openelec.tv/index.php</font></u><i><font color="#9A1900">?title=Installation#Network_Boot_.28PXE.29</font></i>
+<i><font color="#9A1900"># NFS/NBD/iSCSI boot support only works on version &gt;= 2 of OpenELEC</font></i>
+<i><font color="#9A1900"># The NFS server must be specified as an IP, name resolution doesn't work :(</font></i>
+<b><font color="#0000FF">imgargs</font></b> KERNEL ip=dhcp boot=NFS=<font color="#009900">${nfs-server}</font>:<font color="#009900">${nfs-root}${base-url}</font>/target disk=NFS=<font color="#009900">${openelec-storage-dir}</font> overlay
+<b><font color="#0000FF">boot</font></b> <font color="#990000">||</font> <b><font color="#0000FF">goto</font></b> <b><font color="#008080">failed</font></b>
+<b><font color="#0000FF">goto</font></b> <b><font color="#008080">start</font></b>
+
+<b><font color="#008080">:ubuntu-live-1204</font></b>
+<i><font color="#9A1900"># See </font></i><u><font color="#0000FF">http://manpages.ubuntu.com/manpages/precise/man7/casper.7.html</font></u><i><font color="#9A1900"> for casper cmdline details</font></i>
+<b><font color="#0000FF">echo</font></b> Booting Ubuntu Live <font color="#993399">12.04</font> <font color="#009900">${archl}</font> for <font color="#009900">${initiator-iqn}</font>
+<b><font color="#0000FF">set</font></b> <font color="#009900">base-url</font> ubuntu-<font color="#993399">12.04</font>-dvd-<font color="#009900">${archl}</font>
+<b><font color="#0000FF">kernel</font></b> <font color="#009900">${base-url}</font>/casper/vmlinuz
+<b><font color="#0000FF">initrd</font></b> <font color="#009900">${base-url}</font>/casper/initrd.lz
+<b><font color="#0000FF">imgargs</font></b> vmlinuz root=/dev/nfs boot=casper netboot=nfs nfsroot=<font color="#009900">${nfs-server}</font>:<font color="#009900">${nfs-root}${base-url}</font> locale=en_US.UTF-<font color="#993399">8</font> keyboard-configuration/layoutcode=no mirror/country=NO
+<b><font color="#0000FF">shell</font></b>
+<b><font color="#0000FF">boot</font></b> <font color="#990000">||</font> <b><font color="#0000FF">goto</font></b> <b><font color="#008080">failed</font></b>
+<b><font color="#0000FF">goto</font></b> <b><font color="#008080">start</font></b>
+
+<b><font color="#008080">:slitaz-live</font></b>
+<b><font color="#0000FF">echo</font></b> Booting SliTaz <font color="#993399">4.0</font> LiveCD for <font color="#009900">${initiator-iqn}</font>
+<b><font color="#0000FF">set</font></b> <font color="#009900">base-url</font> slitaz-<font color="#993399">4.0</font>/
+<b><font color="#0000FF">kernel</font></b> <font color="#009900">${base-url}</font>/boot/bzImage
+<b><font color="#0000FF">initrd</font></b> <font color="#009900">${base-url}</font>/boot/rootfs4.gz
+<b><font color="#0000FF">initrd</font></b> <font color="#009900">${base-url}</font>/boot/rootfs3.gz
+<b><font color="#0000FF">initrd</font></b> <font color="#009900">${base-url}</font>/boot/rootfs2.gz
+<b><font color="#0000FF">initrd</font></b> <font color="#009900">${base-url}</font>/boot/rootfs1.gz
+<b><font color="#0000FF">imgargs</font></b> bzImage rw root=/dev/null vga=normal autologin lang=en_US kmap=no-latin1
+<b><font color="#0000FF">boot</font></b> <font color="#990000">||</font> <b><font color="#0000FF">goto</font></b> <b><font color="#008080">failed</font></b>
+<b><font color="#0000FF">goto</font></b> <b><font color="#008080">start</font></b>
+
+<b><font color="#008080">:smartos</font></b>
+<b><font color="#0000FF">echo</font></b> Booting SmartOS for <font color="#009900">${initiator-iqn}</font>
+<i><font color="#9A1900"># Hook iSCSI root volume (optional, not yet working)</font></i>
+<b><font color="#0000FF">sanhook</font></b> <font color="#009900">${base-iscsi}</font>:<font color="#009900">${hostname}</font>.boot.smartos <font color="#990000">||</font>
+<b><font color="#0000FF">set</font></b> <font color="#009900">base-url</font> smartos
+<i><font color="#9A1900"># See </font></i><u><font color="#0000FF">http://nahamu.github.com/2011/08/17/smartos-pxe.html</font></u><i><font color="#9A1900"> for details</font></i>
+<i><font color="#9A1900"># See </font></i><u><font color="#0000FF">http://wiki.smartos.org/display/DOC/Getting</font></u><i><font color="#9A1900">+Started+with+SmartOS</font></i>
+<i><font color="#9A1900"># </font></i><u><font color="#0000FF">http://wiki.smartos.org/display/DOC/PXE</font></u><i><font color="#9A1900">+Booting+SmartOS</font></i>
+<i><font color="#9A1900"># </font></i><u><font color="#0000FF">http://wiki.smartos.org/display/DOC/SmartOS</font></u><i><font color="#9A1900">+Command+Line+Tips#SmartOSCommandLineTips-FiguringoutwheretoconfigureadditionalNetworkinterfacesorVLANs</font></i>
+<i><font color="#9A1900"># </font></i><u><font color="#0000FF">http://wiki.smartos.org/display/DOC/extra</font></u><i><font color="#9A1900">+configuration+options</font></i>
+<i><font color="#9A1900"># </font></i><u><font color="#0000FF">http://wiki.smartos.org/display/DOC/Managing</font></u><i><font color="#9A1900">+NICs</font></i>
+<b><font color="#0000FF">kernel</font></b> <font color="#009900">${base-url}</font>/platform/i86pc/kernel/amd64/unix
+<b><font color="#0000FF">initrd</font></b> <font color="#009900">${base-url}</font>/platform/i86pc/amd64/boot_archive
+<i><font color="#9A1900"># This doesn't work, but I would very much like it to</font></i>
+<i><font color="#9A1900">#initrd ${base-url}/config/${hostname}.txt /usbkey/config</font></i>
+<i><font color="#9A1900"># smartos=true to run smartos "installer" (and disable noimport=true)</font></i>
+<i><font color="#9A1900"># You can also run it manually, it's at /smartdc/bin/smartos_prompt_config.sh</font></i>
+<i><font color="#9A1900"># keyboard-layout=norway doesn't work anymore (it used to)</font></i>
+<i><font color="#9A1900">#imgargs unix -v -B console=text,standalone=true,noimport=true,keyboard-layout=norway,hostname=${hostname},root_shadow='${root-shadow}'</font></i>
+<b><font color="#0000FF">imgargs</font></b> unix -B console=text,standalone=true,hostname=<font color="#009900">${hostname}</font>,admin_nic=<font color="#009900">${mac}</font>,admin_ip=dhcp,admin_gateway=dhcp,external_nic=<font color="#009900">${mac}</font>,external_ip=dhcp,external_gateway=dhcp,dns_resolvers=<font color="#009900">${dns}</font>,dns_domain=<font color="#009900">${domain}</font>,ntp_hosts=pool.ntp.org,root_shadow='<font color="#009900">${root-shadow}</font>'
+<b><font color="#0000FF">boot</font></b> <font color="#990000">||</font> <b><font color="#0000FF">goto</font></b> <b><font color="#008080">failed</font></b>
+<b><font color="#0000FF">goto</font></b> <b><font color="#008080">start</font></b>
+
+<b><font color="#008080">:smartos-pre-ept</font></b>
+<b><font color="#0000FF">echo</font></b> Starting SmartOS (pre-ept branch) for <font color="#009900">${initiator-iqn}</font>
+<i><font color="#9A1900"># pre-ept image downloaded from </font></i><u><font color="#0000FF">http://alpha.sysmgr.org/smartos-20120223-jmc2.iso</font></u>
+<i><font color="#9A1900"># Posted by LeftWing on #illumos / FreeNode at 2012-04-11 09:09 UTC+2</font></i>
+<b><font color="#0000FF">set</font></b> <font color="#009900">base-url</font> smartos/pre-ept
+<b><font color="#0000FF">kernel</font></b> <font color="#009900">${base-url}</font>/platform/i86pc/kernel/amd64/unix
+<b><font color="#0000FF">module</font></b> <font color="#009900">${base-url}</font>/platform/i86pc/amd64/boot_archive
+<b><font color="#0000FF">imgargs</font></b> unix -v -B console=text,standalone=true,noimport=true,root_shadow='<font color="#009900">${root-shadow}</font>'
+<b><font color="#0000FF">boot</font></b> <font color="#990000">||</font> <b><font color="#0000FF">goto</font></b> <b><font color="#008080">failed</font></b>
+<b><font color="#0000FF">goto</font></b> <b><font color="#008080">start</font></b>
+
+<b><font color="#008080">:kms-test</font></b>
+<b><font color="#0000FF">echo</font></b> Booting KMS-enabled Linux kernel for <font color="#009900">${initiator-iqn}</font>
+<b><font color="#0000FF">set</font></b> <font color="#009900">base-url</font> kms_test
+<b><font color="#0000FF">kernel</font></b> <font color="#009900">${base-url}</font>/vmlinuz
+<b><font color="#0000FF">initrd</font></b> <font color="#009900">${base-url}</font>/initrd <font color="#990000">||</font>
+<b><font color="#0000FF">imgargs</font></b> vmlinuz rw root=/dev/nfs nfsroot=<font color="#009900">${nfs-server}</font>:/raid/kms_test ip=dhcp <font color="#990000">||</font>
+<b><font color="#0000FF">boot</font></b> <font color="#990000">||</font> <b><font color="#0000FF">goto</font></b> <b><font color="#008080">failed</font></b>
+<b><font color="#0000FF">goto</font></b> <b><font color="#008080">start</font></b>
+
+<i><font color="#9A1900"># TinyCore is work-in-progress</font></i>
+<i><font color="#9A1900"># Current problems is that tce=/mnt/nfs/cde works, but dir is not writable by tc user,</font></i>
+<i><font color="#9A1900"># keymap is not loaded, and it seems like there is something I'm not understanding properly</font></i>
+<i><font color="#9A1900"># about the TC boot process</font></i>
+<i><font color="#9A1900"># More to read on </font></i><u><font color="#0000FF">http://distro.ibiblio.org/tinycorelinux/concepts.html</font></u>
+<i><font color="#9A1900"># and </font></i><u><font color="#0000FF">http://wiki.tinycorelinux.net/wiki</font></u><i><font color="#9A1900">:netbooting</font></i>
+<b><font color="#008080">:tinycore-live-core</font></b>
+<b><font color="#0000FF">echo</font></b> Booting TinyCoreLinux Live Core <font color="#009900">${tc-version}</font> for <font color="#009900">${inititator-iqn}</font>
+<b><font color="#0000FF">set</font></b> <font color="#009900">base-url</font> tinycore/Core-<font color="#009900">${tc-version}</font>/
+<b><font color="#0000FF">kernel</font></b> <font color="#009900">${base-url}</font>/boot/vmlinuz
+<b><font color="#0000FF">initrd</font></b> <font color="#009900">${base-url}</font>/boot/core.gz
+<b><font color="#0000FF">imgargs</font></b> vmlinuz loglevel=<font color="#993399">3</font>
+<b><font color="#0000FF">boot</font></b> <font color="#990000">||</font> <b><font color="#0000FF">goto</font></b> <b><font color="#008080">failed</font></b>
+<b><font color="#0000FF">goto</font></b> <b><font color="#008080">start</font></b>
+
+<b><font color="#008080">:tinycore-live-tinycore</font></b>
+<b><font color="#0000FF">echo</font></b> Booting TinyCoreLinux Live TinyCore <font color="#009900">${tc-version}</font> for <font color="#009900">${inititator-iqn}</font>
+<b><font color="#0000FF">set</font></b> <font color="#009900">base-url</font> tinycore/TinyCore-<font color="#009900">${tc-version}</font>
+<b><font color="#0000FF">kernel</font></b> <font color="#009900">${base-url}</font>/boot/vmlinuz
+<b><font color="#0000FF">initrd</font></b> <font color="#009900">${base-url}</font>/boot/core.gz
+<b><font color="#0000FF">imgargs</font></b> vmlinuz nfsmount=<font color="#009900">${nfs-server}</font>:<font color="#009900">${nfs-root}${base-url}</font> host=<font color="#009900">${hostname}</font> lang=us kmap=nb loglevel=<font color="#993399">3</font> syslog  tce=/mnt/nfs/cde
+<b><font color="#0000FF">boot</font></b> <font color="#990000">||</font> <b><font color="#0000FF">goto</font></b> <b><font color="#008080">failed</font></b>
+<b><font color="#0000FF">goto</font></b> <b><font color="#008080">start</font></b>
+
+<b><font color="#008080">:tinycore-live-coreplus</font></b>
+<b><font color="#0000FF">echo</font></b> Booting TinyCoreLinux Live CorePlus <font color="#009900">${tc-version}</font> for <font color="#009900">${inititator-iqn}</font>
+<b><font color="#0000FF">set</font></b> <font color="#009900">base-url</font> tinycore/CorePlus-<font color="#009900">${tc-version}</font>
+<b><font color="#0000FF">kernel</font></b> <font color="#009900">${base-url}</font>/boot/vmlinuz
+<b><font color="#0000FF">initrd</font></b> <font color="#009900">${base-url}</font>/boot/core.gz
+<b><font color="#0000FF">imgargs</font></b> vmlinuz nfsmount=<font color="#009900">${nfs-server}</font>:<font color="#009900">${nfs-root}${base-url}</font> host=<font color="#009900">${hostname}</font> lang=us kmap=nb loglevel=<font color="#993399">3</font> syslog  tce=/mnt/nfs/cde showapps desktop=flwm_topside
+<b><font color="#0000FF">boot</font></b> <font color="#990000">||</font> <b><font color="#0000FF">goto</font></b> <b><font color="#008080">failed</font></b>
+<b><font color="#0000FF">goto</font></b> <b><font color="#008080">start</font></b>
+
+<b><font color="#008080">:coreos</font></b>
+<b><font color="#0000FF">echo</font></b> Booting CoresOS <font color="#009900">${coreos-version}</font> for <font color="#009900">${inititator-iqn}</font>
+<i><font color="#9A1900">#set base-url ${boot-url}/coreos/CorePlus-${tc-version}</font></i>
+<b><font color="#0000FF">set</font></b> <font color="#009900">base-url</font> http://storage.core-os.net/coreos/<font color="#009900">${archl}</font>-generic/<font color="#009900">${coreos-version}</font>
+<b><font color="#0000FF">kernel</font></b> <font color="#009900">${base-url}</font>/coreos_production_pxe.vmlinuz
+<b><font color="#0000FF">initrd</font></b> <font color="#009900">${base-url}</font>/coreos_production_pxe_image.cpio.gz
+<b><font color="#0000FF">imgargs</font></b> coreos_production_pxe.vmlinuz root=squashfs: state=tmpfs: sshkey="<font color="#009900">${coreos-sshkey}</font>"
+<b><font color="#0000FF">boot</font></b> <font color="#990000">||</font> <b><font color="#0000FF">goto</font></b> <b><font color="#008080">failed</font></b>
+<b><font color="#0000FF">goto</font></b> <b><font color="#008080">start</font></b>
+</tt></pre>
-- 
2.8.0.rc3.226.g39d4020

