[syslinux] Syslinux-5.10-pre1 looks for ldlinux.c32 in TFTP instead of HTTP

Tobias Göbel kubax1983 at gmail.com
Tue Mar 12 07:15:07 PDT 2013


Am Montag, 11.03.2013 18:20, schrieb Matt Fleming:
> On Fri, 2013-03-08 at 16:12 +0100, Tobias Göbel wrote:
>> Ok, waiting for it and ready for testing the patch when it's ready.
>>
>> I checked what you suggested, and 5.02-pre3 without the reverted commit
>> does not work (as suspected) and with the reverted patch it works.
>> So i think the bisect was right.
> Could you try this patch?
>
> ---
>
>  From 00a6f13139ce5d967b1f9614068a549520d4cca3 Mon Sep 17 00:00:00 2001
> From: Matt Fleming <matt.fleming at intel.com>
> Date: Mon, 11 Mar 2013 13:57:56 +0000
> Subject: [PATCH] Partially revert "pxe: Pass absolute path to pxe_chdir()"
>
> This partially reverts commit b208ba467f678ed8e73f8d11fc0609634120cb83.
>
> It isn't correct to always pass URL_OLD_TFTP to chdir(), since the
> path prefix option may contain a full url, e.g. http://
>
> Specialise the one case where we need to build a ::-style TFTP path
> inside of get_prefix() to maintain backwards compatability, since from
> Syslinux 5.00 onwards we may move out of the root directory ("::")
> while searching for ldlinux.c32.
>
> Signed-off-by: Matt Fleming <matt.fleming at intel.com>
> ---
>   core/fs/pxe/pxe.c | 43 +++++++++++++++++++++++++++----------------
>   1 file changed, 27 insertions(+), 16 deletions(-)
>
> diff --git a/core/fs/pxe/pxe.c b/core/fs/pxe/pxe.c
> index 9f18f28..3e90336 100644
> --- a/core/fs/pxe/pxe.c
> +++ b/core/fs/pxe/pxe.c
> @@ -384,19 +384,6 @@ static void __pxe_searchdir(const char *filename, int flags, struct file *file)
>   }
>   
>   
> -static int __pxe_chdir(struct fs_info *fs, const char *src,
> -		       enum url_type url_type)
> -{
> -    if (url_type == URL_SUFFIX)
> -	strlcat(fs->cwd_name, src, sizeof fs->cwd_name);
> -    else if (url_type == URL_OLD_TFTP)
> -	snprintf(fs->cwd_name, sizeof fs->cwd_name, "::%s", src);
> -    else
> -	strlcpy(fs->cwd_name, src, sizeof fs->cwd_name);
> -    return 0;
> -
> -}
> -
>   /*
>    * Store standard filename prefix
>    */
> @@ -431,7 +418,25 @@ static void get_prefix(void)
>       }
>   
>       printf("TFTP prefix: %s\n", path_prefix);
> -    __pxe_chdir(this_fs, path_prefix, URL_OLD_TFTP);
> +
> +    if (url_type(path_prefix) == URL_SUFFIX) {
> +	/*
> +	 * Construct a ::-style TFTP path.
> +	 *
> +	 * We may have moved out of the root directory at the time
> +	 * this function is invoked, but to maintain compatibility
> +	 * with versions of Syslinux < 5.00, path_prefix must be
> +	 * relative to "::".
> +	 */
> +	p = strdup(path_prefix);
> +	if (!p)
> +	    return;
> +
> +	snprintf(path_prefix, sizeof path_prefix, "::%s", p);
> +	free(p);
> +    }
> +
> +    chdir(path_prefix);
>   }
>   
>   /*
> @@ -450,7 +455,13 @@ static size_t pxe_realpath(struct fs_info *fs, char *dst, const char *src,
>   static int pxe_chdir(struct fs_info *fs, const char *src)
>   {
>       /* The cwd for PXE is just a text prefix */
> -    __pxe_chdir(fs, src, url_type(src));
> +    enum url_type path_type = url_type(src);
> +
> +    if (url_type == URL_SUFFIX)
> +	strlcat(fs->cwd_name, src, sizeof fs->cwd_name);
> +    else
> +	strlcpy(fs->cwd_name, src, sizeof fs->cwd_name);
> +    return 0;
>   
>       dprintf("cwd = \"%s\"\n", fs->cwd_name);
>       return 0;
> @@ -471,7 +482,7 @@ static int pxe_open_config(struct com32_filedata *filedata)
>       char *last;
>       int tries = 8;
>   
> -    get_prefix();
> +    chdir(path_prefix);
>       if (DHCPMagic & 0x02) {
>           /* We got a DHCP option, try it first */
>   	if (open_file(ConfigName, O_RDONLY, filedata) >= 0)

I Have to retract my last statement.
didn't make clean bevore compileing with the patch.

Now it doesn't search anywhere for the ldlinux.c32

Here the right logs.

Mar 12 15:10:29 dvzis-pxe in.tftpd[13304]: RRQ from 195.37.254.29 
filename /pxelinux/ipxe.kkpxe
Mar 12 15:10:29 dvzis-pxe in.tftpd[13304]: tftp: client does not accept 
options
Mar 12 15:10:29 dvzis-pxe in.tftpd[13305]: RRQ from ***.***.***.29 
filename /pxelinux/ipxe.kkpxe

==> /var/log/apache2/dvzis-pxe.pcpool.fh-swf.de-access_log <==
***.***.***.29 - - [12/Mar/2013:15:10:31 +0100] "GET 
/syslinux/pxelinux.0 HTTP/1.1" 200 40401 "-" "iPXE/1.0.0+ (09c5)"

==> /var/log/messages <==
Mar 12 15:10:31 HaP1-XX.pcpool.fh-swf.de ipxe: DHCP (net0 
00:23:ae:8e:f0:eb) using cached
Mar 12 15:10:31 HaP1-XX.pcpool.fh-swf.de ipxe: 
http://***.***.***.***/syslinux/pxelinux.0...Downloaded "pxelinux.0"
Mar 12 15:10:31 HaP1-XX.pcpool.fh-swf.de ipxe:  ok
Mar 12 15:10:31 HaP1-XX.pcpool.fh-swf.de ipxe: Executing "pxelinux.0"

Is there any way (except serial console) to somehow debug what 
pxelinux.0 is doeing? for example see wich pathes it tries?
Something like logging to a syslog daemon would be nice.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 4477 bytes
Desc: S/MIME Kryptografische Unterschrift
URL: <http://www.zytor.com/pipermail/syslinux/attachments/20130312/74dbf985/attachment.p7s>


More information about the Syslinux mailing list