The following warnings occurred:
Warning [2] count(): Parameter must be an array or an object that implements Countable - Line: 807 - File: showthread.php PHP 7.3.15 (Linux)
File Line Function
/showthread.php 807 errorHandler->error

Post Reply 
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
"include" directive for ipxe scripts?
2018-05-31, 19:35
Post: #1
"include" directive for ipxe scripts?
Hello there!

I can't seem to find a way to "include <path>/<file>" in ipxe scripts for easier sharing of the same piece of code instead of replicating that in each of scripts.

For example, we have a rather large portion of each of the iPXE files consumed by the part that deals with setting a proper console device depending on the manufacturer or model, etc.

set space:string %20
# by default use ttyS0
set console:string ttyS0,115200n8
# overrides
iseq ${manufacturer:uristring} Dell && set console:string ttyS1,115200n8 ||
iseq ${manufacturer:uristring} Dell${space}Inc. && set console:string ttyS1,11
5200n8 ||
iseq ${manufacturer:uristring} Dell${space}${space}${space}${space} && set console:string ttyS1,115200n8 ||
iseq ${product:uristring} PowerEdge${space}R630 && set console:string ttyS0,115200n8 ||
iseq ${product:uristring} PowerEdge${space}R730xd && set console:string ttyS0,115200n8 ||
and so on and so forth.

This part is obviously very repetitive and requires unnecessary maintenance to keep all iPXE scripts sync'ed up on updates.

It would've been much easier if I could separate that piece of code into a file that could be then sourced/included from each of iPXE scripts allowing very easy management as now I'd only need to update a single file (in git, example) and that's it as actual iPXE scripts would just include that file when they are read.

Is there such capability?
Find all posts by this user
Quote this message in a reply
Post Reply 

Messages In This Thread
"include" directive for ipxe scripts? - korekhov - 2018-05-31 19:35

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