[syslinux] [PATCH] ifgpxe.c32
Gert Hulselmans
gerth at zytor.com
Tue Sep 14 13:01:43 PDT 2010
Geoff Lywood wrote:
> ifgpxe.c32 is a com32 module that will run one command if gPXE extensions
> are available, and a different command if not.
>
> At VMware, we use this module to chain-load gpxelinux.0 from pxelinux.0.
> Both of those binaries use exactly the same configuration file, and this
> module allows us to differentiate between the two cases and break the
> infinite chain-loading loop that might result. Typical usage:
>
> default ifgpxe.c32 menu.c32 -- gpxelinux.0
> label xx
> menu label xx
> kernel http://host/filename
>
> Another potential use could be to use different configuration files, e.g.
> one with TFTP URLs, and the other with HTTP URLs, depending on whether or
> not gPXE extensions are present.
>
> I am aware that most of these problems can be solved with clever DHCP
> configuration. However, our IT department keeps fairly tight control over
> the DHCP servers, and any change to the DHCP options used for a given host
> has a bunch of bureaucratic overhead. With ifgpxe.c32, we can simply edit
> the host-specific pxelinux configuration files, which IT has much less
> control over.
>
> The actual content of the file was mostly copy/pasted from ifcpu64.c, so I
> left HPA's copyright on it.
>
> Thanks,
> Geoff
> _______________________________________________
> Syslinux mailing list
> Submissions to Syslinux at zytor.com
> Unsubscribe or set options at:
> http://www.zytor.com/mailman/listinfo/syslinux
> Please do not send private replies to mailing list traffic.
>
>
Can you make a new patch based on the last ifcpu(64).c32 version?
http://git.zytor.com/?p=syslinux/syslinux.git;a=blob;f=com32/modules/ifcpu64.c;h=e123922e25afe74b81987eaa66e709eac84625c1;hb=6f438cf6d03e45d875b510559246573954e43218
The "static void boot_args(char **args)" is different.
The newer version supports spaces in the commands separated by --.
e.g.:
default ifgpxe.c32 menu.c32 http://someserver.org/someconfig.cfg --
gpxelinux.0
============================================
/* XXX: this really should be librarized */
static void boot_args(char **args)
{
int len = 0, a = 0;
char **pp;
const char *p;
char c, *q, *str;
for (pp = args; *pp; pp++)
len += strlen(*pp) + 1;
q = str = alloca(len);
for (pp = args; *pp; pp++) {
p = *pp;
while ((c = *p++))
*q++ = c;
*q++ = ' ';
a = 1;
}
q -= a;
*q = '\0';
if (!str[0])
syslinux_run_default();
else
syslinux_run_command(str);
}
============================================
- Gert Hulselmans
More information about the Syslinux
mailing list