[gPXE] [gPXE-devel] gPXE Feature Request: assigning custom commands toexecute batch files
Shao Miller
Shao.Miller at yrdsb.edu.on.ca
Tue Feb 2 16:25:02 EST 2010
Shao Miller wrote:
> Tal Aloni wrote:
>> Hi guys,
>> I'm using gPXE for a year now and I'm loving it, Thanks to all
>> developers involved,
>> one thing that I'm missing is a way to define my own commands, that
>> will execute gPXE commands / batch scripts.
>
> You can embed multiple scripts by compiling like this:
>
> # cd gpxe/src/
> # make EMBEDDED_IMAGE=script1.gpxe,script2.gpxe,script3.gpxe bin/gpxe.lkrn
>
> Where gpxe.lkrn is whatever build target you use. Then you can run
> your scripts from the CLI like this:
>
> gPXE> chain script1.gpxe
>
> But perhaps you'd rather use aliases by using a script like this:
>
> #!gpxe
> set san1 sanboot iscsi:192.168.1.11
> set san2 sanboot iscsi:192.168.1.11::::win7
> echo Aliases have been set.
>
> gPXE> ${san1}
>
> or
>
> gPXE> ${san2}
I apologize; too hasty a response…
It’s not “chain” in the example below, it should be “boot”.
The “set” command does not allow spaces, so that won’t quite work, after
all.
>> I happen to test many combination of operating systems / settings,
>> and it would be much faster to press Ctrl-B and enter Win7G11,
>> than to enter the whole chain of commands required:
>> > set gateway 192.168.1.11
>> > sanboot iscsi:192.168.1.11::::win7
>>
>> I'm familiar with the menu option, but the number of iscsi targets
>> involved would make it a mess to use a single menu page, I'm also
>> more comfortable with the command line.
>>
>> One idea I had is to use an embedded script to set a "root-directory"
>> (batch scripts directory),
>> and then, whenever an unknown-command will be entered, we will chain
>> "root-directory/unknown-command.pxe",
>> this also requires that we will have a way to abort the embedded
>> script (where we set the root-dir variable) and return to the command
>> line.
>>
>> if that sounds like too much, I can settle for an "alias" command
>> (alias Win7G11 sanboot iscsi:192.168.1.11::::etc),
>> again, we can use the embedded script, but we need a way to return to
>> the command line.
>
> I hope this helps. I've replied using the gPXE mailing-list, rather
> than the developers' list. I hope you don't mind.
>
> Disclaimer: All claims and opinions are solely those of myself and do
> not and should not be perceived as representing the Etherboot nor the
> gPXE projects in any way. Thank you for your understanding.
>
> - Shao Miller
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://etherboot.org/pipermail/gpxe/attachments/20100202/92098e6b/attachment.html
More information about the gPXE
mailing list