[gPXE-devel] More Scripting Discussion

Stefan Hajnoczi stefanha at gmail.com
Thu Mar 18 13:32:33 EDT 2010


=Control Flow=

Two forms of control flow have been explored in gPXE: structured
for/while/try and low-level if/goto.

The structured approach is easy to use and similar to POSIX shell
scripting (http://etherboot.org/wiki/soc/2009/lynusvaz/notes/scripting_doc/features_added).
 The low-level approach using 'goto' is more like writing BASIC or
assembly.  It can be added to gPXE at a cost of <512 bytes.

Although the structured approach is more user-friendly, the low-level
approach is reasonably usable and meets our code size requirements to
fit into a 64 KB ROM more readily.  I therefore support getting
if/goto into gPXE - it will allow a wider audience to do
boot.kernel.org-style magic.

=Exit=

I think the 'exit' semantics are good.  The 'exit' command allows
scripts to terminate and will be useful for error handling or stopping
early.

=Loose ends=

One email thread will not be able to do these topics justice, let's
keep this thread for high level discussion (e.g. is quoting
necessary?) and tackle the details in their own threads.

1. "Have the ability to continue in spite of individual command errors"
2. An exit code variable for testing success or failure of a command
3. Expressions (arithmetic, string comparison, and logic operations)
4. Quoting

Lynus implemented these in his Summer of Code project.  We need to
revisit these pieces as has been done for control flow.

Any other "loose ends" or suggestions to remove something from this list?

Stefan


More information about the gPXE-devel mailing list