From 94afc1a34048e2a4eedf05989a1825ebe0ad23fe Mon Sep 17 00:00:00 2001 From: Adrian-Ken Rueegsegger Date: Thu, 27 Aug 2015 18:23:05 +0200 Subject: [PATCH] run: support loading images via iPXE/HTTP iPXE is an open source network boot firmware which supports booting from a web server via HTTP [1]. The following two parameters can be used to specify the iPXE/HTTP setup: --load-ipxe-base-dir This parameter specifies the base directory of the HTTP server from which the target machine downloads the files. --load-ipxe-boot-dir The directory relative to iPXE base dir which contains the iPXE chainload configuration and all necessary files. The target machine is expected to request the following iPXE configuration via HTTP: http://${HOST_URL}/${ipxe-boot-dir}/boot.cfg This can be achieved by building iPXE with the following embedded script: #!ipxe dhcp chain http://${HOST_URL}/${ipxe-boot-dir}/boot.cfg See also [2] for additional information. [1] - http://ipxe.org/ [2] - http://ipxe.org/howto/chainloading#breaking_the_loop_with_an_embedded_script Fixes #1708 --- tool/run/load/ipxe | 48 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 tool/run/load/ipxe diff --git a/tool/run/load/ipxe b/tool/run/load/ipxe new file mode 100644 index 000000000..40c0e6fb4 --- /dev/null +++ b/tool/run/load/ipxe @@ -0,0 +1,48 @@ +## +# Load files needed by the scenario via iPXE/HTTP +# +# \param --load-ipxe-base-dir base directory of iPXE/HTTP server +# \param --load-ipxe-boot-dir boot directory relative to HTTP base +# + +source [genode_dir]/tool/run/load.inc + + +## +# The files are loaded implicitly via iPXE/HTTP to the target machine +# +proc run_load { } { + global load_spawn_id + set load_spawn_id -1 + return true +} + + +proc load_ipxe_base_dir { } { return [get_cmd_arg --load-ipxe-base-dir ""] } + + +proc load_ipxe_boot_dir { } { return [get_cmd_arg --load-ipxe-boot-dir ""] } + + +## +# Install files needed to boot via iPXE +# +proc install_bender_to_run_dir { } { + exec mkdir -p [run_dir]/boot + exec cp [genode_dir]/tool/boot/bender [run_dir]/boot/bender +} + + +## +# Create symlink for ISO image in current run directory. +# +proc create_symlink_for_iso { } { + exec ln -sfn [pwd]/[run_dir].iso [pwd]/[run_dir]/[run_name].iso +} + +## +# Update iPXE boot directory to point to current run directory. +# +proc update_ipxe_boot_dir { } { + exec ln -sfn [pwd]/[run_dir] [load_ipxe_base_dir]/[load_ipxe_boot_dir] +}