[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:03:57 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)


Ok, that's real strange.
The Patch seems to work, pxelinux.0 says "Failed to load ldlinux.c32" 
anyways.

The HTTP Server is beeing asked, and replies with 200 (file found) but, 
the file is not downloaded from pxelinux and searched in other pathes.

Here is a short log from the TFTP and HTTP Server.

==> /var/log/apache2/*.de-access_log <==
***.***.***.29 - - [12/Mar/2013:14:55:49 +0100] "GET 
/syslinux//ldlinux.c32 HTTP/1.1" 200 117872 "-" "iPXE/1.0.0+ (09c5)"
***.***.***.29 - - [12/Mar/2013:14:55:49 +0100] "GET 
/syslinux//ldlinux.c32 HTTP/1.1" 200 117872 "-" "iPXE/1.0.0+ (09c5)"
***.***.***.29 - - [12/Mar/2013:14:57:01 +0100] "GET 
/syslinux/pxelinux.0 HTTP/1.1" 200 37947 "-" "iPXE/1.0.0+ (09c5)"
***.***.***.29 - - [12/Mar/2013:14:57:01 +0100] "GET 
/syslinux/ldlinux.c32 HTTP/1.1" 200 117872 "-" "iPXE/1.0.0+ (09c5)"
***.***.***.29 - - [12/Mar/2013:14:57:01 +0100] "GET 
/syslinux//boot/isolinux/ldlinux.c32 HTTP/1.1" 404 1031 "-" "iPXE/1.0.0+ 
(09c5)"
***.***.***.29 - - [12/Mar/2013:14:57:01 +0100] "GET 
/syslinux//isolinux/ldlinux.c32 HTTP/1.1" 404 1031 "-" "iPXE/1.0.0+ (09c5)"
***.***.***.29 - - [12/Mar/2013:14:57:01 +0100] "GET 
/syslinux//boot/syslinux/ldlinux.c32 HTTP/1.1" 404 1031 "-" "iPXE/1.0.0+ 
(09c5)"
***.***.***.29 - - [12/Mar/2013:14:57:01 +0100] "GET 
/syslinux//syslinux/ldlinux.c32 HTTP/1.1" 404 1031 "-" "iPXE/1.0.0+ (09c5)"
***.***.***.29 - - [12/Mar/2013:14:57:01 +0100] "GET 
/syslinux//ldlinux.c32 HTTP/1.1" 200 117872 "-" "iPXE/1.0.0+ (09c5)"
***.***.***.29 - - [12/Mar/2013:14:57:01 +0100] "GET 
/syslinux//ldlinux.c32 HTTP/1.1" 200 117872 "-" "iPXE/1.0.0+ (09c5)"

==> /var/log/messages <==
Mar 12 14:55:49 HaP1-XX.***************.de ipxe: 
http://193.174.70.187/syslinux/pxelinux.0...Downloaded "pxelinux.0"
Mar 12 14:55:49 HaP1-XX.***************.de ipxe:  ok
Mar 12 14:55:49 HaP1-XX.***************.de ipxe: Executing "pxelinux.0"
Mar 12 14:56:59 dvzis-pxe in.tftpd[27455]: RRQ from ***.***.***.29 
filename /pxelinux/ipxe.kkpxe
Mar 12 14:56:59 dvzis-pxe in.tftpd[27455]: tftp: client does not accept 
options
Mar 12 14:56:59 dvzis-pxe in.tftpd[27456]: RRQ from ***.***.***.29 
filename /pxelinux/ipxe.kkpxe
Mar 12 14:57:01 HaP1-XX.***************.de ipxe: DHCP (net0 
00:23:ae:8e:f0:eb) using cached
Mar 12 14:57:01 HaP1-XX.***************.de ipxe: 
http://***.***.***.***/syslinux/pxelinux.0...Downloaded "pxelinux.0"
Mar 12 14:57:01 HaP1-XX.***************.de ipxe:  ok
Mar 12 14:57:01 HaP1-XX.***************.de ipxe: Executing "pxelinux.0"

-------------- 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/585cda22/attachment.p7s>


More information about the Syslinux mailing list