summaryrefslogtreecommitdiffstats
path: root/discover/grub2-parser.c
Commit message (Collapse)AuthorAgeFilesLines
* discover/grub2: Hook up flex/bison parser to discover serverJeremy Kerr2013-09-241-320/+0
| | | | Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* discover: Add grub.cfg path for openSUSEGeoff Levand2013-07-231-0/+1
| | | | Signed-off-by: Geoff Levand <geoff@infradead.org>
* discover/grub2: Add default option parsingJeremy Kerr2013-06-241-1/+39
| | | | Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* discover/grub2: remove uuid log messageJeremy Kerr2013-05-211-1/+0
| | | | Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* parser/grub2: Add parse for linux16Geoff Levand2013-05-171-1/+2
| | | | | | Ubuntu uses the linux16 symbol in thier conf files for memory test entries. Signed-off-by: Geoff Levand <geoff@infradead.org>
* parser/grub2: Better menuentry parsingGeoff Levand2013-05-171-6/+1
| | | | | | Grub2 menuentry entry text can use double or single quotes. Signed-off-by: Geoff Levand <geoff@infradead.org>
* discover/grub2: handle search commands to specify root filesystemsJeremy Kerr2013-05-161-5/+90
| | | | | | Add a resource type for grub, allowing us to parse search parameters. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* discover/grub2: Add grub2/grub.cfg config fileJeremy Kerr2013-05-151-0/+2
| | | | Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* discover/grub2: Rework config stateJeremy Kerr2013-05-081-13/+10
| | | | | | | Rather than creating boot options pre-emptively, in two paths, just do it once when we see the menuentry option. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* parsers: populate resolve_resource membersJeremy Kerr2013-05-061-4/+5
| | | | | | We're only dealing with devpath resources at the moment. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* discover: Add configuration methodsJeremy Kerr2013-04-291-0/+1
| | | | | | | | | | | | We'd like to be able to download petitboot configurations from other sources (not just local files), but we'll need some way to indicate to the parsers that a chunk of config data is from a specific source. This change adds "configuration methods". At present, we have only one: CONF_METHOD_LOCAL_FILE. For any incoming configuration data, we only run parsers that have registered themselves with that configuration method. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* parsers: dynamically register parsersJeremy Kerr2013-04-291-1/+3
| | | | | | | | | | | | | | | Currently, we require all parsers to be defined in an array in parsers.c. This change removes this requirement, by introducting a register_parser() macro, which adds a constructor to register the parser with the core parser infrastructure. Because each parser no longer resolves an undefined symbol, we need to use a `ld -r` object for libparser, instead of using libtool, which creates a .a (and hence has no parsers included). Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* discover: Change parsers to emit resources rather than filenamesJeremy Kerr2013-04-291-10/+10
| | | | | | | | | | | | | | | | | | | | | | | | This change switches the parsers over to populate the resources in discover_boot_option, rather than the string parameters in boot_option. To do this, we need a few things: * Add struct resources to discover_boot_option for the boot_image, initrd and icon data. * Have the parsers populate the resources, rather than the strings. Currently, parsers can all use the devpath resource type. * Add a resolve_resource callback to parsers; this is how the device handler will attempt to resolve resources. * Change load_file to load_url, as we should be only accessing (resolved) resources by URLs. This then allows us to remove the mount map, and associated lookup code, as well as the UUID and label links to devices. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* discover: Introduce a container type for boot optionsJeremy Kerr2013-04-291-19/+24
| | | | | | | | | This change introduces a new type, struct discover_boot_option. Like struct discover_device adds discover-specific data to struct device, struct discover_boot_option allows the discover server to store more than just the boot option strings for a boot option. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* parsers: change parser.parse to accept a bufferJeremy Kerr2013-04-291-5/+3
| | | | | | | Rather than having each of the parsers do their own open(), read(), etc, use the registered filenames array to find & open parser conf files. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* parsers: Add filenames to struct parserJeremy Kerr2013-04-291-1/+5
| | | | | | | In preparation of moving file handling to the discover core (rather than the parsers), include the conf file names in struct parser. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* discover: Separate temporary and permanent device dataJeremy Kerr2013-04-161-7/+9
| | | | | | | | | | | At present, we keep both permanent (eg links/n_links) and temporary (event) data in struct discover_context. This change makes discover_context a temporary structure, just used during actual device discovery. Once discovery is complete, the permanent data (discover_device) is "committed" to the device handler. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* lib/types: Create common file for type definitionsJeremy Kerr2013-04-101-1/+1
| | | | | | | | | | | | The device and boot_option types are defined in pb-protocol.h, but aren't really specific to the procotol. This means a lot of non-messaging-related files are #including the protocol definitions unnecessarily. This change separates the types out into lib/types/types.h. Signed-off-by: Jeremy Kerr <jk@ozlabs.org> Signed-off-by: Geoff Levand <geoff@infradead.org>
* Add more paths to grub2 parserGeoff Levand2012-03-261-0/+4
| | | | Signed-off-by: Geoff Levand <geoff@infradead.org>
* Add grub2 conf file parserGeoff Levand2012-03-181-0/+185
Add grub2 parser and sample config file. Reorder parser priorities: From (yaboot -> kboot) to (kboot -> grub2 -> yaboot). Signed-off-by: Geoff Levand <geoff@infradead.org>
OpenPOWER on IntegriCloud