summaryrefslogtreecommitdiffstats
path: root/src/udev/udev-builtin.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
* udev: pass rtnl to builtin commandsYu Watanabe2021-08-311-2/+2
|
* license: LGPL-2.1+ -> LGPL-2.1-or-laterYu Watanabe2020-11-091-1/+1
|
* udev: fix indentationYu Watanabe2020-09-101-2/+1
| | | | Follow-up for 90e30d767a32dc93c9ee94ad8b8d665eecf79e96.
* Rename strv_split_extract() to strv_split_full()Zbigniew Jędrzejewski-Szmek2020-09-091-1/+1
| | | | | Now that _full() is gone, we can rename _extract() to have the usual suffix we use for the more featureful version.
* tree-wide: replace strv_split_full() with strv_split_extract() everywhereZbigniew Jędrzejewski-Szmek2020-09-091-3/+5
| | | | | | | | | | | | Behaviour is not identical, as shown by the tests in test-strv. The combination of EXTRACT_UNQUOTE without EXTRACT_RELAX only appears in the test, so it doesn't seem particularly important. OTOH, the difference in handling of squished parameters could make a difference. New behaviour is what both bash and python do, so I think we can ignore this corner case. This change has the following advantages: - the duplication of code paths that do a very similar thing is removed - extract_one_word() / strv_split_extract() return a proper error code.
* tree-wide: drop string.h when string-util.h or friends are includedYu Watanabe2019-11-031-1/+0
|
* udev: modernize udev-rules.cYu Watanabe2019-06-021-6/+6
| | | | | | | | | | | This does the following: - rename enum udev_builtin_cmd -> UdevBuiltinCmd - rename struct udev_builtin -> UdevBuiltin - move type definitions to udev-rules.h - move prototypes of functions defined in udev-rules.c to udev-rules.h - drop to use strbuf - propagate critical errors in applying rules, - drop limitation for number of tokens per line.
* tree-wide: constify a few static string tablesLennart Poettering2019-03-251-1/+1
|
* udev: 'val' may be NULL, use strempty()Yu Watanabe2019-01-161-1/+1
|
* udev: logs error in udev_builtin_add_property()Yu Watanabe2018-10-231-1/+4
|
* udev-builtin: modernize code a bitYu Watanabe2018-10-231-7/+19
| | | | | | - introduce _UDEV_BUILTIN_INVALID, - use _UDEV_BUILTIN_MAX where applicable, - add several assertions.
* udev: make udev_builtin_run take sd_deviceYu Watanabe2018-10-231-3/+2
|
* udev-builtin: simplify code a bitYu Watanabe2018-10-231-7/+6
|
* udev: replace udev_device by sd_device from prototype of udev builtin commandsYu Watanabe2018-10-231-1/+2
|
* udev: make udev_builtin_add_property() take sd_device instead of udev_deviceYu Watanabe2018-10-231-3/+8
|
* tree-wide: replace 'unsigned int' with 'unsigned'Yu Watanabe2018-10-191-4/+4
|
* udev-builtin: move definitions related to builtin commands to udev-builtin.hYu Watanabe2018-10-101-0/+1
|
* udev-builtin: replace udev_build_argv() by strv_split_extract()Yu Watanabe2018-09-261-6/+6
|
* udev: drop unused udev structYu Watanabe2018-09-101-8/+8
|
* tree-wide: drop copyright headers from frequent contributorsZbigniew Jędrzejewski-Szmek2018-06-201-3/+0
| | | | | | | | Fixes #9320. for p in Shapovalov Chevalier Rozhkov Sievers Mack Herrmann Schmidt Rudenberg Sahani Landden Andersen Watanabe; do git grep -e 'Copyright.*'$p -l|xargs perl -i -0pe 's|/([*][*])?[*]\s+([*#]\s+)?Copyright[^\n]*'$p'[^\n]*\s*[*]([*][*])?/\n*|\n|gms; s|\s+([*#]\s+)?Copyright[^\n]*'$p'[^\n]*\n*|\n|gms' done
* tree-wide: beautify remaining copyright statementsLennart Poettering2018-06-141-1/+1
| | | | | | Let's unify an beautify our remaining copyright statements, with a unicode ©. This means our copyright statements are now always formatted the same way. Yay.
* tree-wide: drop 'This file is part of systemd' blurbLennart Poettering2018-06-141-2/+0
| | | | | | | | | | | | | | | | This part of the copyright blurb stems from the GPL use recommendations: https://www.gnu.org/licenses/gpl-howto.en.html The concept appears to originate in times where version control was per file, instead of per tree, and was a way to glue the files together. Ultimately, we nowadays don't live in that world anymore, and this information is entirely useless anyway, as people are very welcome to copy these files into any projects they like, and they shouldn't have to change bits that are part of our copyright header for that. hence, let's just get rid of this old cruft, and shorten our codebase a bit.
* tree-wide: drop license boilerplateZbigniew Jędrzejewski-Szmek2018-04-061-13/+0
| | | | | | | | | | Files which are installed as-is (any .service and other unit files, .conf files, .policy files, etc), are left as is. My assumption is that SPDX identifiers are not yet that well known, so it's better to retain the extended header to avoid any doubt. I also kept any copyright lines. We can probably remove them, but it'd nice to obtain explicit acks from all involved authors before doing that.
* Add SPDX license identifiers to source files under the LGPLZbigniew Jędrzejewski-Szmek2017-11-191-0/+1
| | | | | This follows what the kernel is doing, c.f. https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=5fd54ace4721fc5ce2bb5aef6318fcf17f421460.
* build-sys: use #if Y instead of #ifdef Y everywhereZbigniew Jędrzejewski-Szmek2017-10-041-3/+3
| | | | | | | | | | | | | | | The advantage is that is the name is mispellt, cpp will warn us. $ git grep -Ee "conf.set\('(HAVE|ENABLE)_" -l|xargs sed -r -i "s/conf.set\('(HAVE|ENABLE)_/conf.set10('\1_/" $ git grep -Ee '#ifn?def (HAVE|ENABLE)' -l|xargs sed -r -i 's/#ifdef (HAVE|ENABLE)/#if \1/; s/#ifndef (HAVE|ENABLE)/#if ! \1/;' $ git grep -Ee 'if.*defined\(HAVE' -l|xargs sed -i -r 's/defined\((HAVE_[A-Z0-9_]*)\)/\1/g' $ git grep -Ee 'if.*defined\(ENABLE' -l|xargs sed -i -r 's/defined\((ENABLE_[A-Z0-9_]*)\)/\1/g' + manual changes to meson.build squash! build-sys: use #if Y instead of #ifdef Y everywhere v2: - fix incorrect setting of HAVE_LIBIDN2
* tree-wide: remove Emacs lines from all filesDaniel Mack2016-02-101-2/+0
| | | | | This should be handled fine now by .dir-locals.el, so need to carry that stuff in every file.
* udev: add emacs header lineZbigniew Jędrzejewski-Szmek2015-12-071-0/+2
| | | | | Otherwise emacs wants to use 2-space indentation and other attrocities.
* util-lib: split our string related calls from util.[ch] into its own file ↵Lennart Poettering2015-10-241-1/+2
| | | | | | | | | | | | | | string-util.[ch] There are more than enough calls doing string manipulations to deserve its own files, hence do something about it. This patch also sorts the #include blocks of all files that needed to be updated, according to the sorting suggestions from CODING_STYLE. Since pretty much every file needs our string manipulation functions this effectively means that most files have sorted #include blocks now. Also touches a few unrelated include files.
* udev: Fix udev_builtin_run_once()Daniel Mack2015-07-281-1/+1
| | | | | Honour the boolean return value type. This was an oversight in f89d10ae4.
* udev: check more builtins[] pointers before dereferencingDaniel Mack2015-07-281-0/+9
| | | | | Fix some more locations where pointers from builtins[] are dereferenced before checking. Related to 8cacf69b1.
* udev: avoid coredump when initializing udev builtinsLidong Zhong2015-07-281-5/+6
| | | | | If one of the macros(HAVE_BLKID/HAVE_KMOD/HAVE_ACL) is not defined, there will be a coredump
* libudev: add missing hunksTom Gundersen2015-03-091-6/+1
| | | | | This should have been committed with udev_device_add_property - implicitly mark properties for saving to db
* remove unused includesThomas Hindoe Paaboel Andersen2015-02-231-4/+0
| | | | | | This patch removes includes that are not used. The removals were found with include-what-you-use which checks if any of the symbols from a header is in use.
* udev: merge evdev_id into input_idDavid Herrmann2015-01-151-1/+0
| | | | | There is no reason to keep both separated. We want to avoid API specific tools and instead keep generic terms like 'input'.
* udev: Add builtin/rule to export evdev information as udev propertiesCarlos Garnacho2015-01-121-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | 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.
* udevadm,..: make --help output of udev tools more like the output of the ↵Lennart Poettering2015-01-051-1/+1
| | | | various other tools
* udev: remove userspace firmware loading supportKay Sievers2014-08-301-3/+0
|
* udev: place opening { at the same line as the function declarationKay Sievers2014-07-291-18/+9
|
* udev: builtin - rename net_link to net_setup_linkTom Gundersen2013-10-291-1/+1
| | | | Also add shell completions.
* udev: add network link configuration toolTom Gundersen2013-10-261-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This tool applies hardware specific settings to network devices before they are announced via libudev. Settings that will probably eventually be supported are MTU, Speed, DuplexMode, WakeOnLan, MACAddress, MACAddressPolicy (e.g., 'hardware', 'synthetic' or 'random'), Name and NamePolicy (replacing our current interface naming logic). This patch only introduces support for Description, as a proof of concept. Some of these settings may later be overriden by a network management daemon/script. However, these tools should always listen and wait on libudev before touching a device (listening on netlink is not enough). This is no different from how things used to be, as we always supported changing the network interface name from udev rules, which does not work if someone has already started using it. The tool is configured by .link files in /etc/net/links/ (with the usual overriding logic in /run and /lib). The first (in lexicographical order) matching .link file is applied to a given device, and all others are ignored. The .link files contain a [Match] section with (currently) the keys MACAddress, Driver, Type (see DEVTYPE in udevadm info) and Path (this matches on the stable device path as exposed as ID_PATH, and not the unstable DEVPATH). A .link file matches a given device if all of the specified keys do. Currently the keys are treated as plain strings, but some limited globbing may later be added to the keys where it makes sense. Example: /etc/net/links/50-wireless.link [Match] MACAddress=98:f2:e4:42:c6:92 Path=pci-0000:02:00.0-bcma-0 Type=wlan [Link] Description=The wireless link
* udev: add builtin 'keyboard' to manage key mappingsKay Sievers2013-07-101-0/+1
|
* build-sys: fix HAVE/ENABLE_FIRMWAREKay Sievers2013-03-281-1/+1
| | | | https://bugs.freedesktop.org/show_bug.cgi?id=62864
* udev: make firmware loading optional and disable by defaultTom Gundersen2013-03-181-0/+2
| | | | | | Distros that whish to support old kernels should set --with-firmware-dirs="/usr/lib/firmware/updates:/usr/lib/firmware" to retain the old behaviour.
* use streq instead of strcmpThomas Hindoe Paaboel Andersen2013-02-131-1/+1
|
* udev: move string copy functions to shared/Kay Sievers2013-01-091-2/+2
|
* build-sys: make loadable module support optionalTom Gundersen2012-11-201-0/+2
| | | | | kmod is unecessary if loadable module support is disabled in the kernel, so make the dependency optional.
* udev: make blkid optionalAnders Olofsson2012-11-161-0/+2
| | | | | | I'm building systemd for an embedded system and we would prefer not having to include the entire util-linux package just to get a libblkid whose functionality we don't need.
* udev: net_id - add builtin to retrieve data for network devicesKay Sievers2012-11-091-0/+1
|
* udev: update file headersKay Sievers2012-11-091-16/+18
|
* udev: builtin - do not fail builtin initialization if one of them returns an ↵Kay Sievers2012-10-261-16/+8
| | | | error