summaryrefslogtreecommitdiffstats
path: root/discover/device-handler.h
Commit message (Collapse)AuthorAgeFilesLines
* discover: Add configuration events & DHCP handlerJeremy Kerr2013-04-291-0/+5
| | | | | | | | | | This change adds a new event type, EVENT_ACTION_CONF. These events supply a new configuration URL that petitiboot should download and parse. With this in place, we can receive DHCP configuration events. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* discover: Add configuration methodsJeremy Kerr2013-04-291-0/+6
| | | | | | | | | | | | 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: Handle unresolved resourcesJeremy Kerr2013-04-291-0/+2
| | | | | | | | | | | | This change adds an unresolved resource queue - any unresolved resources discovered by parsers are added to this queue rather than being reported to the clients. When we discover a new device, we try to resolve any resources in the queue against the new device. If resolution succeeds, we can send the option to clients. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* discover: Change parsers to emit resources rather than filenamesJeremy Kerr2013-04-291-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | 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-2/+14
| | | | | | | | | 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>
* discover: Add device lookup functionsJeremy Kerr2013-04-291-0/+11
| | | | | | | | | | | | Add a few functions to find devices by various attributes: * device_lookup_by_name * device_lookup_by_path * device_lookup_by_uuid * device_lookup_by_label * device_lookup_by_id Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* discover: Add uuid and label parameters to persistent device dataJeremy Kerr2013-04-291-0/+3
| | | | | | | | | | | | | | | | Rather than depending on the event (which is only available during inital discovery) for UUID and label parameters, this change adds uuid and label members to struct discover_device. This means that the label and UUID are available during the device's lifetime, not just during initial discovery. We can also just pass the device to some of the device handling code, rather than the discover context. Also, fix an issue where we don't use the raw label/uuid (instead of the encoded one) in setup_device_links. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* discover: Separate temporary and permanent device dataJeremy Kerr2013-04-161-9/+19
| | | | | | | | | | | 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>
* Move --dry-run option to discover serverJeremy Kerr2013-04-151-1/+2
| | | | | | | Now that the server does the booting, we should move the --dry-run argument to the server. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* discover: Implement device handler boot pathJeremy Kerr2013-04-151-0/+4
| | | | | | | | | | This change adds a funtion, device_handler_boot, which processes the boot command message from the discover server. We add a new file, discover/boot.c (and a corresponding header) with a skeleton for the final kexec code. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* Make udev_event a generic eventGeoff Levand2009-06-301-4/+3
| | | | | | | | | | The struct udev_event can be used as a generic event, so rename it struct event and move it from udev.h into a new file event.h. Also, rename the emums UDEV_ACTION_ADD and UDEV_ACTION_REMOVE to ACTION_UDEV_ADD and ACTION_UDEV_REMOVE. Signed-off-by: Geoff Levand <geoffrey.levand@am.sony.com> Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* Add discover device reportGeoff Levand2009-06-301-2/+3
| | | | | | | | | | Fillout the missing discover code that reports current devices. Replaces device_handler_get_current_devices() with two new accessor routines device_handler_get_device_count() and device_handler_get_device(). Signed-off-by: Geoff Levand <geoffrey.levand@am.sony.com> Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* Make device instance constantGeoff Levand2009-02-011-1/+1
| | | | | | | Make the instance of devices read-only. Signed-off-by: Geoff Levand <geoffrey.levand@am.sony.com> Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* Hook up parsers to device discoveryJeremy Kerr2009-01-021-0/+14
| | | | | | | | 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>
* Create device-handler for managing registered devicesJeremy Kerr2008-12-151-0/+19
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
OpenPOWER on IntegriCloud