Commit Graph

10539 Commits

Author SHA1 Message Date
David Herrmann
d8e2e4c3a4 rules: fix input-name for keyboard rules
We match on the evdev node, but only the parent has a "name" attribute.
Use $attr{device/name} to access it.

This is borked since 2013, I wonder how that ever worked? Maybe this will
suddenly fix all the DMI-based key detections.

Thanks to Peter Hutterer for catching this!

Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2015-04-12 11:18:11 -04:00
Blaž Tomažič
cb26a75abd hwdb: mouse DPI data, Roccat Lua (ROC-11-310)
https://bugs.freedesktop.org/show_bug.cgi?id=89743

Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2015-04-12 11:18:11 -04:00
Marcel Holtmann
c810c02115 hwdb: Update database of Bluetooth company identifiers
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2015-04-12 11:18:04 -04:00
Zbigniew Jędrzejewski-Szmek
db9611f269 hwdb: add HP ProBook 450G0
https://bugs.freedesktop.org/show_bug.cgi?id=89684

Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2015-04-12 11:17:59 -04:00
Yann E. MORIN
d2aeb8b63d Revert "udev: rules - modernise add_rule a bit"
Initialisers for anonymous unions are unknown to gcc-4.5, which is still
quite widely used.

See the following build failure, reported by the Buildroot autobuilders:
    http://autobuild.buildroot.org/results/11e/11ebb926b891862e270b9cb39fd2ed4344b736a8/build-end.log

This reverts commit 5cb9807847.

Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Cc: Tom Gundersen <teg@jklm.no>
2015-04-04 14:02:20 +02:00
David Cortarello
6a398265f3 Remove hardcoded path /run and configure using --with-rootrundir=
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2015-03-27 11:34:13 -04:00
Anthony G. Basile
3cda11ed7c configure.ac: update udev version to 219. 2015-03-19 19:34:33 -04:00
Anthony G. Basile
ed4a3602ea src/libudev/Makefile.am: bump libudev revision to 2
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2015-03-19 17:58:41 -04:00
Michal Schmidt
252b174d23 shared: add path_compare(), an ordering path comparison
... and make path_equal() a simple wrapper around it.

Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2015-03-19 16:54:15 -04:00
Kay Sievers
c42184ebda sysctl: move property handling to shared/
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2015-03-19 16:40:25 -04:00
Tom Gundersen
0199ac5afb libudev: private - introduce udev_device_new_from_synthetic_event()
This allows set_action(), read_uevent_file() and read_db() to be made internal to libudev.

Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2015-03-18 21:34:18 -04:00
Zbigniew Jędrzejewski-Szmek
9b2f02162b libudev-monitor: use initialization
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2015-03-18 21:31:26 -04:00
Will Woods
59b6fb3b75 selinux: fix SEGV during switch-root if SELinux policy loaded
If you've got SELinux policy loaded, label_hnd is your labeling handle.
When systemd is shutting down, we free that handle via mac_selinux_finish().

But: switch_root() calls mkdir_p_label(), which tries to look up a label
using that freed handle, and so we get a bunch of garbage and eventually
SEGV in libselinux.

(This doesn't happen in the switch-root from initramfs to real root because
there's no SELinux policy loaded in initramfs, so label_hnd is NULL and we
never attempt any lookups.)

So: make sure that mac_selinux_finish() actually sets label_hnd to NULL, so
nobody tries to use it after it becomes invalid.

