1 /* ----------------------------------------------------------------------- *
3 * Copyright 2008 H. Peter Anvin - All Rights Reserved
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
8 * Boston MA 02110-1301, USA; either version 2 of the License, or
9 * (at your option) any later version; incorporated herein by reference.
11 * ----------------------------------------------------------------------- */
16 * Invoke the gPXE "sanboot" command, if available.
27 #include <syslinux/pxe_api.h>
33 struct s_PXENV_FILE_EXEC
{
35 struct segoff16 Command
;
38 static void sanboot(const char **args
)
41 struct s_PXENV_FILE_EXEC
*fx
;
43 fx
= lmalloc(sizeof *fx
);
50 fx
->Command
.offs
= OFFS(q
);
51 fx
->Command
.seg
= SEG(q
);
53 q
= stpcpy(q
, "sanboot");
61 pxe_call(PXENV_FILE_EXEC
, fx
);
63 /* This should not return... */
66 int main(int argc
, const char *argv
[])
69 printf("Usage: sanboot rootpath\n");
74 printf("sanboot: gPXE API not detected\n");
80 /* sanboot() should not return... */
81 printf("SAN boot failed.\n");