[syslinux] Nested PXELINUX configurations

Gene Cumm gene.cumm at gmail.com
Mon Mar 28 10:16:16 PDT 2011


On Mon, Mar 28, 2011 at 09:11, Giannis Roussos
<morpheus at csl.mech.ntua.gr> wrote:
> OK, this is clear but still does not answewr my question, since from what I
> understand the prefix can't be changed without modifying the dhcp
> configuration and rebooting.

As HPA mentioned, there's the CONFIG directive (and config.c32) and pxechain.com

In your case, you'll want to use pxechain.com (unless you plan on
using PXELINUX and all modules from one package rather than the
PXELINUX and modules that come from each distro).

> In other works, you say that paths are relative meaning that they are taken
> with respect to the location of the first pxelinux.0 loaded (usually the
> tftp root, so empty prefix), while I need relative paths in the sense that a
> 1.cfg file can include another 2.cfg by only its relative path with respect
> to the 1.cfg, regardless of their place in the tftp tree.
>
> I will try to explain more clearly what I want to do:
> Imagine a working pxelinux configuration that has a file structure like this
> ([braces] show directories, tftproot_1 is the root of the tftp server):
>
> [tftproot_1]
>  |-pxelinux.0
>  |-[pxelinux.cfg]
>        |-default
>  |-[boot_screens]
>        |-menu.cfg // additional config called by "default"
>
> The "default" config calls the menu.cfg with a "include
> boot_screens/menu.cfg" line.
>
> Now imagine that I want the above configuration to become an option in
> another pxelinux configuration, say [tftproot_2], i.e. add is a menu option
> in an existing pxelinux menu. Ideally, I would like to place [tftproot_2] as
> a folder inside [tftproot_1]:
>
> [tftproot_2]
>  |-pxelinux.0
>  |-[pxelinux.cfg]
>      |-default //(main pxelinux menu)
>  |-[tftproot_1]
>      |-pxelinux.0
>      |-[pxelinux.cfg]
>           |-default // nested config
>      |-[boot_screens]
>           |-menu.cfg
>
> Then, to have the main menu call the nested pxelinux config I have tried to
> load the nested "default" config, but this does not work because the nested
> default looks for "boot_screens/menu.cfg" which now is
> "tftproot_1/boot_screens/menu.cfg".
> Alternatively, I tried to boot the nested pxelinux.0, hoping that it would
> use the nested "default" config, but this didn't work either, instead the
> main config was again loaded.

With the caveat that you must use PXELINUX 3.86 or 4.04-pre1 or newer
(I'd recommend 4.04-pre12 for the moment; 4.00-pre1 through 4.03 have
a bug that affects this), you can use the following LABEL in
pxelinux.cfg/default:

LABEL deb-inst
  MENU LABEL Debian Installer
  KERNEL pxechain.com
  APPEND ::tftproot_1/pxelinux.0

You'll need to add pxechain.com to tftproot_2/.  You're tftpd will
also have to tolerate "//" in a requested file name (tftpd-hpa can do
this and other operations in a regular expression).

> Modifying the nested default config to include the menu.cfg with the nested
> path is not a practical option, because in reality many files are included,
> and I would have to do this each time a new version of [tftproot_1] is
> released.
>
> Specifically for Debian netinst the di-netboot-assistant script
> automatically modifies all the include lines to the correct nested paths, so
> most of my problem is solved.
>
> However, the situation described above is a weakness of pxelinux.
>
> Thanks again for your time,
> I hope that the explanations above are clear.
>
> Giannis

I hope this helps clear things up and hopefully resolve the issue for you.

-- 
-Gene

> On 27/3/2011 8:45 μμ, Gene Cumm wrote:
>>
>> On Fri, Mar 25, 2011 at 05:10, Giannis Roussos
>> <morpheus at csl.mech.ntua.gr>  wrote:
>>>
>>> Can you please show again how the preffix is defined?
>>
>> Unless forced by DHCP option 210, PXELINUX sets the prefix to the
>> string before and including the last "/" in the applicable filename in
>> the last DHCP response.  This is either the file field or DHCP option
>> 67 (if DHCP option 52 bit 0 is asserted; 1 or 3).
>>
>> It appears that this may not be entirely clear in doc/pxelinux.txt.




More information about the Syslinux mailing list