https://bugzilla.redhat.com/show_bug.cgi?id=1185604

Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2015-03-18 21:15:17 -04:00
Zbigniew Jędrzejewski-Szmek
c45230b3b0 Check that EWOULDBLOCK is the same as EAGAIN
It certainly is everywhere on Linux, but as a courtesy
to people doing some strange cross-compilation, check
that the assumption holds.

Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2015-03-18 21:13:53 -04:00
Anthony G. Basile
f5625ab8c6 Replace ENOTSUP with EOPNOTSUPP
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2015-03-18 21:09:57 -04:00
Shawn Landden
3a864f5e04 udev-ctrl: fix strict aliasing issues
it is ironic that
"The only purpose of this structure is to cast the structure pointer
passed in addr in order to avoid compiler warnings.  See EXAMPLE below."
from bind(2)

Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2015-03-18 21:01:30 -04:00
Zbigniew Jędrzejewski-Szmek
8c6168fcba udev: downgrade "has devpath" and "filled with db file" messages
Udev debug messages have to be significantly overhauled... For now
just downgrade those two. They are responsible for approximately 25%
of debug output during boot and are rather useless.

Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2015-03-18 21:00:19 -04:00
Zbigniew Jędrzejewski-Szmek
96010518c6 udev: properly calculate size of remaining data
The data comes from the kernel, so chances of it being
garbled are low, but for correctness' sake, add the check.

CID #996458.

Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2015-03-18 20:58:30 -04:00
Tom Gundersen
89fe48ab02 udev: make set_usec_initialized() internal to libudev
Instead introduce ensure_usec_initialized(), which copies the timestamp if possible otherwise
sets it to now(CLOCK_MONOTONIC).

Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2015-03-18 20:55:21 -04:00
Harald Hoyer
35ef251e16 path-util: fix path_is_mount_point() for symlinks
path_is_mount_point() compares the mount_id of a directory and the
mount_id of the parent directory. When following symlinks, the function
to get the parent directory does not take the symlink into account.

/bin -> /usr/bin with /usr being a mountpoint:
mount_id of /bin with AT_SYMLINK_FOLLOW != mount_id of /

Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2015-03-18 20:51:19 -04:00
Tom Gundersen
16ded21814 udevd: improve handling of failed worker
The information in the db is stale, so it does not make sense to
expose it any longer. Also, don't drop the kernel event, but simply
pass it on to userspace without ammending it.

Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2015-03-18 20:43:21 -04:00
Tom Gundersen
f5d1fa66a1 udevd: don't free event when killing the worker, wait until it has been reaped
This will allow us to clean up the device when we are notified about the worker being killed.

Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2015-03-18 20:42:07 -04:00
Tom Gundersen
5ddef03da1 libudev: introduce clone_with_db()
This allows us to move the db reading from udevd to libudev.

Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2015-03-18 20:41:10 -04:00
Tom Gundersen
e5df4c6a52 libudev: monitor - fix error path in send_device
Return -errno rather than -1 in case sendmsg() fails.

Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2015-03-18 20:40:02 -04:00
Tom Gundersen
93d2bf9fcb udevd: event - make db loading lazy in REMOVE event handling
We were explicitly eagerly loading the db, then deletenig the backing file and then processing the
rules/symlinks. Instead we delete the backnig db file as the last step and let the db loading be
lazy as everywhere else.

This may save us a bit of work in casese where the db is not needed, but more importantly it hides
some implementation details of libudev-device form udevd.

Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2015-03-18 20:38:26 -04:00
Tom Gundersen
87a58f2043 libudev: introduce udev_device_properties_copy()
To copy properties from one device to another. Drop the equivalent functionality from udevd.

Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2015-03-18 20:37:21 -04:00
Kay Sievers
b8adef56d8 udev: add SYSCTL{} support
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2015-03-18 20:33:17 -04:00
Tom Gundersen
a79d38412a libudev: private - make property_from_string_parse* static
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2015-03-18 20:25:14 -04:00
Tom Gundersen
bf79b2d789 libudev: add missing hunks
This should have been committed with
  udev_device_add_property - implicitly mark properties for saving to db

Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2015-03-18 20:00:41 -04:00
Tom Gundersen
a36d7fe55b libudev: udev_device_read_db - drop unused argument
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2015-03-18 19:59:37 -04:00
Tom Gundersen
5c3965d1a8 libudev: udev_device_add_property - implicitly mark properties for saving to db
Note: We also ported touch() and touch_file() from upstream. -AGB.

Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2015-03-18 19:56:01 -04:00
Tom Gundersen
ced0d2419e udev/libudev: event - move {OLD_,}INTERFACE handling from udevd to libudev
This should be internal to the library as it is only about reflecting the sysfs state in the udev_device.

Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2015-03-18 19:33:52 -04:00
Tom Gundersen
95186c2ee4 udev: simplify event_queue_update() and add debug logging
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2015-03-18 19:32:58 -04:00
Lennart Poettering
87bf8c79dc udev: use inttypes.h types wherever appropriate
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2015-03-18 19:30:09 -04:00
Lennart Poettering
60e1a98116 tree-wide: use _packed_ macro instead of raw gcc __attribute__
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2015-03-18 19:29:00 -04:00
Tom Gundersen
3fa57f4051 udevd: close race in udev settle
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2015-03-18 19:13:22 -04:00
Zbigniew Jędrzejewski-Szmek
a46b4ff7cc v4l_id: use standard option parsing loop
Not terribly important, but the loop wasn't an actual loop,
making coverity unhappy.

