summaryrefslogtreecommitdiffstats
path: root/discover/udev.c
Commit message (Collapse)AuthorAgeFilesLines
* discover/udev: Set device type for optical media correctlyJeremy Kerr2014-01-131-1/+1
| | | | Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* configure: Use AC_GNU_SOURCEJeremy Kerr2013-12-181-1/+3
| | | | | | | Rather than #defining _GNU_SOURCE in our .c files, we can define this from config.h instead. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* discover/udev: Use UUIDs for multipath checkJeremy Kerr2013-12-051-9/+14
| | | | | | Partitions will share a serial number. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* discover: Fix CDROM handlingJeremy Kerr2013-12-021-1/+80
| | | | | | | | | | | | | Currently, we don't handle CDROM devices well; we'll try to mount on boot, and not detect any media changes. Also, the default rules shipping with udev will put the CDROM tray into a locked state, blocking eject from working. This change adds a set of cdrom utility functions, which the udev code can use to properly initialise cdrom devices and handle eject and media change requests. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* discover/udev: copy dev->device path from udev devnodeJeremy Kerr2013-12-021-1/+2
| | | | | | | We're seeing a use-after-free, as the udev path is freed before the discover device. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* discover: Change parsers to explicitly request configuration filesNeelesh Gupta2013-11-061-1/+1
| | | | | | | | | | | | | | | | | | | 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>
* logging: Clean up debug logsJeremy Kerr2013-11-011-10/+1
| | | | | | | We have quite a few pb_logs which should be pb_debug. This change moves developer-specific info to pb_debug. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* discover/udev: dup property values returned from udevJeremy Kerr2013-10-091-2/+7
| | | | | | The property strings are managed by the udev code, so we need to strdup. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* discover: Check for devices with duplicate serial propertiesJeremy Kerr2013-09-241-0/+7
| | | | | | | | | If we have multipath devices present in the system, we'll end up with duplicate mounts, parse results and boot options. This change adds a check to see if we've encountered a device with this serial number previously. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* discover: Remove unnecessary event passingJeremy Kerr2013-09-191-57/+67
| | | | | | | | | | | | | | | Currently, we pass "events" between the udev, user-event and device-handler layers. These events all get sent through device_handler_event, then de-multiplexed to an appropriate handler, depending on their source. Instead, just export relevant device_handler functions, and have the (old) event sources call these functions directly. This also means we can include a lot more of the device hander code in the parser tests. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* discover: Consolidate device path, name and ID.Jeremy Kerr2013-09-191-1/+2
| | | | | | | | | | | | This change cleans up our usage of device path, names and IDs. Device ID is the kernel name for the device. We also expose this through lookup_by_name. Device path is the path to the dev node (ie, always starts with /dev/), and is only used for mounting. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* discover: populate udev device typesJeremy Kerr2013-09-181-0/+1
| | | | | | Now that we have device types, populate from the udev info. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* lib/waiter: Add timeout waitersJeremy Kerr2013-06-241-1/+1
| | | | Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* discover: log cleanupJeremy Kerr2013-05-161-8/+1
| | | | | | | Remove some of the more noisy log messages, and add some information pertinent to device resolution events. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* discover/udev: use devname (not devpath) for device IDsJeremy Kerr2013-05-151-1/+1
| | | | | | devnames are unique, and much shorter. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* discover/udev: Setup event params from udev propertiesJeremy Kerr2013-05-091-16/+17
| | | | Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* discover/udev: Don't print properties of skipped devicesJeremy Kerr2013-05-091-2/+2
| | | | | | This cleans up the log output a little. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* udev: Revove use of udev_get_sys_pathGeoff Levand2013-05-051-1/+1
| | | | | | | libudev1 changed the symbol udev_get_sys_path to be private, so remove its use in petitboot. Signed-off-by: Geoff Levand <geoff@infradead.org>
* discover: Remove empty routine udev_triggerGeoff Levand2013-05-031-5/+0
| | | | | | | | With the switch of the discover server to use the libudev enumeration support the udev_trigger() routine has becone empty and is no longer needed. Signed-off-by: Geoff Levand <geoff@infradead.org>
* discover: Update udev routines to use libudevGeoff Levand2013-05-031-90/+238
| | | | | | | Support for 'RUN+="socket:' in udev rules files has been removed in udev version 183. Update the discover server to use libudev. Signed-off-by: Geoff Levand <geoff@infradead.org>
* discover: Rename struct udev to struct pb_udevGeoff Levand2013-05-031-9/+9
| | | | | | | To avoid symbol clashes with libudev, rename struct udev to struct pb_udev. No functional changes. Signed-off-by: Geoff Levand <geoff@infradead.org>
* waiter: Don't rely on global variables to keep waiter stateJeremy Kerr2013-04-101-2/+2
| | | | | | | | | Rather than defining the set of waiters (and pollfds) in waiter.c, add a struct waitset to contain these. A waitset is created with waitset_create, which is passed to the waiter_* functions. Signed-off-by: Jeremy Kerr <jk@ozlabs.org> Signed-off-by: Geoff Levand <geoff@infradead.org>
* Add udevadm to pb_system_appsJeremy Kerr2013-03-051-1/+1
| | | | | Signed-off-by: Jeremy Kerr <jk@ozlabs.org> Signed-off-by: Geoff Levand <geoff@infradead.org>
* discover: Use pb_run_cmd rather than calling system()Jeremy Kerr2013-03-051-1/+11
| | | | | Signed-off-by: Jeremy Kerr <jk@ozlabs.org> Signed-off-by: Geoff Levand <geoff@infradead.org>
* pb-discover: Ignore ram, loop and no-name devicesGeoff Levand2012-03-261-5/+17
| | | | Signed-off-by: Geoff Levand <geoff@infradead.org>
* Zero automatic sockaddrGeoff Levand2012-03-261-0/+1
| | | | Signed-off-by: Geoff Levand <geoff@infradead.org>
* Add DEVPATH to udev_print_event()Geoff Levand2012-03-261-2/+6
| | | | Signed-off-by: Geoff Levand <geoff@infradead.org>
* Add '--action=add' to udevadm trigger commandGeoff Levand2012-02-241-1/+3
| | | | Signed-off-by: Geoff Levand <geoff@infradead.org>
* Make udev_event a generic eventGeoff Levand2009-06-301-88/+13
| | | | | | | | | | 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>
* Udev log socket deviceGeoff Levand2009-06-301-0/+2
| | | | | | | To aid problem resolution log the udev socket device to the pb_log. Signed-off-by: Geoff Levand <geoffrey.levand@am.sony.com> Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* Add udev triggerGeoff Levand2009-06-301-0/+10
| | | | | | | | Add a new routine udev_trigger() that requests a replay of system udev events. Signed-off-by: Geoff Levand <geoffrey.levand@am.sony.com> Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* Log server messages to fileGeoff Levand2009-03-231-2/+2
| | | | | | | Log discover server messages to a file. Helps in debugging the server when is has problems at system startup. Signed-off-by: Geoff Levand <geoffrey.levand@am.sony.com>
* Move log to libraryGeoff Levand2009-02-011-1/+1
| | | | | | | | | | | Move the log routines to the petitboot library. The log routines are generic enough to be used for both server and client. Does not change the log source. jk: move to lib/log/ instead of lib/ Signed-off-by: Geoff Levand <geoffrey.levand@am.sony.com> Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* Move waiter to libraryGeoff Levand2009-02-011-1/+1
| | | | | | | | | | | Move the waiter routines into the petitboot library. The waiter routines are generic enough to be used for both server and client. Does not change the waiter source. jk: move to lib/waiter/ instead of lib/ Signed-off-by: Geoff Levand <geoffrey.levand@am.sony.com> Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* Initial device handler codeJeremy Kerr2008-12-161-2/+2
| | | | | | Mount discovered devices, and set up symlinks for UUID and LABELs Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* Hook up udev events to device handlerJeremy Kerr2008-12-151-1/+7
| | | | Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* Initial support for multiple UIsJeremy Kerr2008-12-151-0/+208
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