Commit Graph

10720 Commits

Author SHA1 Message Date
Tom Gundersen
5100dad077 udevd: worker - let the kernel attach the sender pid
No need to include this explicitly, just use SCM_CREDENTIALS.

Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2015-05-03 15:32:11 -04:00
Tom Gundersen
9b01b56629 udevd: don't unref worker objects on SIGSTOP/SIGCONT
We should not be receiving these anyway, but let's be correct.

Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2015-05-03 15:29:03 -04:00
Tom Gundersen
210f90af1d udevd: warn if we receive SIGCHLD from untracked worker
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2015-05-03 15:28:25 -04:00
Tom Gundersen
29af2fd71d udevd: improve logging in SIGCHLD handling
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-05-03 15:27:40 -04:00
Anthony G. Basile
31151da3c4 src/shared/util.h: import xsprintf() from upstream.
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2015-05-03 14:53:28 -04:00
Tom Gundersen
2a6e0ea1b6 udev: event - update tags before writing out db
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.

Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2015-05-03 14:44:02 -04:00
Nir Soffer
1f84e42e19 udev: Fix ping timeout when settle timeout is 0
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)

Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2015-05-03 14:43:16 -04:00
Lennart Poettering
6534505be7 udevadm: enclose invocation of unlinkat() with a (void) cast
Let's make Coverity happy about this one.

Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2015-05-03 14:42:35 -04:00
Nir Soffer
5d4ffb7b7e udev: settle should return immediately when timeout is 0
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.

Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2015-05-03 14:38:27 -04:00
Zbigniew Jędrzejewski-Szmek
cb0e80578d udev-builtin-usb_id: fix inverted condition
Fix for 4beac74e69.

Thanks, Ronny!

Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2015-05-03 14:37:51 -04:00
Zbigniew Jędrzejewski-Szmek
d382c64fad udev-builtin-usb_id: simplification
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2015-05-03 14:36:51 -04:00
Lennart Poettering
84091204f1 udev: downgrade a few warnings to debug messages
https://bugs.freedesktop.org/show_bug.cgi?id=89885

Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2015-05-03 14:36:10 -04:00
Hans de Goede
f756c5139d input_id: Identify scroll-wheel device on Trust TB7300 tablet as keyboard
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>

Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2015-05-03 14:35:30 -04:00
Hans de Goede
f0983247a5 udev: input_id: Make test_pointer / test_keys return if they've found anything
Make test_pointer / test_keys return a boolean indicating whether or not
they've set any properties on the device.

Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2015-05-03 14:34:52 -04:00
Peter Hutterer
94599694d9 udev: input_id: whitespace fixes
Remove whitespaces before opening parentheses, mostly before test_bit.

Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2015-05-03 14:34:11 -04:00
Tom Gundersen
d2c243dbd9 libudev: monitor - fix typo in log message
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2015-05-03 14:27:02 -04:00
Tom Gundersen
591caddeb9 libudev: monitor - clarify log messages
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2015-05-03 14:26:05 -04:00
Anthony G. Basile
03c9f6028b libudev/libudev-enumerate.c: do not match only on initialized devices by default
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2015-05-03 14:11:33 -04:00
Anthony G. Basile
372ddd7e0e libudev/libudev-enumerate.c: do not reduce to a thin wrapper around sd-device
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2015-05-03 14:05:57 -04:00
Adam Goode
ed2fa53c4a rules: Add more firewire properties for sound, to be closer to USB and PCI
USB and PCI soundcards have a nice set of ID_* properties. It would
be handy for firewire soundcards to have the same.

Note that this removes the explicit setting of ID_ID in the firewire
conditional. Because we are now setting ID_SERIAL, ID_ID will come
from later in the file.

Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2015-05-03 13:58:03 -04:00
Adam Goode
b743095184 rules: Don't use ALSA card id in ID_ID
The ALSA id sysattr is generated by the sound subsystem and is not
a stable identifier. It is generated though some string manipulation
then made unique if there is a conflict. This means that it is
enumeration-dependent and shouldn't be used for ID_ID.

If ID_ID is supposed to be system-unique, it is not already since
for firewire it is generated from the guid and there are broken
firewire devices that have duplicate guids across devices.

This is tracked for PulseAudio at
https://bugs.freedesktop.org/show_bug.cgi?id=90129.

This is essentially a revert of systemd
ed1b2d9fc7.

Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2015-05-03 13:57:26 -04:00
Zbigniew Jędrzejewski-Szmek
ece5474ed4 hwdb: coalesce same pointingstick entries into one
Multiple models in the same hardware series are likely to have similar
specs. We should use organization similar to hwdb/60-evdev.

Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2015-05-03 13:54:17 -04:00
Hans de Goede
ab24ad9042 udev: hwdb: Add trackpoint sensitivity settings for Lenovo X240 and 540p
Like the T440s these need the sensitity to be set significantly higher
then the default of 128 for the trackpoint to be usable. Like with the
T440s 200 seems to be a good value to get a reasonable but not too high
sensitivity.

Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2015-05-03 13:53:46 -04:00
Peter Hutterer
43bca610f2 hwdb: fix typo - "sort by by..." -> "sort by..."
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2015-05-03 13:53:13 -04:00
Peter Hutterer
b71f26d8f5 hwdb: add HP X1000 DPI info
Device name is PixArt, but it's sold as a HP brand.