CID #1261725.

Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2015-03-18 19:07:03 -04:00
Kay Sievers
a45a9a1c32 rules: keyboard - prefix "atkbd" match strings like we prefix the "name" strings
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2015-03-18 17:06:01 -04:00
Anthony G. Basile
73c6fdf901 rules: remove unsed net rules
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2015-03-18 17:05:36 -04:00
Kay Sievers
bf856b7c02 rules: keyboard - remove platform from comments + prefix "atkbd" match strings like we prefix the "name" strings
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2015-03-18 16:21:02 -04:00
David Herrmann
265a49fca9 rules: drop redundant match
The 60-keyboard rules are already guared by KERNEL!="event*" bail-outs,
therefore, KERNELS="input*" is always true. Drop it!

Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2015-03-18 16:05:33 -04:00
David Herrmann
4da04e3dde hwdb: support bluetooth keyboard fixups
Drop the restriction not to match on bluetooth devices. They are supported
just fine!

Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2015-03-18 16:04:31 -04:00
David Herrmann
bd4a68b3fb hwdb: convert to generic input-modalias matches
There is no reason to match on usb-modaliases, if we can use the
input-modalias to achieve the same. This commit changes the
keyboard-lookups to not be restricted to USB, but pass all modaliases to
the hwdb. Furthermore, we convert all usb:* matches to input:* matches,
thus getting rid of any ambiguity if multiple usb devices are chained (or
a bluetooth device / etc. is on top).

Note that legacy keyboard:usb:* matches are still supported, but
deprecated. If possible, please use keyboard:input:* matches instead.

This is a required step to make other input devices work with
60-keyboard.hwdb. Other bus-types are often chained on usb and we want to
avoid any ambiguity here if we incorrectly match on a USB hub.

Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2015-03-18 16:03:08 -04:00
Kay Sievers
d053d3b866 hwdb: update
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2015-03-18 16:02:07 -04:00
Peter Hutterer
2d9ddf7d94 hwdb: add Lenovo W451 to TOUCHPAD_HAS_TRACKPOINT_BUTTONS list
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2015-03-18 16:01:26 -04:00
Jonathon Gilbert
1dd9ddb1b9 hwdb: add Logitech G5 Laser Mouse
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2015-03-18 16:00:28 -04:00
Zbigniew Jędrzejewski-Szmek
4ba6c8be63 hwdb: fix Dell XPS12 9Q33 key name
https://bugs.freedesktop.org/show_bug.cgi?id=84437

Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2015-03-18 15:59:06 -04:00
Peter Hutterer
b8260ac587 hwdb: add pnpid for the T450s touchpad
https://bugs.freedesktop.org/show_bug.cgi?id=89411

Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2015-03-18 15:57:38 -04:00
Kay Sievers
b45bb6733b rules: merge tty and serial rules file
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2015-03-18 15:55:48 -04:00
Kay Sievers
51ed849fb0 rules: merge udev-late.rules files
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2015-03-18 15:44:36 -04:00