Commit Graph

10525 Commits

Author SHA1 Message Date
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 .

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 .

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
Kay Sievers
c1b14d45a9 rules: default - remove legacy agpgart
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2015-03-18 15:16:06 -04:00
Kay Sievers
586a3da832 rules: move block device rules to its own rules file
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2015-03-18 15:13:47 -04:00
Kay Sievers
d2313434ac rules: storage - relace blacklist with explicit whitelist
Newly added kernel drivers repeatedly pass our blacklist and
cause trouble for the devices, because they do not expect to
be examined by udev's default rules which include blkid.

This turns the blacklist into a whitelist. Device type which
need support for additional symlinks need to be added to the
whitelist now.

Note, that the by-id, by-path symlinks are only intended for
hotpluggable devices. There is no reason for exotic, or for
statically configured devices to provide them.

Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2015-03-18 15:09:38 -04:00
Anthony G. Basile
4f3fb6e445 shared: import close_many() from upstream
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2015-03-18 15:07:54 -04:00
Lennart Poettering
d80d6e858f shared: introduce cmsg_close_all() call
The call iterates through cmsg list and closes all fds passed via
SCM_RIGHTS.

This patch also ensures the call is used wherever appropriate, where we
might get spurious fds sent and we should better close them, then leave
them lying around.

Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2015-03-01 14:11:30 -05:00
Martin Pitt
1d1660eb1c rules: simplify mmc RPMB handling
We don't actually want a by-path/ symlink for MMC RPMB devices, so just add
them to the blacklist. This will prevent creating wrong by-path links and
blkid'ing those.

Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2015-03-01 13:43:38 -05:00
Martin Pitt
28860e0e7f rules: Fix by-path of mmc RPMB partitions and don't blkid them
Linux 3.10+ exposes RPMB (Replay Protected Memory Block) partitions of MMC
devices [1] ; trying to read them with blkid or other unspecific means will
cause kernel buffer I/O errors and timeouts. So don't run blkid on these.

Also ensure that /dev/disk/by-path creates proper symlinks and exposes the
-rpmb partition separately, instead of letting the "normal" partition symlink
point to the rpbm device (this is a race condition).

[1] http://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=090d25fe224c0

https://launchpad.net/bugs/1333140

Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2015-03-01 13:43:00 -05:00
Arend van Spriel
e5e0478a43 hwdb: add sdio identifiers for Broadcom WLAN cards
This patch adds the sdio identifiers known to be supported by
the brcmfmac open-source driver.

Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2015-03-01 13:41:18 -05:00
Marcel Holtmann
1fe2f766fd hwdb: Update database of Bluetooth company identifiers
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2015-03-01 13:40:42 -05:00
Lubomir Rintel
d58e83822c hwdb: fix ThinkPad X* Tablet special keys
ThinkPad tablet firmware has DMI product name and version reversed:

Handle 0x0001, DMI type 1, 27 bytes
System Information
        Manufacturer: LENOVO
        Product Name: 7762AS1
        Version: ThinkPad X61 Tablet
        Serial Number: LKZCDH2
        UUID: 6ADBC681-4FC9-11CB-844F-B47CB9210BE2
        Wake-up Type: Power Switch
        SKU Number: Not Specified
        Family: ThinkPad X61 Tablet

Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2015-03-01 13:39:42 -05:00
Marcel Holtmann
ed3171a211 hwdb: Update database of Bluetooth company identifiers
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2015-03-01 13:39:08 -05:00
Lennart Poettering
cb52e23e93 hwdb: update
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2015-03-01 13:38:32 -05:00
Lennart Poettering
ea55d7fed3 hwdb: fix syntax
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2015-03-01 13:37:55 -05:00
Lukas Märdian
43bbecde22 hwdb: Microsoft Microsoft 3-Button Mouse
https://bugs.freedesktop.org/show_bug.cgi?id=89149

Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2015-03-01 13:37:16 -05:00