summaryrefslogtreecommitdiff
path: root/src/udev
AgeCommit message (Collapse)Author
2016-10-22tree-wide: make parse_proc_cmdline() strip "rd." prefix automaticallyZbigniew Jędrzejewski-Szmek
This stripping is contolled by a new boolean parameter. When the parameter is true, it means that the caller does not care about the distinction between initrd and real root, and wants to act on both rd-dot-prefixed and unprefixed parameters in the initramfs, and only on the unprefixed parameters in real root. If the parameter is false, behaviour is the same as before. Changes by caller: log.c (systemd.log_*): changed to accept rd-dot-prefix params pid1: no change, custom logic cryptsetup-generator: no change, still accepts rd-dot-prefix params debug-generator: no change, does not accept rd-dot-prefix params fsck: changed to accept rd-dot-prefix params fstab-generator: no change, custom logic gpt-auto-generator: no change, custom logic hibernate-resume-generator: no change, does not accept rd-dot-prefix params journald: changed to accept rd-dot-prefix params modules-load: no change, still accepts rd-dot-prefix params quote-check: no change, does not accept rd-dot-prefix params udevd: no change, still accepts rd-dot-prefix params I added support for "rd." params in the three cases where I think it's useful: logging, fsck options, journald forwarding options.
2016-10-22udev: change kernel commandline option parsingZbigniew Jędrzejewski-Szmek
- do not crash if an option without value is specified on the kernel command line, e.g. "udev.log-priority" :P - simplify the code a bit - warn about unknown "udev.*" options — this should make it easier to spot typos and reduce user confusion
2016-10-22tree-wide: allow state to be passed through to parse_proc_cmdline_itemZbigniew Jędrzejewski-Szmek
No functional change.
2016-10-16tree-wide: use mfree moreZbigniew Jędrzejewski-Szmek
2016-10-11udevadm: use parse_sec instead of atoi for timeout option (#4331)Stefan Schweter
log_error method is used instead of fprintf
2016-10-10tree-wide: pass return value of make_null_stdio() to warning instead of ↵0xAX
errno (#4328) as @poettering suggested in the #4320
2016-10-09tree-wide: print warning in a failure case of make_null_stdio() (#4320)0xAX
The make_null_stdio() may fail. Let's check its result and print warning message instead of keeping silence.
2016-10-06sd-device/networkd: unify code to get a socket for issuing netdev ioctls onLennart Poettering
As suggested here: https://github.com/systemd/systemd/pull/4296#issuecomment-251911349 Let's try AF_INET first as socket, but let's fall back to AF_NETLINK, so that we can use a protocol-independent socket here if possible. This has the benefit that our code will still work even if AF_INET/AF_INET6 is made unavailable (for exmple via seccomp), at least on current kernels.
2016-09-26udev/path_id: introduce support for NVMe devices (#4169)Keith Busch
This appends the nvme name and namespace identifier attribute the the PCI path for by-path links. Symlinks like the following are now present: lrwxrwxrwx. 1 root root 13 Sep 16 12:12 pci-0000:01:00.0-nvme-1 -> ../../nvme0n1 lrwxrwxrwx. 1 root root 15 Sep 16 12:12 pci-0000:01:00.0-nvme-1-part1 -> ../../nvme0n1p1 Cc: Michal Sekletar <sekletar.m@gmail.com> Signed-off-by: Keith Busch <keith.busch@intel.com>
2016-09-13udev: use get_proc_cmdline_key instead of FOREACH_WORD_QUOTEDZbigniew Jędrzejewski-Szmek
2016-09-02fix #4080Susant Sahani
ethtool_sset_info adding some extra space to it. also fix valgrind warning ``` Unloaded link configuration context. ==31690== ==31690== HEAP SUMMARY: ==31690== in use at exit: 8,192 bytes in 2 blocks ==31690== total heap usage: 431 allocs, 429 frees, 321,164 bytes allocated ==31690== ==31690== 4,096 bytes in 1 blocks are still reachable in loss record 1 of 2 ==31690== at 0x4C2BBAD: malloc (vg_replace_malloc.c:299) ==31690== by 0x166B32: mempool_alloc_tile (mempool.c:62) ==31690== by 0x166BBC: mempool_alloc0_tile (mempool.c:81) ==31690== by 0x15B8FC: hashmap_base_new (hashmap.c:732) ==31690== by 0x15B9F7: internal_hashmap_new (hashmap.c:766) ==31690== by 0x151291: conf_files_list_strv_internal (conf-files.c:103) ==31690== by 0x1514BA: conf_files_list_strv (conf-files.c:135) ==31690== by 0x13A1CF: link_config_load (link-config.c:227) ==31690== by 0x135B68: builtin_net_setup_link_init (udev-builtin-net_setup_link.c:77) ==31690== by 0x1306B3: udev_builtin_init (udev-builtin.c:57) ==31690== by 0x11E984: adm_builtin (udevadm-test-builtin.c:72) ==31690== by 0x117B4D: run_command (udevadm.c:75) ``` Fixes #4080
2016-08-31link : add support to configure LRO and GRO Offload featuresSusant Sahani
The patch supports to configure GenericReceiveOffload LargeReceiveOffload
2016-08-30link : add support to configure Offload features (#4017)Susant Sahani
This patch supports these features to be on or off Generic Segmentation Offload TCP Segmentation Offload UDP Segmentation Offload fixes #432
2016-08-25udev: inform systemd how many workers we can potentially spawn (#4036)Michal Sekletar
2016-07-20core: when forcibly killing/aborting left-over unit processes log about itLennart Poettering
Let's lot at LOG_NOTICE about any processes that we are going to SIGKILL/SIGABRT because clean termination of them didn't work. This turns the various boolean flag parameters to cg_kill(), cg_migrate() and related calls into a single binary flags parameter, simply because the function now gained even more parameters and the parameter listed shouldn't get too long. Logging for killing processes is done either when the kill signal is SIGABRT or SIGKILL, or on explicit request if KILL_TERMINATE_AND_LOG instead of LOG_TERMINATE is passed. This isn't used yet in this patch, but is made use of in a later patch.
2016-07-15udev: Line buffer 'udev monitor' output (#3733)Stef Walter
Callers of the 'udev monitor' tool expect to see output when an event occurs. The stdio buffering defeats that. This patch switches it to line buffering.
2016-07-14Fix tablet detection, by replicating decision tree of non-multi-touch axes ↵Andreas Pokorny
(#3724) Signed-off-by: Andreas Pokorny <andreas.pokorny@canonical.com>
2016-07-11treewide: fix typos and remove accidental repetition of wordsTorstein Husebø
2016-07-08udevadm: explicitly relabel /etc/udev/hwdb.bin after rename (#3686)Michal Sekletar
This is basically the same change as ea68351.
2016-06-14udevadm: trivial simplificationZbigniew Jędrzejewski-Szmek
2016-06-09udev-builtin-blkid: fix GPT_FLAG_NO_AUTO check for ESP (#3450)Lennart Poettering
The flags check was accidentally placed in the ESP if block, but should be in the root if block. This corrects: 0238d4c660e732dd03ba0cdb54a29ec5870ee849 Fixes: #3440 Also see: #3441
2016-05-30udevd: try close ctrl connection blocking socket only once when spawning a ↵Franck Bui
new worker (#3387)
2016-05-24Udevadm trivial cleanups (#3331)Zbigniew Jędrzejewski-Szmek
* udevadm-info: use _cleanup_ * udevadm-info: propagate return value from export_devices() * sd-device: add comment and remove unnecessary braces
2016-05-05tree-wide: introduce new SOCKADDR_UN_LEN() macro, and use it everywhereLennart Poettering
The macro determines the right length of a AF_UNIX "struct sockaddr_un" to pass to connect() or bind(). It automatically figures out if the socket refers to an abstract namespace socket, or a socket in the file system, and properly handles the full length of the path field. This macro is not only safer, but also simpler to use, than the usual offsetof() + strlen() logic.
2016-05-03udev: fix build with DEBUG=1Lubomir Rintel
Alternatively, this could perhaps be removed since it was broken for a long time and noone seemed to care. But it was helpful for me today.
2016-04-21tree-wide: use mdash instead of a two minusesZbigniew Jędrzejewski-Szmek
2016-04-08udevadm: assert return valueZbigniew Jędrzejewski-Szmek
This mirrors what we do in now(). CID #1351755.
2016-04-08udevd: use (void) to silence coverityZbigniew Jędrzejewski-Szmek
CID #1351429.
2016-03-14include sys/sysmacros.h in more placesMike Frysinger
Since glibc is moving away from implicitly including sys/sysmacros.h all the time via sys/types.h, include the header directly in more places. This seems to cover most makedev/major/minor usage.
2016-03-01selinux: always try to load the full selinux dbZbigniew Jędrzejewski-Szmek
https://github.com/systemd/systemd/pull/2508#issuecomment-190901170 Maybe fixes https://bugzilla.redhat.com/show_bug.cgi?id=1308771.
2016-02-23tree-wide: minor formatting inconsistency cleanupsVito Caputo
2016-02-22Merge pull request #2701 from keszybz/udev-rulesLennart Poettering
udev-rules cleanup fix
2016-02-22udev-rules: fix querying of attributesZbigniew Jędrzejewski-Szmek
faccessat returns 0 on success. A cosmetic fix is also included: the slash was doubled unnecessarily.
2016-02-22Merge pull request #2685 from poettering/lldp-fixes2Tom Gundersen
lldp fixes, second iteration
2016-02-21udev-rules: use _cleanup_ for fcloseZbigniew Jędrzejewski-Szmek
2016-02-21udev-rules: make error messages about rules more uniformZbigniew Jędrzejewski-Szmek
Also downgrade non-fatal warnings to log_warning. Previously rule_add_key() would check the output array and log a cryptic error and return -1. Most of the time the return value was ignored. This does not seems right, because the buffer can overflow with enough rules. It would also check if we have enough space for the *next* rule, even if there might be not next rule, i.e. off-by-one. Replace this with a check that we have enough space for a next rule before we start parsing. Normally using macros to alter flow is not allowed, but in this case I think it is worth it, because it allows lots of boilerplate code to be removed and hides repeated boring parameters, making function logic much easier to follow.
2016-02-21udev-rules: rewrite function to avoid clobbering argumentsZbigniew Jędrzejewski-Szmek
If the attribute wasn't found, the last filename looked at was returned in the input/output argument. This just seems bad style. The return value was ignored, so change function to return void.
2016-02-21udev-rules: modernize syntax a bitZbigniew Jędrzejewski-Szmek
2016-02-21udev-rules: log_oom() on memory error and abort processing of eventZbigniew Jędrzejewski-Szmek
CID #1313566. Also, change the return value to void, because it is ignored anyway.
2016-02-20tree-wide: place #pragma once at the same place everywhereLennart Poettering
Usually, we place the #pragma once before the copyright blurb in header files, but in a few cases we didn't. Move those around, so that we do the same thing everywhere.
2016-02-19udev/path_id: correct segmentation fault due to missing NULL checkHendrik Brueckner
Running "udevadm test-builtin path_id /sys/devices/platform/" results in a segmentation fault. The problem is that udev_device_get_subsystem(dev) might return NULL in a streq() call. Solve this problem by using streq_ptr() instead.
2016-02-18Remove/add (un)needed includesNathan McSween
2016-02-16udev: fix cg_unified() return code checkingLennart Poettering
Fixes fall-out from 8b3aa503c171acdb9ec63484a8c50e2680d31e79. Fixes: #2635
2016-02-10tree-wide: remove Emacs lines from all filesDaniel Mack
This should be handled fine now by .dir-locals.el, so need to carry that stuff in every file.
2016-02-09path_id: reintroduce by-path links for virtio block devicesMichal Sekletar
Enumeration of virtio buses is global and hence non-deterministic. However, we are guaranteed there is never going to be more than one virtio bus per parent PCI device. While populating ID_PATH we simply skip virtio part of the syspath and we extend the path using the sysname of the parent PCI device. With this patch udev creates following by-path links for virtio-blk device /dev/vda which contains two partitions. ls -l /dev/disk/by-path/ total 0 lrwxrwxrwx 1 root root 9 Feb 9 10:47 virtio-pci-0000:00:05.0 -> ../../vda lrwxrwxrwx 1 root root 10 Feb 9 10:47 virtio-pci-0000:00:05.0-part1 -> ../../vda1 lrwxrwxrwx 1 root root 10 Feb 9 10:47 virtio-pci-0000:00:05.0-part2 -> ../../vda2 See: http://lists.linuxfoundation.org/pipermail/virtualization/2015-August/030328.html Fixes #2501
2016-01-29udev: net_id - for ccw bus, shorten the identifier and stip leading zerosDimitri John Ledkov
The commmon case default qeth link is enccw0.0.0600 is rather long. Thus strip leading zeros (which doesn't make the bus_id unstable), similar to the PCI domain case. Also 'ccw' is redundant on S/390, as there aren't really other buses available which could have qeth driver interfaces. Not sure why this code is even compiled on non-s390[x] platforms. But to distinguish from e.g. MAC stable names shorten the suffix to just 'c'. Thus enccw0.0.0600 becomes enc600.
2016-01-25udev: filter out non-sensically high onboard indexes reported by the kernelLennart Poettering
Let's not accept onboard interface indexes, that are so high that they are obviously non-sensical. Fixes: #2407
2016-01-23udevd: do not clean up fds in mainZbigniew Jędrzejewski-Szmek
fds will also be closed during manager cleanup in run, leading to an error when we try to close them again. It is now possible to "leak" the fds on error, but it's an unlikely event and we will exit immediately anyway. Fixes #2418.
2016-01-18udevd: initialize fds to -1 and close them before exitingZbigniew Jędrzejewski-Szmek
Little change in practice, because the program will exit soon afterwards, but the standard style of closing all fds is now followed. Also gets rid of gcc warning about fd_ctrl and fd_uevent being unitialized.
2016-01-13tree-wide: check if errno is greater then zeroZbigniew Jędrzejewski-Szmek
gcc is confused by the common idiom of return errno ? -errno : -ESOMETHING and thinks a positive value may be returned. Replace this condition with errno > 0 to help gcc and avoid many spurious warnings. I filed a gcc rfe a long time ago, but it hard to say if it will ever be implemented [1]. Both conventions were used in the codebase, this change makes things more consistent. This is a follow up to bcb161b0230f. [1] https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61846