relative tftp path for embedded script, pxelinux.0 behaviour - Printable Version +- iPXE discussion forum (https://forum.ipxe.org) +-- Forum: iPXE user forums (/forumdisplay.php?fid=1) +--- Forum: General (/forumdisplay.php?fid=2) +--- Thread: relative tftp path for embedded script, pxelinux.0 behaviour (/showthread.php?tid=3718) |
relative tftp path for embedded script, pxelinux.0 behaviour - aka - 2012-07-21 22:10 I boot undionly.kpxe from tftp. Trivial script were embedded: Code: #!ipxe Works well if undionly.kpxe and default.ipxe stored in tftp root directory. I move undionly.kpxe to subdirectory and change dhcp 067 option, but it search default.ipxe in tftp root, not subdirectory near undionly.kpxe. I need pxelinux.0 behaviour. pxelinux.0 search for config starting from tftp path where pxelinux.0 loaded from, not from tftp root directory. Something like: Quote:If this command is executed from within an iPXE script, then the URI will be interpreted as being relative to the URI of the script itself. For example, if the script http://boot.ipxe.org/demo/boot.php contains the lineFor embedded scripts. RE: relative tftp path for embedded script, pxelinux.0 behaviour - robinsmidsrod - 2012-07-22 19:03 If you look at my menu example at https://gist.github.com/2234639 line 123-136 (default.pxe) you can see how you can override the PXELinux root path and config file. Hopefully that should help you out. RE: relative tftp path for embedded script, pxelinux.0 behaviour - aka - 2012-07-22 21:54 No. User untar my distributive somewhere under tftp root. undionly.kpxe and default.ipxe stored in this distributive. I didn't know where user untar it while I write default.ipxe. In your example, you know path. I don't know the path. Then user write path to undionly.kpxe into 067 dhcp option. For example, 067 dhcp is: diskless/wt5/5.1.16/undionly.kpxe pxelinux.0 will automatically look at 067 and search config in diskless/wt5/5.1.16/, not in tftp root. So user can untar files from distributive anywhere he want, and pxelinux.0 will find config. I need something like this (docs of my dream): Quote:If this command is executed from within an embedded into undionly.kpxe iPXE script, then the URI will be interpreted as being relative to the URI of the undionly.kpxe downloaded from. For example, if the script embedded into undionly.kpxe downloaded from tftp as "any/path/in/tftp/undionly.kpxe" contains the line RE: relative tftp path for embedded script, pxelinux.0 behaviour - robinsmidsrod - 2012-07-24 18:45 I'm not exactly sure what your problem is. Relative paths should work. If PXELinux is unable to resolve your root path properly you need to specify it explicitly. Unfortunately your English is not easy to understand, so I'm not sure if I answered your question or not. RE: relative tftp path for embedded script, pxelinux.0 behaviour - aka - 2012-07-24 19:33 (2012-07-24 18:45)robinsmidsrod Wrote: Relative paths should work.Relative paths work in downloaded scripts. Relative paths do not work in embedded script. I need relative paths in embedded script. I put undionly.kpxe into $TFTPROOT/long/long/path/ I put script default.ipxe into the same directory. I specify in 067 dhcp option "long/long/path/undionly.kpxe". I embed script into undionly.kpxe: Code: #!ipxe It does NOT work. It searches for default.ipxe in tftp root. Because relative paths do NOT work in embedded script. Ok, I embed script with path: Code: #!ipxe It works. In $TFTPROOT/long/long/path/default.ipxe i write: Code: #!ipxe And it works without full path. Because relative paths work in downloaded scripts. I need relative paths in embedded script. RE: relative tftp path for embedded script, pxelinux.0 behaviour - robinsmidsrod - 2012-07-25 15:29 I suggest you report this potential bug on the mailing-list. RE: relative tftp path for embedded script, pxelinux.0 behaviour - johnres - 2014-01-01 16:03 You can use Long Path Tool for such issues. RE: relative tftp path for embedded script, pxelinux.0 behaviour - robinsmidsrod - 2014-01-08 08:27 I think I know what the actual problem is. The vendor PXE implementation is loading undionly.kpxe from somewhere on the TFTP server, but iPXE, when loaded like this, does not know where it was loaded from because the information is not available, or it is just not resolved. The filename should still be available in the cached dhcp response, but my guess is that the "current directory" is not set to this folder during initial load, as iPXE does when it chainloads a script. I'm not sure if this is a feature or a bug. You should report it on the mailing-list regardless. RE: relative tftp path for embedded script, pxelinux.0 behaviour - highlight86 - 2014-01-09 08:13 Thanks so much RE: relative tftp path for embedded script, pxelinux.0 behaviour - pojntfx - 2021-05-11 09:47 An old thread, but as I still stumbled upon this issue in 2021: It is possible to use i.e. the `root-path` (17) DHCP option to find the absolute path from which iPXE was loaded, even if it is from an embedded script; I've created a repo which shows this in action: https://github.com/pojntfx/ipxe-binaries Code: #!ipxe |