summaryrefslogtreecommitdiffstats
path: root/discover/grub2/grub2.c
Commit message (Collapse)AuthorAgeFilesLines
* discover/grub2: expose internal parse functionJeremy Kerr2019-11-291-1/+1
| | | | | | | | | Upcoming changes will need a method to parse a secondary file (to support the 'source' command), but not execute it as a new script. This change exposes the parsing code, separate from the execution code. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* discover/grub2: Allow (device)/path references in general script usageJeremy Kerr2019-11-291-2/+2
| | | | | | | | | | | Currently, we have support for grub2 (device)/path syntax for boot resources. This change allows this syntax for general paths in grub2 scripts (for example, -f tests). This involves exposing grub2_lookup_device, to allow the script execution code to resolve pathnames. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* discover/grub2: add support for grub2-style path specifiers in resourcesJeremy Kerr2019-11-291-12/+44
| | | | | | | | | | | | This change incorporates the grub2-style (device)/path specifiers in the grub2 parser's resource code. This allows the boot option paths to use device-specific references. Device names are looked-up using the UUID and kernel IDs, but with the lookup logic specific to a new function (grub2_lookup_device), so that can be extended in a future change. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* discover/grub2: Add parsing code for grub2 file specifiersJeremy Kerr2019-11-291-0/+38
| | | | | | | This change adds a (currently unused) function to parse (device)/path references from grub scripts. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* discover/grub2: expose a struct for grub2 file referencesJeremy Kerr2019-11-291-15/+9
| | | | | | | | | | | | | | | | Currently, we have struct grub2_resource_info to keep references to boot payloads that may be returned in boot options, and be (conditionally) resolved by the parser. We'd also like to use the same semantics for other file references in the grub2 parser, for arbitrary usage in scripts - where files are also referenced by a path and an optional device. To do this, this change moves struct grub2_resource_info to grub2.h, and renames to struct grub2_file. Future changes will use this for script-internal file handling. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* grub2/grub2: add Yocto paths to default grub2 conf search pathsBrett Grandbois2018-02-081-0/+2
| | | | | Signed-off-by: Brett Grandbois <brett.grandbois@opengear.com> Signed-off-by: Samuel Mendoza-Jonas <sam@mendozajonas.com>
* discover/status: Add parse status for GRUB2, yaboot & kboot parsersJeremy Kerr2016-12-201-0/+4
| | | | | Signed-off-by: Jeremy Kerr <jk@ozlabs.org> Signed-off-by: Samuel Mendoza-Jonas <sam@mendozajonas.com>
* discover/grub2: Fixes for bison 3.xJeremy Kerr2013-12-031-2/+1
| | | | | | | | | | YYLEX_PARAM is removed in bison 3.0, so we need to pass the scanner param directly through yyparse (rather than referencing parser->scanner). Unfortunately, we don't have the lexer header available at the time we declare yyparse, so we need to pass a void * here. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* discover/grub2: Populate $prefix from config file locationJeremy Kerr2013-11-271-1/+1
| | | | | | | 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: Use parser for a single parseJeremy Kerr2013-11-271-3/+3
| | | | | | | | | | Currently, we re-use a grub2 parser for different filenames, and will create one even if we find no matching files. This change only creates a parser if parser_request_file succeeds, and free() (and exits the parse) immediately after. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* discover/grub2: Fix indentation errorJeremy Kerr2013-11-271-1/+1
| | | | Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* discover: Change parsers to explicitly request configuration filesNeelesh Gupta2013-11-061-6/+18
| | | | | | | | | | | | | | | | | | | Add a new function parser_request_url() to read the data from configuration files present remotely. We deprecate iterate_parser_files() and download_config() functions along with the 'filenames' and 'method' members of the 'parser' structure so that individual parsers would now require to request the configuration files data from the parser code and doesn't necessarily export the list of configuration files. Add the support to handle incoming DHCP event, done by passing all the relevant environment variables of the udhcpc to the discover code. Also, update the pxe parser code to populate the list of configuration file names as per PXELINUX convention of fallback names using mac and ip addresses of the booting machine. Signed-off-by: Neelesh Gupta <neelegup@linux.vnet.ibm.com> Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* discover/grub2: Allow URL resourcesJeremy Kerr2013-10-141-2/+9
| | | | | | Allow URL-format specifiers for GRUB2 resources. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* discover/grub2: Implement 'linux' & 'initrd' commandsJeremy Kerr2013-09-241-4/+4
| | | | Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* discover/grub2: Hook up flex/bison parser to discover serverJeremy Kerr2013-09-241-0/+103
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
OpenPOWER on IntegriCloud