summaryrefslogtreecommitdiff
path: root/src/udev
AgeCommit message (Collapse)Author
2015-02-11src/udev/udev-builtin-kmod.c: remove the modprobe alt to kmod codeAnthony G. Basile
2015-02-11src/udev/udevd.c: remove create static nodes from modulesAnthony G. Basile
2015-02-11Minor cleanupsAnthony G. Basile
2015-02-11udev: event - move renaming of udev_device to libudevTom Gundersen
This is not exposed in the public API. We want to simplify the internal libudev-device API as much as possible so that it will be simpler to rip the whole thing out in the future. Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2015-02-11rule_generator: remove legacy codeAnthony G. Basile
2015-02-08util: rework strappenda(), and rename it strjoina()Lennart Poettering
After all it is now much more like strjoin() than strappend(). At the same time, add support for NULL sentinels, even if they are normally not necessary. Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2015-02-08udev: event - minor nitTom Gundersen
Stay uniform and use 'dev' rather than 'event->dev', as these are aliases (and event->dev looks like it may be a typo for event->dev_db). Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2015-02-08udev: event - introduce and use internal udev_device_shallow_clone()Tom Gundersen
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2015-01-25Assorted format fixesZbigniew Jędrzejewski-Szmek
Types used for pids and uids in various interfaces are unpredictable. Too bad. Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2015-01-17src/udev/Makefile.am: fix build wrt udev-builtin-evdev_id.cAnthony G. Basile
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2015-01-17udev: merge evdev_id into input_idDavid Herrmann
There is no reason to keep both separated. We want to avoid API specific tools and instead keep generic terms like 'input'. Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2015-01-17udev: fix NULL-ptr derefDavid Herrmann
Make sure we properly validate the return value of udev_device_get_sysattr_value(). It might be NULL for several reasons. Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2015-01-17udev: Add builtin/rule to export evdev information as udev propertiesCarlos Garnacho
This rule is only run on tablet/touchscreen devices, and extracts their size in millimeters, as it can be found out through their struct input_absinfo. The first usecase is exporting device size from tablets/touchscreens. This may be useful to separate policy and application at the time of mapping these devices to the available outputs in windowing environments that don't offer that information as readily (eg. Wayland). This way the compositor can stay deterministic, and the mix-and-match heuristics are performed outside. Conceivably, size/resolution information can be changed through EVIOCSABS anywhere else, but we're only interested in values prior to any calibration, this rule is thus only run on "add", and no tracking of changes is performed. This should only remain a problem if calibration were automatically applied by an earlier udev rule (read: don't). v2: Folded rationale into commit log, made a builtin, set properties on device nodes themselves v3: Use inline function instead of macro for mm. size calculation, use DECIMAL_STR_MAX, other code style issues v4: Made rule more selective v5: Minor style issues, renamed to a more generic builtin, refined rule further. Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2015-01-17udev: make use of new one_zero() helper where appropriateLennart Poettering
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2015-01-17udevadm: don't hit an assert when obsolete parameters are passedLennart Poettering
https://bugzilla.redhat.com/show_bug.cgi?id=1178051 Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2015-01-07udevadm,..: make --help output of udev tools more like the output of the ↵Lennart Poettering
various other tools Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2014-12-29util: fix strict aliasing violations in use of struct inotify_event v5Shawn Paul Landden
There is alot of cleanup that will have to happen to turn on -fstrict-aliasing, but I think our code should be "correct" to the rule. Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2014-12-17blkid: Warn when rejecting a superblock with a bad csumGabriel de Perthuis
Bump libblkid requirement from 2.20 to 2.24. util-linux 2.25 is actually required since fdbbad981cc5da8bb4ed7e9b6646e7a114745ec5 Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2014-12-17udev-builtin-btrfs: properly initialize ioctl struct to zeroesLennart Poettering
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2014-12-11core: unify how we iterate over inotify eventsLennart Poettering
Let's add some syntactic sugar for iterating through inotify events, and use it everywhere. Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2014-12-11treewide: correct spacing near eol in code commentsTorstein Husebø
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2014-12-04udevd: SAS: use SAS addr + PHY id in by-path whenever possible.Maurizio Lombardi
This patch changes the naming scheme for sas disks. The original names used disk's sas address and lun, the new scheme uses sas address of the nearest expander (if available) and a phy id of the used connection. If no expander is used, the phy id of hba phy is used. Note that names that refer to RAID or other abstract devices are unchanged. Name in raid configuration: hba_pci_address-sas-raid_sas_address-lunY-partZ Name in expander bare disk configuration: hba_pci_address-sas-expander_sas_address-phyX-lunY-partZ Name format without expanders: hba_pci_address-sas-phyX-lunY-partZ Signed-off-by: Maurizio Lombardi <mlombard@redhat.com> Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2014-12-01udev: strings in C are NUL-terminated anyway, no need to add a second NUL...Lennart Poettering
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2014-12-01udev: rules - ignore the lack of trailing newlineTom Gundersen
Also accept '\r' as newline character. This dropps warnings of the type: invalid key/value pair in file /usr/lib/udev/rules.d/40-usb-media-players.rules on line 26, starting at character 25 ('') Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2014-12-01udev: rules - print the first invalid characterTom Gundersen
The current code would print the character following the first invalid character. Given an udev rules-file without a trailing newline we would otherwise print garbage: invalid key/value pair in file /usr/lib/udev/rules.d/40-usb-media-players.rules on line 26, starting at character 25 ('m') This is now changed to print invalid key/value pair in file /usr/lib/udev/rules.d/40-usb-media-players.rules on line 26, starting at character 25 ('') (still not very good as printing \0 just gives the empty string) Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2014-12-01udev: rules - modernise add_rule a bitTom Gundersen
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2014-12-01udevadm hwdb: discard extra leading whitespaces in hwdbPeter Hutterer
Currently a property in the form of FOO=bar is stored as " FOO=bar", i.e. the property name contains a leading space. That's quite hard to spot. This patch discards all extra whitespaces but the first one which is required by libudev's hwdb_add_property. [zj: modify the check a bit] https://bugs.freedesktop.org/show_bug.cgi?id=82311 Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2014-12-01treewide: another round of simplificationsMichal Schmidt
Using the same scripts as in f647962d64e "treewide: yet more log_*_errno + return simplifications". Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2014-12-01treewide: use log_*_errno whenever %m is in the format stringMichal Schmidt
If the format string contains %m, clearly errno must have a meaningful value, so we might as well use log_*_errno to have ERRNO= logged. Using: find . -name '*.[ch]' | xargs sed -r -i -e \ 's/log_(debug|info|notice|warning|error|emergency)\((".*%m.*")/log_\1_errno(errno, \2/' Plus some whitespace, linewrap, and indent adjustments. Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2014-11-30treewide: drop unnecessary trailing \n in log_*() callsMichal Schmidt
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2014-11-28treewide: more log_*_errno() conversionsMichal Schmidt
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2014-11-28treewide: no need to negate errno for log_*_errno()Michal Schmidt
It corrrectly handles both positive and negative errno values. Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2014-11-28treewide: auto-convert the simple cases to log_*_errno()Michal Schmidt
As a followup to 086891e5c1 "log: add an "error" parameter to all low-level logging calls and intrdouce log_error_errno() as log calls that take error numbers", use sed to convert the simple cases to use the new macros: find . -name '*.[ch]' | xargs sed -r -i -e \ 's/log_(debug|info|notice|warning|error|emergency)\("(.*)%s"(.*), strerror\(-([a-zA-Z_]+)\)\);/log_\1_errno(-\4, "\2%m"\3);/' Multi-line log_*() invocations are not covered. And we also should add log_unit_*_errno(). Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2014-11-28log: rearrange log function namingLennart Poettering
- Rename log_meta() → log_internal(), to follow naming scheme of most other log functions that are usually invoked through macros, but never directly. - Rename log_info_object() to log_object_info(), simply because the object should be before any other parameters, to follow OO-style programming style. Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2014-11-28log: add an "error" parameter to all low-level logging calls and intrdouce ↵Lennart Poettering
log_error_errno() as log calls that take error numbers This change has two benefits: - The format string %m will now resolve to the specified error (or to errno if the specified error is 0. This allows getting rid of a ton of strerror() invocations, a function that is not thread-safe. - The specified error can be passed to the journal in the ERRNO= field. Now of course, we just need somebody to convert all cases of this: log_error("Something happened: %s", strerror(-r)); into thus: log_error_errno(-r, "Something happened: %m"); Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2014-11-28udevadm trigger: allow matching by device nameZbigniew Jędrzejewski-Szmek
This makes udevadm trigger mirror udevadm info, except that multiple device names can be specified. Instructions in 60-keyboard.hwdb should now actually work. udevadm(8) is updated, but it could use a bit more polishing. https://bugs.freedesktop.org/show_bug.cgi?id=82311 Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2014-11-28udevadm: split out find_device helperZbigniew Jędrzejewski-Szmek
The idea is to unify the way that devices can be specified. Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2014-11-16src/udev: update the definition of udev_event_execute_ruleAnthony G. Basile
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2014-11-14udev: move global property handling from libudev to udevdKay Sievers
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2014-11-14udev: switch to systemd logging functionsKay Sievers
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2014-11-14udev: use properly the systemd logging functionsRonny Chevalier
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2014-11-14udev: use the systemd logging functions in udev toolsKay Sievers
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2014-11-07util: simplify proc_cmdline() to reuse get_process_cmdline()Lennart Poettering
Also, make all parsing of the kernel cmdline non-fatal. Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2014-11-07s/commandline/command line/gHarald Hoyer
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2014-11-07udev: avoid magic constants in kernel-cmdline parsersDavid Herrmann
Lets recognize the fact that startswith() returns a pointer to the tail on success. Use it instead of hard-coding string-lengths as magic constants. Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2014-11-07udev: Fix parsing of udev.event-timeout kernel parameter.Richard W.M. Jones
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2014-10-31src/udev/udev-node.c: fix selinux labelAnthony G. Basile
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2014-10-30udev: path_id - update commentsKay Sievers
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2014-10-28udev: path_id - set supported_parent for well-known SCSI setupsKay Sievers
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2014-10-25src/udev/udevd.c: rename apis again in static_dev_create_from_modules()Anthony G. Basile
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>