[syslinux] Syslinux 5 (i)pxelinux.0 unnecessary PATH requests

Arends, R.R. r.r.arends at hr.nl
Wed Dec 12 07:48:41 PST 2012


>>> On 12-12-2012 at 16:38, in message <50C8A4F5.7050708 at gmail.com>, Shao Miller
<sha0.miller at gmail.com> wrote:
> On 12/12/2012 07:39, Arends, R.R. wrote:
>>>>> On 11-12-2012 at 19:50, in message <50C78092.5030607 at gmail.com>, Shao Miller
>> <sha0.miller at gmail.com> wrote:
>>> On 12/11/2012 11:37, Arends, R.R. wrote:
>>>>
>>>> i just build a new ipxelinux.0 with an
>>> EMBED=../../syslinux-5/core/pxelinux.0.
>>>> i'm trying to load up my vesamenu.c32 menu from http:.
>>>>
>>>> and offcorse i want this as optimal as possible, with the least needed GET
>>> requests.
>>>>
>>>> OLD situation with v4:
>>>> PXE ROM -> ipxelinux.0 (tftp) -> menu.php (http) -> vesamenu.c32 (http)
>>>>
>>>> NEW situation with v5:
>>>> PXE ROM -> ipxelinux.0 (tftp) -> /ldlinux.c32 (http 404) -> //ldlinux.c32 (http
>>> 404) -> //boot/isolinux/ldlinux.c32 (http 404) -> //isolinux/ldlinux.c32 etc.
>>> etc. -> menu.php (http 200) -> /mods/vesamenu.c32 (http 200)
>>>> that can be fixed with adding ldlinux.c32 to the root of my webserver
>>> (ugly... but oke).
>>>> but then we still have the other libraries, which it tries to fetch in the
>>> same directories first, and yes we can add those to the root aswel as a work
>>> around.... but i'd love to have them seperate.
>>>>
>>>> menu.php has the UI directive as /mods/vesamenu.c32 and the PATH as mods
>>> configured
>>>> but then still with that PATH directive in the menu it still tries to find
>>> the libraries in this order:
>>>>
>>>> GET /libcom32.c32 (http 404)
>>>> GET //libcom32.c32 (http 404)
>>>> GET /mods//libcom32.c32 (http 200) < --- success!
>>>> GET /libutil_com.c32 (http 404)
>>>> GET //libutil_com.c32 (http 404)
>>>> GET /mods//libutil_com.c32 (http 200) <--- success!
>>>>
>>>> in my opinion these are atleast 4 unnecessary requests to the webserver
>>> before finding the correct one.
>>>> and another thing the PATH directive can only be read after ldlinux.c32 is
>>> loaded, so ldlinux.c32 should always be in the root?
>>>>
>>>> i'm looking for a way to configure this to only search the libs and
>>> ldlinux.c32 in ./mods/ to limit the needed GETs to the server, speed things
>>> up a bit and have a neat directory structure.
>>>>
>>>> i was already found the 'search_directories' static const in load_env32.c,
>>> but after changing that to:
>>>>     static const char *search_directories[] = {
>>>>       "/mods",
>>>>       NULL
>>>>     };
>>>>
>>>> it still does these requests:
>>>> GET /libcom32.c32
>>>> GET //libcom32.c32
>>>
>>> Are you using DHCP option 210?  It is documented in doc/pxelinux.txt and
>>> is related to where PXELINUX goes looking for things.  Yes, PATH cannot
>>> be processed until ldlinux.c32 is fetched, but option 210 is processed
>>> before.  - Shao
>>
>> Shao thanks for you answer, yes option 210 is used and pointing to the root 
> path of the webserver.
> 
> I guess that explains why ldlinux.c32 is being searched-for in the root 
> path.
> 
>> But option 209 is set to menu.php which is actually in the root and not in 
> the subdir '/mods' or '/modules'.
>>
>> set 209:string 
> menu/?mac=${net0/mac}&subnet=${net0/250:uristring}&asset=${asset:uristri
> ng}&serial=${serial:uristring}&product=${product:uristring}&arch=${arch}
>> set 210:string https://boot.xxx.nl/ 
>>
> 
> That 209 looks familiar. ;)

without the net0/250 option i guess :), custom field we use here to differentiate the menu's for different vlans.

> 
>> Was already thinking of changing 210 to /mods, but then i have to set the 
> 209 different i think to either ../menu.php or the full path (as in set 
> 209:string http://boot.xxx.nl/menu.php)? 
>>
>> Hmm actually i have to change all my paths in the menu too... those are all 
> based on the root. I still wonder if i can hardcode it somewhere in the 
> source to just fetch the needed libraries from a configured directory.
>> current content of root dir:
>>   check.php
>>   installer <-- directory this directory has installers for windows, debian, 
> etc and have their kernel + initrds + other files in subdirs.
>>   index.php
>>   modules <-- directory where i want to put in memdisk, vesamenu.c32 and all 
> the needed libraries
>>   imaging <-- directory
>>
>> Any ideas, to make it just look in the dir modules without changing option 
> 210?
> 
> Use 210 for the initial root path to where at least 5 files will live: 
> pxelinux.0, ldlinux.c32, config.c32, libcom32.c32, boot.php.  Have 
> boot.php return the following:
> 
>    PATH /mods
>    DEFAULT newroot
>    LABEL newroot
>      COM32 config.c32
>      APPEND /menu.php?stuff /
> 
> where 'stuff' would be generated by boot.php based on what it received 
> from your option 209.  Adjust 209 to use boot.php instead of menu.php. 
> The final bit of the APPEND line resets the working directory.
> 
> - Shao Miller

good idea, but imho this still involves in making extra requests to the backend and rather 'hacky' chain->chain->chain stuff to make it harder to understand for my fellow cowokers.

if anyone can point me to the right source files to edit and hardcode the path, i would really appreciate it. i know thats also hacky, but thats easy to do since we already have some custom patches which we always apply.

- reni





More information about the Syslinux mailing list