Using scriptlet option?
|
2018-03-14, 18:45
(This post was last modified: 2018-03-14 18:47 by myxal.)
Post: #1
|
|||
|
|||
Using scriptlet option?
Hi all.
I've encountered several mentions of the "ipxe.scriptlet" dhcp option (encap: 175:81) on the forums and around, but couldn't find documentation or a good example. Is it deprecated or something? I'd like to use it to set a variable used later in the main script, so I set dnsmasq to pass this inside the option: Code: dhcp-option-force=<tag filters...>,encap:175,81,"set nd-option live-netdev=eth1" Code: set nd-option live-netdev=eth1: command not found |
|||
2018-03-14, 19:47
Post: #2
|
|||
|
|||
RE: Using scriptlet option?
The definition can be found at https://git.ipxe.org/ipxe.git/blob/d8c50...hcp.h#l381
The call is then done in https://git.ipxe.org/ipxe.git/blob/d8c50...oot.c#l600 As I'm reading the code without having tested, this is the same as having an embedded script. So it should be something like "dhcp && chain http://xxxx/xxx.ipxe" If you already have an embedded script in iPXE it should take precedence over the scriptlet and if you have scriptlet then filename would not be used. One example can be found at http://ipxe.org/buildcfg/vmware_settings even if that is defined by different methods then dhcp And here is a post that describes what it does, even if it doesn't describe how to define it in dhcp: http://forum.ipxe.org/showthread.php?tid...09#pid9709 Use GitHub Discussions VRAM bin |
|||
2018-03-14, 22:21
(This post was last modified: 2018-03-15 09:19 by myxal.)
Post: #3
|
|||
|
|||
RE: Using scriptlet option?
(2018-03-14 19:47)NiKiZe Wrote: As I'm reading the code without having tested, this is the same as having an embedded script.Thanks, I'll check tomorrow when I get to it. I'm wondering if variables set via the scriptlet persist across the chain call - so I could do something like "set var something && chain http://.../main.ipxe". In case they don't, is it possible to pass the data as argument for ipxe, i.e. "chain http://.../main.ipxe something" ? (How would I refer to the argument in the ipxe script?) EDIT: Well, I tried setting the option to echo something, wait and then boot the main script - no dice. If i leave DHCP option 67 in place (which is set to the main script), it just boots straight into the main script, and if I unset it, it just loops at the DHCP stage (iPXE is chainloaded from onboard PXE). Actually, thinking it over some more, I realized, the "live-netdev=eth1" option will be required on per-model basis, rather than per-machine, so I'll just add the decision logic into my main script and be done with it. Still, I find it quite strange that this option, which seems to date back to gPXE days, remains undocumented. |
|||
2018-03-15, 08:44
Post: #4
|
|||
|
|||
RE: Using scriptlet option?
Just as described in http://forum.ipxe.org/showthread.php?tid...98#pid4798
It sounds like it would be better for you to use some other dhcp option to send the values of those settings and then pick them up in your normal script, you would add something like this to your script: Code: set nd-option ${128:string} and I think your dnsmasq config would be Code: dhcp-option-force=<tag filters...>,encap:128,"live-netdev=eth1" Use GitHub Discussions VRAM bin |
|||
2018-03-15, 09:41
(This post was last modified: 2018-03-16 14:01 by myxal.)
Post: #5
|
|||
|
|||
RE: Using scriptlet option?
(2018-03-15 08:44)NiKiZe Wrote: Just as described in http://forum.ipxe.org/showthread.php?tid...98#pid4798EDIT: Just for the record, the correct dnsmasq configuration: Code: dhcp-option-force=<tag filters...>,128,"live-netdev=eth1" Code: dhcp-option-force=<tag filters...>,encap:175,82,"live-netdev=eth1" Anyway, I think I found the closest thing to scriptlet documentation: http://etherboot.org/pipermail/gpxe-deve...00482.html Quote:If the "scriptlet" NVO is set, gPXE will execute its value as a script |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 3 Guest(s)