Add support for ipxe load (nova, foc, fiasco)

This makes use of the iPXE sanboot command [1] which downloads and
boots an ISO image directly via HTTP. Therefore, your RUN_OPT needs
both

  --include image/iso   and
  --include load/ipxe

NOTE: The webserver serving the ISO image must support ranged requests,
      see [2].

[1] - http://ipxe.org/cmd/sanboot
[2] - http://forum.ipxe.org/showthread.php?tid=7295&pid=10482#pid10482
This commit is contained in:
Adrian-Ken Rueegsegger 2015-08-27 19:03:57 +02:00 committed by Christian Helmuth
parent 94afc1a340
commit 8eec092851
4 changed files with 38 additions and 0 deletions

View File

@ -144,4 +144,10 @@ proc run_boot_dir {binaries} {
generate_tftp_config
}
if {[have_include "load/ipxe"]} {
create_ipxe_iso_config
update_ipxe_boot_dir
create_symlink_for_iso
}
}

View File

@ -183,6 +183,12 @@ proc run_boot_dir_x86 {binaries} {
generate_tftp_config
}
if {[have_include "load/ipxe"]} {
create_ipxe_iso_config
update_ipxe_boot_dir
create_symlink_for_iso
}
}

View File

@ -93,4 +93,10 @@ proc run_boot_dir {binaries} {
generate_tftp_config
}
if {[have_include "load/ipxe"]} {
create_ipxe_iso_config
update_ipxe_boot_dir
create_symlink_for_iso
}
}

View File

@ -46,3 +46,23 @@ proc create_symlink_for_iso { } {
proc update_ipxe_boot_dir { } {
exec ln -sfn [pwd]/[run_dir] [load_ipxe_base_dir]/[load_ipxe_boot_dir]
}
##
# Create iPXE config file which directly boots an ISO file.
#
proc create_ipxe_iso_config { } {
if {[have_include "image/iso"]} {
set fh [open "[run_dir]/boot.cfg" "WRONLY CREAT TRUNC"]
puts $fh "#!ipxe"
puts $fh "sanboot [run_name].iso || goto failed"
puts $fh
puts $fh ":failed"
puts $fh "echo Booting failed, dropping to shell"
puts $fh "shell"
puts $fh "boot"
close $fh
} else {
puts "Warning, iPXE requires ISO image."
exit -1
}
}