iPXE discussion forum

Full Version: How to get & use the iPXE local (current) path ?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I am using iPXE with a tree of scripts to allow the user to select a boot
from various menu options. From the main path / script provided originally
by the dhcp server the user can then navigates or chain from folder to folder.
Is there a way to display and use the local (current) path used by iPXE ?
Or in other words, what is name of the variable I should use to access
or "show" the base path when a relative parameter is provided to chain ?
iPXE is a great project ! Thank you very much for your time and support.
Best Regards,

FYI:I am using the http protocol to navigate through the various menus
and the "filename" variable always shows the initial dhcp data.
Look carefully at the text mentioned on http://ipxe.org/cmd/kernel

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.
I did read this properly and I really like this relative path feature.
But how can extract this relative path info from a running iPXE session ?
(it must be somewhere in a iPXE variable so we just need to make it available to the user)
As an example to display a menu title with that current path
(which could the result of multiple menu navigation steps)
or have the script to branch based on the current path.
Thank you very much for your support and follow up.
Best Regards,

PS: I looked at your complex iPXE menu sample script in here:
https://gist.github.com/robinsmidsrod/2234639 (thank you for sharing it).
You create & update your local variables such as "base-url"
to keep track of the menu changes. But this does not work if the
user do type a new path via the interactive mode (broken history)
and I would much prefer to have a way to really extract the current path.
Is this already possible (if yes how ?) or this feature needs to be added to the code ?
From what I'm aware, the current path (as decoded by iPXE) is not available in any variable. It might be easily available in the source, I'm not sure (I'm not a C coder). I would suggest you post a feature request to the mailing-list for its inclusion and see what kind of response you get.

As a side-note: Why do you ask your users to type something into iPXE? That seems quite cumbersome and error-prone (considering iPXE doesn't have a lot of branching features in its scripting to deal with all the challenges that might occur in such situations).
Hello Robinsmidsrod,
Done. Thank you for your help and suggestions.
I use command line mainly for debug and knowing the current path would actually help a lot.
As a wish list, it would be nice to have better variable parsing tools in order to have clever branches.
Best Regards,
Not likely to happen, as iPXE is severly size-constrained (max 64KB code size), so any feature must be thoroughly examined for its usefulness before it's included.
Reference URL's