https://bugs.freedesktop.org/show_bug.cgi?id=90142

Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2015-05-03 13:52:32 -04:00
Benjamin Tissoires
b574f77178 hwdb: add Chromebook pixel (2015) resolution fix
The atmel driver sets a default resolution of 20 for each touchpads it
creates. On this model, 10 is more appropriate.

The resolution is not set for the touchscreen by the kernel, so match
the name to both touchpad and touchscreen.

Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2015-05-03 13:51:49 -04:00
Benjamin Tissoires
e571fca1c0 hwdb: add evdev entry for the Lenovo X230 series touchpad
The Lenovo X230 advertize a vertical resolution of 136, which gives a true
size of 31 mm. The actual physical size of the touchpad is 40 mm, so
override the resolution to 100.

Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2015-05-03 13:51:11 -04:00
Hans de Goede
5983d43fbd hwdb: Add entries for the pointingstick on 2 Dell Latitudes
The pointingstick of the Dell Latitude E6400 is somewhat slow by default,
whereas the pointingstick of the Dell Latitude D620 is much too fast by
default, set POINTINGSTICK_CONST_ACCEL for both of them to adjust for this.

Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2015-05-03 13:50:16 -04:00
Hans de Goede
55c5046e38 hwdb: Add entries for the trackpoint on 2 Thinkpads
Lenovo has changed the sensitivity of the trackpoint on the x240 / T440s / T540
generation of Thinkpads, making them somewhat insensitive by default, add a
hwdb entry to tweak the sensitivity setting.

The ThinkPad X200s is way way too slow by default and unless you push the
trackpoint quite hard only sends delta events in the 1-2 range, tweak the
sensitivity to make it send a wider range of deltas and apply a const accel
factor to make it have a more reasonable speed by default.

Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2015-05-03 13:49:36 -04:00
Hans de Goede
c17bf40825 udev: keyboard-builtin: Add support for setting IBM trackpoint sensitivity
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.

Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2015-05-03 13:46:48 -04:00
Hans de Goede
eb38f78d79 udev: Add hwdb file for setting pointingstick properties
There is quite a wide spread in the delta events generated by pointingsticks,
some generate deltas of 1-2 under normal use, while others generate deltas
from 1-20.

This commit adds a hwdb file which allows specifying a per model
POINTINGSTICK_CONST_ACCEL value which can be used by the userspace input stack
to normalize the deltas so that all pointingsticks get the same feeling ootb.

The hwdb matching re-uses the existing 60-evdev.rules.

Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2015-05-03 13:45:55 -04:00
Martin Pitt
d199a52892 hwdb: Fix wireless switch on Dell Latitude
It does not generate a release event.

https://launchpad.net/bugs/1441849

Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2015-04-17 19:24:50 -04:00
Ronny Chevalier
38a4db66e7 Ronny Chevalier <chevalier.ronny@gmail.com>shared: add terminal-util.[ch]
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2015-04-15 16:05:41 -04:00
Anthony G. Basile
5ad9610b49 test: test only udev and libudev. 2015-04-14 19:31:08 -04:00
Ronny Chevalier
9b8066c9e3 shared: add random-util.[ch]
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2015-04-14 19:21:57 -04:00
Ronny Chevalier
47fefe3040 shared: add process-util.[ch]
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2015-04-14 18:42:09 -04:00
Lennart Poettering
4b725bd2d3 util: when unescaping C escape sequences support C++11 \u and
\U unicode literals

We simply recode them in utf8.

Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2015-04-14 17:31:34 -04:00
Lennart Poettering
119711f4e8 path-util: fix more path_is_mount e792e890f fallout
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2015-04-12 18:59:02 -04:00
Lennart Poettering
88113c8b3f path-util: don't eat up ENOENT in path_is_mount_point()
There's no reason to eat up ENOENT, it should be OK to simply report the
error back.

Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2015-04-12 18:59:02 -04:00
Lennart Poettering
ea18efb8e7 path-util: make sure fd_is_mount_point() returns true for root directory
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2015-04-12 18:58:57 -04:00
Anthony G. Basile
df768a72b5 src/shared/Makefile.am: fix make dist-check
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2015-04-12 18:58:54 -04:00
Lennart Poettering
4a891daec0 path-util: if parent can do name_to_handle() but relevant dir not, it's a mount point
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2015-04-12 18:58:42 -04:00
Lennart Poettering
3df6745c2b path-util.c: changes for rm-rf: never cross mount points
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2015-04-12 18:45:08 -04:00
David Herrmann
c9853d8cda hashmap: return NULL from destructor
We _always_ return NULL from destructors to allow direct assignments to
the variable holding the object. Especially on hashmaps, which treat NULL
as empty hashmap, this is pretty neat.

Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2015-04-12 18:16:35 -04:00
Ronny Chevalier
461300d949 shared: add formats-util.h
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2015-04-12 18:08:17 -04:00
Lennart Poettering
453b353653 device-nodes: minor simplifications
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2015-04-12 17:46:37 -04:00
Anthony G. Basile
8b2a897e59 util.c: follow upstream's comments. 2015-04-12 17:44:19 -04:00
Tom Gundersen
4e9414b656 shared: set - make argument to set_remove() const
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2015-04-12 17:20:13 -04:00
Zbigniew Jędrzejewski-Szmek
6529265de6 shared/mkdir: do not set errno in addition to return value
All callers look at the return value anyway.
2015-04-12 17:03:06 -04:00
David Herrmann
ff1acaf3c4 strv: return NULL from strv_free()
We always return NULL/invalid-object from destructors, fix strv_free() to
do the same.

Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2015-04-12 17:01:34 -04:00