summaryrefslogtreecommitdiff
path: root/src/udev
AgeCommit message (Collapse)Author
2015-05-12udevd: manager - move a few global variables into the Manager objectTom Gundersen
2015-05-12udevd: pass a Manager objcet to event handlersTom Gundersen
Stop relying on global variables in event handlers, and move them all to a Manager object instead.
2015-05-12udevd: remove stale commentTom Gundersen
2015-05-12udevd: explicitly update queue file before answering to pingTom Gundersen
This avoids updating the flag files twice for every loop, and also removes another dependency in the main-loop, so we are freer to reshufle it as we want.
2015-05-12udevd: explicitly read out uevents we create ourselvesTom Gundersen
Rather than skippling ctrl handling whenever we have handlede inotify events (and hence may have synthesized a 'change' event), just call the uevent handling explicitly from on_inotify() so that the event queue is up-to-date.
2015-05-12udevd: move to sd-event-style event handlersTom Gundersen
2015-05-12udevd: make udev_ctrl_connection globalTom Gundersen
This allows us to simplify the ctrl_msg handler. Eventually all this global state should move to a Manager object or so.
2015-05-11treewide: Correct typos and spell plural of bus consistentTorstein Husebø
2015-05-07udevd: remove unused functionThomas Hindoe Paaboel Andersen
2015-05-06udevd: don't explicitly count the number of workersTom Gundersen
Simply query the size of the hashmap keeping all the worker contexts instead.
2015-05-06udevd: keep workers in a hashmap rather than a listTom Gundersen
This makes the code somewhat more readable.
2015-05-06udevd: worker - drop reference countingTom Gundersen
Make the worker context have the same life-span as the worker process. It is created on fork() and free'd on SIGCHLD. The change means that we can get worker_returned() for a worker context that is no longer around, this is not a problem and we can just drop the message. The only use for worker_returned() is to know to reschedule events to workers that are still around, so if the worker has already exited it is not important to keep track of. We still print a debug statement in this case to be on the safe side.
2015-05-06udev: fix weird coding-styleDavid Herrmann
Eeeew!
2015-05-06udevd: worker - allow passing NULL to worker_unref()Tom Gundersen
2015-05-06udevd: worker - use _exit() rather than exit()Tom Gundersen
Follow the coding style and avoid the exit handlers.
2015-05-06udevd: modernize error handlingTom Gundersen
We never return magic exit codes, but just EXIT_FAILUER or EXIT_SUCCESS.
2015-05-06udevd: use kernel cmdline parserTom Gundersen
2015-05-06udevd: worker - move some fields from the worker to the eventTom Gundersen
2015-05-06udevd: worker - introduce worker_attach_event()Tom Gundersen
2015-05-06udevd: worker - make refcounting clearerTom Gundersen
Take and drop explicit references where it makes sense.
2015-05-06udevd: worker - only allocate the worker struct in the main processTom Gundersen
This is not used in the worker, so avoid having to free it there.
2015-05-06udevd: rename worker_new() to worker_spawn()Tom Gundersen
2015-05-06udevd: don't track worker exitcodeTom Gundersen
We used to use this to track failed events so they could be retriggered, but that is no longer done, so the code can be dropped.
2015-05-06udev: fix coding styleSusant Sahani
2015-04-24udevd: worker - log if worker result cannot be sentTom Gundersen
If the main daemon is not notified about a worker finishing an event the refcounting of the worker struct will be wrong, and we will lose track of the number of children we have to wait for. This should not happen, but if it does we better complain loudly about it. Worst case udev will wait for 30 seconsd at shutdown waiting for nonexistent workers.
2015-04-24udevd: worker - warn if unknown worker returnsTom Gundersen
2015-04-24udevd: worker - let the kernel attach the sender pidTom Gundersen
No need to include this explicitly, just use SCM_CREDENTIALS.
2015-04-24udevd: don't unref worker objects on SIGSTOP/SIGCONTTom Gundersen
We should not be receiving these anyway, but let's be correct.
2015-04-24udevd: warn if we receive SIGCHLD from untracked workerTom Gundersen
2015-04-24udevd: improve logging in SIGCHLD handlingTom Gundersen
Remove some redundant logging, and reduce the log-level in most cases. The only case that is really critical is if a worker failed while hanlding an event, so keep that at error level.
2015-04-23udevd: fix REMOVE handlingTom Gundersen
This reverts b67f944. Lazy loading of device properties does not work for devices that are received over netlink, as these are sealed. Reinstate the unconditional loading of the device db. Reported by: Mantas Mikulėnas <grawity@gmail.com>.
2015-04-23udev: event - update tags before writing out dbTom Gundersen
The old tags are read from the db when deciding which tags to clear, make sure we don't write out the new db before the old one has been read.
2015-04-22udev: Fix ping timeout when settle timeout is 0Nir Soffer
When running udevadm settle --timeout=0, the ping always times out, and udevadm will return 0 without checking the queue state. (David: Use a reasonable timeout to still get the barrier provided by ctrl-ping)
2015-04-21udevadm: enclose invocation of unlinkat() with a (void) castLennart Poettering
Let's make Coverity happy about this one.
2015-04-21udev: keyboard-builtin: Add support for setting IBM trackpoint sensitivityHans de Goede
IBM / Lenovo trackpoints allow specifying a sensitivity setting through a ps/2 command, which changes the range of the deltas sent when using the trackpoint. On some models with normal usage only deltas of 1 or 2 are send, resulting in there only being 2 mouse cursor movement speeds, rather than the expected fluid scale. Changing the sensitivity to a higher level than the bootup default fixes this. This commit adds support for setting a POINTINGSTICK_SENSITIVITY value in hwdb to allow changing the sensitivity on boot through udev / hwdb.
2015-04-20udev: settle should return immediately when timeout is 0Nir Soffer
udevadm manual says: A value of 0 will check if the queue is empty and always return immediately. However, currently we ignore the deadline if the value is 0, and wait without any limit. Zero timeout behaved according to the documentation until commit ead7c62ab7 (udevadm: settle - kill alarm()). Looking at this patch, it seems that the behavior change was unintended. This patch restores the documented behavior.
2015-04-15udev-builtin-usb_id: fix inverted conditionZbigniew Jędrzejewski-Szmek
Fix for 4beac74e69. Thanks, Ronny!
2015-04-14udev-builtin-usb_id: simplificationZbigniew Jędrzejewski-Szmek
2015-04-14udev: downgrade a few warnings to debug messagesLennart Poettering
https://bugs.freedesktop.org/show_bug.cgi?id=89885
2015-04-14input_id: Identify scroll-wheel device on Trust TB7300 tablet as keyboardHans de Goede
The Trust TB7300 (relabelled Waltop?) tablet has a scrollwheel which shows up as a /dev/input/event# node all by itself. Currently input_id does not set any ID_INPUT_FOO attr on this causing it it to not be recognized by Xorg / libinput. This commit fixes this by marking it with ID_INPUT_KEY. Reported-by: Sjoerd Timmer <themba@randomdata.nl>
2015-04-14udev: input_id: Make test_pointer / test_keys return if they've found anythingHans de Goede
Make test_pointer / test_keys return a boolean indicating whether or not they've set any properties on the device.
2015-04-14udev: input_id: whitespace fixesPeter Hutterer
Remove whitespaces before opening parentheses, mostly before test_bit.
2015-04-12udev-builtin-keyboard: make error messages more standardZbigniew Jędrzejewski-Szmek
- No need to add "Error, " prefix, we already have that as metadata. - Also use double quotes for path names, as in most other places. - Remove stray newline at end of message. - Downgrade error messages after which we continue to warnings.
2015-04-11udevd: fix synchronization with settle when handling inotify eventsDaniel Drake
udev uses inotify to implement a scheme where when the user closes a writable device node, a change uevent is forcefully generated. In the case of block devices, it actually requests a partition rescan. This currently can't be synchronized with "udevadm settle", i.e. this is not reliable in a script: sfdisk --change-id /dev/sda 1 81 udevadm settle mount /dev/sda1 /foo The settle call doesn't synchronize there, so at the same time we try to mount the device, udevd is busy removing the partition device nodes and readding them again. The mount call often happens in that moment where the partition node has been removed but not readded yet. This exact issue was fixed long ago: http://git.kernel.org/cgit/linux/hotplug/udev.git/commit/?id=bb38678e3ccc02bcd970ccde3d8166a40edf92d3 but that fix is no longer valid now that sequence numbers are no longer used. Fix this by forcing another mainloop iteration after handling inotify events before unblocking settle. If the inotify event caused us to generate a "change" event, we'll pick that up in the following loop iteration, before we reach the end of the loop where we respond to settle's control message, unblocking it.
2015-04-11udev: restore udevadm settle timeoutNir Soffer
Commit 9ea28c55a2 (udev: remove seqnum API and all assumptions about seqnums) introduced a regresion, ignoring the timeout option when waiting until the event queue is empty. Previously, if the udev event queue was not empty when the timeout was expired, udevadm settle was returning with exit code 1. To check if the queue is empty, you could invoke udevadm settle with timeout=0. This patch restores the previous behavior. (David: fixed timeout==0 handling and dropped redundant assignment)
2015-04-11udev: builtin-keyboard: add support for EVDEV_ABS_*Peter Hutterer
Parse properties in the form EVDEV_ABS_00="<min>:<max>:<res>:<fuzz>:<flat>" and apply them to the kernel device. Future processes that open that device will see the updated EV_ABS range. This is particularly useful for touchpads that don't provide a resolution in the kernel driver but can be fixed up through hwdb entries (e.g. bcm5974). All values in the property are optional, e.g. a string of "::45" is valid to set the resolution to 45. The order intentionally orders resolution before fuzz and flat despite it being the last element in the absinfo struct. The use-case for setting fuzz/flat is almost non-existent, resolution is probably the most common case we'll need. To avoid multiple hwdb invocations for the same device, replace the hwdb "keyboard:" prefix with "evdev:" and drop the separate 60-keyboard.rules file. The new 60-evdev.rules is called for all event nodes anyway, we don't need a separate rules file and second callout to the hwdb builtin.
2015-04-11udev: builtin-keyboard: invert a conditionPeter Hutterer
No functional changes, just to make the next patch easier to review
2015-04-11udev: builtin-keyboard: move actual key mapping to a helper functionPeter Hutterer
No changes in the mapping, but previously we opened the device only on successful parsing. Now we open the mapping as soon as we have a value that looks interesting. Since errors are supposed to be the exception, not the rule, this is probably fine.
2015-04-11udev: builtin-keyboard: immediately EVIOCSKEYCODE when we have a pairPeter Hutterer
Rather than building a map and looping through the map, immediately call the ioctl when we have a successfully parsed property. This has a side-effect: before the maximum number of ioctls was limited to the size of the map (1024), now it is unlimited.
2015-04-11udev: builtin-keyboard: move fetching the device node upPeter Hutterer
No point parsing the properties if we can't get the devnode to apply them later. Plus, this makes future additions easier to slot in.