summaryrefslogtreecommitdiffstats
path: root/discover/parser.h
Commit message (Collapse)AuthorAgeFilesLines
* discover: Add configuration methodsJeremy Kerr2013-04-291-1/+4
| | | | | | | | | | | | 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>
* discover: Change parsers to emit resources rather than filenamesJeremy Kerr2013-04-291-0/+23
| | | | | | | | | | | | | | | | | | | | | | | | 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>
* parsers: change parser.parse to accept a bufferJeremy Kerr2013-04-291-1/+2
| | | | | | | 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-2/+3
| | | | | | | 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-2/+1
| | | | | | | | | | | 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>
* discover: Consolidate user events by device IDJeremy Kerr2013-04-161-1/+2
| | | | | | | | | | Currently, we assume all user events are for a new device. This means that we can never add boot options to an existing device. This change tries to find an existing (matching by ID) device before creating a new one in the user event add path. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* parser: remove unused fields from struct parserJeremy Kerr2013-03-051-2/+0
| | | | | Signed-off-by: Jeremy Kerr <jk@ozlabs.org> Signed-off-by: Geoff Levand <geoff@infradead.org>
* Add discover user eventGeoff Levand2009-06-301-0/+1
| | | | | | | Add a gereric event interface to pb-discover. Signed-off-by: Geoff Levand <geoffrey.levand@am.sony.com> Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* Use separate section for parsers arrayJeremy Kerr2009-01-021-0/+2
| | | | | | | Instead of hardcoding the array of parsers, use the linker to do the work for us. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* Hook up parsers to device discoveryJeremy Kerr2009-01-021-27/+6
| | | | | | | | Iterate the parsers from the device handler on an add event. Initial change to just the kboot parser. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* Initial support for multiple UIsJeremy Kerr2008-12-151-0/+46
Move the device discovery code from separate udev helpers to a single process to listen on two sockets: one SOCK_DGRAM for incoming udev events, and one SOCK_STREAM for UIs to connect. Initial support for client/server infrastructure, still need to wire-up the udev messages. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
OpenPOWER on IntegriCloud