summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2015-04-12strv: return NULL from strv_free()David Herrmann
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-1260-keyboard.hwdb: update commentAnthony G. Basile
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. Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2015-04-12udevd: 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. Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2015-04-12udev: 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) Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2015-04-12hwdb: add Samsung ATIV Book 6 / 8Gavin Li
This adds support for the keyboard illumination keys and fixes Fn+F1. Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2015-04-12hwdb: set the resolution for a couple of bcm5974 touchpadsPeter Hutterer
Verified for the 5,1 Macbook, the others are guesses based on the list of supported devices of the moshi trackpad protector. http://www.moshi.com/trackpad-protector-trackguard-macbook-pro#silver Resolution calculated based on the min/max settings set in the kernel driver, divided by the physical size. This is probably slightly off, but still better than no resolution at all. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2015-04-12rules: finish incomplete renameZbigniew Jędrzejewski-Szmek
Fixup for 51c0c2869845a058268d54c3111d55d0dd485704. Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2015-04-12rules: fix tests for removable stateMatthew Garrett
We only care about whether our direct parent is removable, not whether any further points up the tree are - the kernel will take care of policy for those itself. This enables autosuspend on devices where the root hub reports that its removable state is unknown. Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2015-04-12udev: builtin-keyboard: add support for EVDEV_ABS_*Anthony G. Basile
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. Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2015-04-12udev: builtin-keyboard: invert a conditionPeter Hutterer
No functional changes, just to make the next patch easier to review Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2015-04-12udev: 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. Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2015-04-12udev: 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. Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2015-04-12udev: 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. Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2015-04-12test-libudev.c: remove deprecated functions.Anthony G. Basile
2015-04-12udev: input_id: tag accelerometers as ID_INPUT_ACCELEROMETERHans de Goede
input_id already (tries to) tag accelerometers as such, but this only works for absolute accelerometers. Recent kernels mark accelerometers through an input prop. Trust that prop and always tag devices with it with ID_INPUT_ACCELEROMETER. Note that detection by the prop bit works the same as the existing detection and will ensure that no other tags get set on the device. Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2015-04-12udev: input_id: tag pointing sticks as ID_INPUT_POINTINGSTICKAnthony G. Basile
Also referred to as trackpoint, trackstick. These are marked by recent kernels through an input prop. Forward that prop as udev property so userspace can easily determine whether there is a pointing stick present. These devices were previously marked as ID_INPUT_MOUSE, for backwards compatibility we keep that in place, the new property is an addition.y Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2015-04-12sd-device,udevd: fix spelling /ammend/amend/Tom Gundersen
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2015-04-12udev: net_id - improve commentsTom Gundersen
The dev_port concept is a bit confusing, expand on the comment a bit. Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2015-04-12udev: net_id - support multi-port enpo* device namesTom Gundersen
I'd argue that having firmware labels for such devices makes no sense, but they exist, so make sure we handle them as best as we can. Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2015-04-12udev: net_id - fix copy-paste errorTom Gundersen
In case pci_slot overflows we were truncating pci_path instead. Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2015-04-12cdrom_id: unroll and simplify data check loopHarald Hoyer
also removes this warning: src/udev/cdrom_id/cdrom_id.c: In function ‘cd_media_info.isra.13’: src/udev/cdrom_id/cdrom_id.c:612:12: warning: assuming signed overflow does not occur when assuming that (X + c) >= X is always true [-Wstrict-overflow] static int cd_media_info(struct udev *udev, int fd) ^ Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2015-04-12libudev-util: check length before accesing the arrayThomas Hindoe Paaboel Andersen
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2015-04-12skip libudev: device - replace by a thin wrapper around sd-deviceAnthony G. Basile
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2015-04-12libudev: monitor - improve loggingTom Gundersen
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2015-04-12Merge branch 'master' of github.com:gentoo/eudevAnthony G. Basile
2015-04-1250-udev-default.rules: don't run anything but REMOVE_CMD on removeHarald Hoyer
we don't want to run usb_id and input_id on ACTION=="remove" Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2015-04-12rules: storage - support MemoryStick (non-Pro) cardsMantas Mikulėnas
These are handled by a different driver than MemoryStick Pro. Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2015-04-12rules: storage - whitelist partitioned MS & MMC devicesKay Sievers
On Mon, Mar 23, 2015 at 8:55 AM, Mantas Mikulėnas <grawity@gmail.com> wrote: > On Tue, Mar 17, 2015 at 11:50 PM, Kay Sievers <kay@vrfy.org> wrote: >> On Tue, Mar 17, 2015 at 5:00 PM, Mantas Mikulėnas <grawity@gmail.com> >> wrote: >> > Accidentally dropped in 1aff20687f4868575. >> > --- >> > rules/60-persistent-storage.rules | 2 +- >> > 1 file changed, 1 insertion(+), 1 deletion(-) >> >> > +KERNEL!="loop*|mmcblk[0-9]*|mspblk[0-9]*|nvme*|sd*|sr*|vd*", >> > GOTO="persistent_storage_end" >> >> We can't do that, we need to ignore the mmc*rpmb devices: >> >> http://cgit.freedesktop.org/systemd/systemd/commit/?id=b87b01cf83947f467f3c46d9831cd67955fc46b9 >> >> Maybe "mmcblk*[0-9]" will work? > > Yeah, that would probably work (the names are like mmcblk0p1 etc.) Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2015-04-12rules: storage - don't apply rules to remove eventsTom Gundersen
This line was accidentally lost in 52346b5f5424. Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2015-04-12rules: avoid 'device/' accessesDavid Herrmann
We should never access parents, as the sysfs hierarchy is in no way stable. Use KERNELS== etc. to match on a parent, then access it via $attr{} (which accesses the matching device, not the current device). Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2015-04-12rules: fix input-name for keyboard rulesDavid Herrmann
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-12hwdb: mouse DPI data, Roccat Lua (ROC-11-310)Blaž Tomažič
https://bugs.freedesktop.org/show_bug.cgi?id=89743 Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2015-04-12hwdb: Update database of Bluetooth company identifiersMarcel Holtmann
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2015-04-12hwdb: add HP ProBook 450G0Zbigniew Jędrzejewski-Szmek
https://bugs.freedesktop.org/show_bug.cgi?id=89684 Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2015-04-09Merge pull request #113 from yann-morin-1998/yem/legacy-gccblueness
Revert "udev: rules - modernise add_rule a bit"
2015-04-04Revert "udev: rules - modernise add_rule a bit"Yann E. MORIN
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 5cb98078479d93e25099c1cb73fa9c46aa9ccf29. Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr> Cc: Tom Gundersen <teg@jklm.no>
2015-03-27Remove hardcoded path /run and configure using --with-rootrundir=David Cortarello
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2015-03-19configure.ac: update udev version to 219.Anthony G. Basile
2015-03-19src/libudev/Makefile.am: bump libudev revision to 2Anthony G. Basile
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2015-03-19shared: add path_compare(), an ordering path comparisonMichal Schmidt
... and make path_equal() a simple wrapper around it. Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2015-03-19sysctl: move property handling to shared/Kay Sievers
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2015-03-18libudev: private - introduce udev_device_new_from_synthetic_event()Tom Gundersen
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-18libudev-monitor: use initializationZbigniew Jędrzejewski-Szmek
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2015-03-18selinux: fix SEGV during switch-root if SELinux policy loadedWill Woods
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-18Check that EWOULDBLOCK is the same as EAGAINZbigniew Jędrzejewski-Szmek
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-18Replace ENOTSUP with EOPNOTSUPPAnthony G. Basile
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2015-03-18udev-ctrl: fix strict aliasing issuesShawn Landden
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-18udev: downgrade "has devpath" and "filled with db file" messagesZbigniew Jędrzejewski-Szmek
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-18udev: properly calculate size of remaining dataZbigniew Jędrzejewski-Szmek
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>