diff mbox

[v4,05/16] osstest: introduce a helper to setup a host to boot using memdisk

Message ID 20170706144227.36580-6-roger.pau@citrix.com (mailing list archive)
State New, archived
Headers show

Commit Message

Roger Pau Monné July 6, 2017, 2:42 p.m. UTC
The helper allows booting a host from pxelinux using an image
compatible with memdisk.

Note that this requires having a copy of the memdisk binary (provided
as part of pxelinux) in the root of the tftp server.

Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
---
Changes since v3:
 - New in this version (split from install patch).
---
 Osstest/TestSupport.pm | 22 +++++++++++++++++++++-
 1 file changed, 21 insertions(+), 1 deletion(-)

Comments

Ian Jackson July 6, 2017, 4:07 p.m. UTC | #1
Roger Pau Monne writes ("[PATCH v4 05/16] osstest: introduce a helper to setup a host to boot using memdisk"):
> The helper allows booting a host from pxelinux using an image
> compatible with memdisk.
> 
> Note that this requires having a copy of the memdisk binary (provided
> as part of pxelinux) in the root of the tftp server.

Can you provide specific instructions ?  Something like this:

  Deployment note: A copy of the memdisk binary (from pxelinux)
  must be placed in the root of the tftp server.  Eg:
     ln -s /usr/lib/w3ossbnam,e/pxe/memdisk /tftp/root/

With suitable paths,

Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
diff mbox

Patch

diff --git a/Osstest/TestSupport.pm b/Osstest/TestSupport.pm
index 12ebc32d..66790575 100644
--- a/Osstest/TestSupport.pm
+++ b/Osstest/TestSupport.pm
@@ -122,7 +122,7 @@  BEGIN {
                       await_webspace_fetch_byleaf create_webfile
                       file_link_contents get_timeout
                       setup_netboot_di setup_netboot_local host_netboot_file
-		      subst_netboot_template
+                      subst_netboot_template setup_netboot_memdisk
 
                       ether_prefix
 
@@ -2629,6 +2629,26 @@  default local
 END
 }
 
+sub setup_netboot_memdisk ($$) {
+    my ($ho, $img) = @_;
+    setup_netboot_bootcfg($ho, <<END);
+serial 0 $c{Baud}
+timeout 5
+label overwrite
+        menu label ^Overwrite
+        menu default
+        kernel memdisk
+        initrd $img
+        # NB: according to the memdisk syslinux wikipage [0]
+        # adding "append raw" is required in order to boot on
+        # some boxes, and in fact some hardware will not boot
+        # without it.
+        # [0] http://www.syslinux.org/wiki/index.php?title=MEMDISK#Memory_access_method
+        append raw
+default overwrite
+END
+}
+
 # uboot emulates pxelinux, so reuse BIOS stuff
 sub setup_netboot_di_uboot ($$$$$;%) { return &setup_netboot_di_bios; }
 sub setup_netboot_local_uboot ($) { return &setup_netboot_local_bios; }