summaryrefslogtreecommitdiffstats
path: root/discover/grub2/grub2.h
Commit message (Collapse)AuthorAgeFilesLines
* discover/grub2: Add support for for-loopsJeremy Kerr2014-01-301-0/+13
| | | | | | | | | GRUB2 syntax allows for for-loops; this change adds supoprt in the parser grammar and script execution code to implement them. In the execution code, we simply update the for-loop variable and re-execute the body statements. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* discover/grub2: Populate $prefix from config file locationJeremy Kerr2013-11-271-1/+3
| | | | | | | Rather than always using the default prefix, we should determine it from the location of the grub2 config file. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* discover/grub2: Allow URL resourcesJeremy Kerr2013-10-141-1/+1
| | | | | | Allow URL-format specifiers for GRUB2 resources. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* discover/grub2: Reimplement default optionsJeremy Kerr2013-09-251-0/+1
| | | | Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* discover/grub2: Implement statement_block_executeJeremy Kerr2013-09-241-0/+2
| | | | Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* discover/grub2: Implement 'elif'Jeremy Kerr2013-09-241-1/+2
| | | | | | | Rather than just having one conditional in an if statement, we use a list of conditionals instead. This allows us to implement elif. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* discover/grub2: Create 'conditional' statementsJeremy Kerr2013-09-241-6/+15
| | | | | | | | Rather than holding the condition and conditional-statements in struct grub2_statment_if, create a new conditional type that contains these. We can then use this to implement elif statements. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* discover/grub2: Add function supportJeremy Kerr2013-09-241-0/+10
| | | | Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* discover/grub2: Implement 'linux' & 'initrd' commandsJeremy Kerr2013-09-241-5/+1
| | | | Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* discover/grub2: Function infrastructure improvementsJeremy Kerr2013-09-241-12/+6
| | | | | | | | For user-defined functions, we'll need a data pointer to the function's execution callback. Add this as a void *, and change references from 'command' to 'function'. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* discover/grub2: Add option state in menuentry processingJeremy Kerr2013-09-241-0/+1
| | | | | | | This will allow menuentry-specific commands to populate boot option data. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* discover/grub2: Add a reference to the context from grub2_scriptJeremy Kerr2013-09-241-6/+8
| | | | | | We'll need the context to add boot options. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* discover/grub2: Hook up flex/bison parser to discover serverJeremy Kerr2013-09-241-0/+18
| | | | Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* discover/grub2: Implement multiple-arv variable splittingJeremy Kerr2013-09-241-5/+3
| | | | | | | If we expand a variable containing word-delimiter chars, we need to create new argv items. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* discover/grub2: Add initial command executionJeremy Kerr2013-09-241-0/+26
| | | | | | .. with a simple 'set' command to update the environment Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* discover/grub2: Add menuentry executionJeremy Kerr2013-09-241-0/+2
| | | | Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* discover/grub2: Fix word appendJeremy Kerr2013-09-241-0/+1
| | | | | | | | The parser was setting word->next on the top-level word, resulting in word chains of a maximum length of 2. Instead, use a last pointer to always append to the last word. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* discover/grub2: Handle var tokens in lexerJeremy Kerr2013-09-241-7/+16
| | | | | | | Rather than post-processing to expand variables, use the lexer to identify variable tokens as a type of grub2_word. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* discover/grub2: Add initial execution codeJeremy Kerr2013-09-241-1/+9
| | | | Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* discover/grub2: Add var expansion codeJeremy Kerr2013-09-241-0/+3
| | | | | | Still todo: splitting. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* discover/grub2: Add initial script infrastructureJeremy Kerr2013-09-241-1/+9
| | | | | | | Now that we can parse scripts, we want some infrastructure for execution. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* discover/grub2: Use subclass-style structs for ASTJeremy Kerr2013-09-241-20/+18
| | | | | | | Use embedded 'struct grub2_statement' data to create a subclass-style syntax tree of statements. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* discover/grub2: Implement statement blocksJeremy Kerr2013-09-241-0/+9
| | | | Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* discover/grub2: Add structures & API for parserJeremy Kerr2013-09-241-1/+76
| | | | Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* discover/grub2: Initial grub2 lexerJeremy Kerr2013-09-241-0/+10
Add a simple flex lexer to tokenise our grub2 config files. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
OpenPOWER on IntegriCloud