Post Reply 
 
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to get & use the iPXE local (current) path ?
2013-02-26, 10:01
Post: #1
How to get & use the iPXE local (current) path ?
Hello,
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,
Gilles

FYI:I am using the http protocol to navigate through the various menus
and the "filename" variable always shows the initial dhcp data.
Find all posts by this user
Quote this message in a reply
2013-02-27, 08:33
Post: #2
RE: How to get & use the iPXE local (current) path ?
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.
Visit this user's website Find all posts by this user
Quote this message in a reply
2013-02-27, 09:00
Post: #3
RE: How to get & use the iPXE local (current) path ?
Hello
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,
Gilles

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 ?
Find all posts by this user
Quote this message in a reply
2013-02-27, 09:41 (This post was last modified: 2013-02-27 09:44 by robinsmidsrod.)
Post: #4
RE: How to get & use the iPXE local (current) path ?
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).
Visit this user's website Find all posts by this user
Quote this message in a reply
2013-02-27, 10:08
Post: #5
RE: How to get & use the iPXE local (current) path ?
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,
Gilles
Find all posts by this user
Quote this message in a reply
2013-02-28, 13:33
Post: #6
RE: How to get & use the iPXE local (current) path ?
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.
Visit this user's website Find all posts by this user
Quote this message in a reply
Post Reply 




User(s) browsing this thread: 2 Guest(s)