summaryrefslogtreecommitdiffstats
path: root/src/udev (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Merge pull request #32868 from keszybz/more-whomificationYu Watanabe2024-06-194-4/+4
|\ | | | | Fix confusion between killer and prey
| * various: move const ptr indicator to return valueZbigniew Jędrzejewski-Szmek2024-06-194-4/+4
| |
* | udev-spawn: fix typo and simplify codeAntonio Alvarez Feijoo2024-06-191-3/+2
|/ | | | Follow-up for 11706971e8b6aa289af56454330fffd87f5d5a78
* fs-util: add simple open_mkdir() wrapperLennart Poettering2024-06-152-2/+2
|
* libsystemd: turn json.[ch] into a public APILennart Poettering2024-06-121-13/+13
| | | | | | | | | | | | | | | This is preparation for making our Varlink API a public API. Since our Varlink API is built on top of our JSON API we need to make that public first (it's a nice API, but JSON APIs there are already enough, this is purely about the Varlink angle). I made most of the json.h APIs public, and just placed them in sd-json.h. Sometimes I wasn't so sure however, since the underlying data structures would have to be made public too. If in doubt I didn#t risk it, and moved the relevant API to src/libsystemd/sd-json/json-util.h instead (without any sd_* symbol prefixes). This is mostly a giant search/replace patch.
* udev: rewrite token_match_attr() to make it easier for Coverity to understandYu Watanabe2024-06-121-15/+16
| | | | | | No functional change. Closes CID#1469719.
* tree-wide: use LOG_PRI() and LOG_FAC()Yu Watanabe2024-05-121-1/+1
|
* udev-rules: pass the right error variableDavid Tardon2024-05-071-1/+1
|
* tree-wise: several cleanups for loggingYu Watanabe2024-04-304-10/+10
| | | | | | | | | | | - drop unnecessary SYNTHETIC_ERRNO() when the logger does not propagate error code, - drop unnecessary '%m' in error message when the error code is specified with SYNTHETIC_ERRNO(), - add missing full stop at the end of log message, - use RET_GATHER(), - add missing ", ignoring.", - upeercase the first letter, etc., etc...
* tree-wide: Use log_setup() everywhereDaan De Meyer2024-04-259-30/+14
| | | | | Otherwise the default log target is the console and we won't use the journal socket even if it is available.
* udev: fix assignment of ret_truncatedYu Watanabe2024-04-181-1/+2
| | | | Follow-ups for 089bef66316e5bdc91b9984148e5a6455449c1da.
* udevadm-control: add --load-credentials optionYu Watanabe2024-04-161-16/+35
| | | | | When specified, credentials udev.conf.* and udev.rules.* are copied to the corresponding directories.
* udevadm-control: split out send_control_commands()Yu Watanabe2024-04-161-10/+22
| | | | | No functional change, just refactoring and preparation for later commits.
* udevadm-control: check if control command really specifiedYu Watanabe2024-04-161-4/+15
| | | | | | Previously, 'udevadm control' only checked the number of the arguments. So, if only `--timeout` is specified, it spuriously did nothing and succeeded. This makes the command request at least one control command.
* tree-wide: make sure net/if.h is included before any linux/ headerFrantisek Sumsal2024-04-091-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The linux/ headers include linux/libc-compat.h that makes sure the linux/ headers won't redeclare symbols already declared by net/if.h, but glibc's net/if.h doesn't do that, so if the include order is reversed we'll end up with a bunch of errors about redeclared stuff: [3/519] Compiling C object test-network-tables.p/src_network_test-network-tables.c.o FAILED: test-network-tables.p/src_network_test-network-tables.c.o cc -Itest-network-tables.p -I. -I.. -Isrc/basic -I../src/basic -Isrc/fundamental -I../src/fundamental -Isrc/systemd -I../src/systemd -I../src/libsystemd/sd-bus -I../src/libsystemd/sd-device -I../src/libsystemd/sd-event -I../src/libsystemd/sd-hwdb -I../src/libsystemd/sd-id128 -I../src/libsystemd/sd-journal -I../src/libsystemd/sd-netlink -I../src/libsystemd/sd-network -I../src/libsystemd/sd-resolve -Isrc/shared -I../src/shared -Isrc/libsystemd-network -I../src/libsystemd-network -Isrc/network -I../src/network -I../src/network/netdev -I../src/network/tc -fdiagnostics-color=always -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -Wextra -std=gnu11 -O0 -g -Wno-missing-field-initializers -Wno-unused-parameter -Wno-nonnull-compare -Warray-bounds -Warray-bounds=2 -Wdate-time -Wendif-labels -Werror=format=2 -Werror=format-signedness -Werror=implicit-function-declaration -Werror=implicit-int -Werror=incompatible-pointer-types -Werror=int-conversion -Werror=missing-declarations -Werror=missing-prototypes -Werror=overflow -Werror=override-init -Werror=return-type -Werror=shift-count-overflow -Werror=shift-overflow=2 -Werror=strict-flex-arrays -Werror=undef -Wfloat-equal -Wimplicit-fallthrough=5 -Winit-self -Wlogical-op -Wmissing-include-dirs -Wmissing-noreturn -Wnested-externs -Wold-style-definition -Wpointer-arith -Wredundant-decls -Wshadow -Wstrict-aliasing=2 -Wstrict-prototypes -Wsuggest-attribute=noreturn -Wunused-function -Wwrite-strings -Wzero-length-bounds -fdiagnostics-show-option -fno-common -fstack-protector -fstack-protector-strong -fstrict-flex-arrays --param=ssp-buffer-size=4 -Wno-unused-result -Werror=shadow -fno-strict-aliasing -fstrict-flex-arrays=1 -fvisibility=hidden -fno-omit-frame-pointer -include config.h -pthread -DTEST_CODE=1 -MD -MQ test-network-tables.p/src_network_test-network-tables.c.o -MF test-network-tables.p/src_network_test-network-tables.c.o.d -o test-network-tables.p/src_network_test-network-tables.c.o -c ../src/network/test-network-tables.c In file included from ../src/basic/linux/if_bonding.h:47, from ../src/network/netdev/bond.h:5, from ../src/network/test-network-tables.c:3: ../src/basic/linux/if.h:111:41: error: redeclaration of enumerator ‘IFF_UP’ 111 | #define IFF_UP IFF_UP | ^~~~~~ ../src/basic/linux/if.h:84:9: note: previous definition of ‘IFF_UP’ with type ‘enum net_device_flags’ 84 | IFF_UP = 1<<0, /* sysfs */ | ^~~~~~ ../src/basic/linux/if.h:112:41: error: redeclaration of enumerator ‘IFF_BROADCAST’ 112 | #define IFF_BROADCAST IFF_BROADCAST | ^~~~~~~~~~~~~ ... This also drops remaining workarounds from the last time this issue was brought up (6f270e6bd8) since they shouldn't be needed anymore if the order of the includes is the "correct" one. I also added a comment to each affected include when this is inevitably encountered again in the future. Resolves: #32160
* tree-wide: drop several remaining license headersYu Watanabe2024-04-083-32/+1
| | | | | And downgrade the license of utf8.c to LGPL-2.0-or-later, to follow the original license.
* Merge pull request #31131 from poettering/dlopen-kmodLuca Boccassi2024-04-062-14/+15
|\ | | | | turn libkmod into a dlopen() dependency, too
| * libkmod: turn into dlopen() dependencyLennart Poettering2024-04-042-14/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | As it turns out libkmod has quite a bunch of deps, including various compressing libs and similar. By turning this into a dlopen() dependency, we can make our depchain during install time quite a bit smaller. In particular as inside of containers kmod doesn't help anyway as CAP_SYS_MODULE is not available anyway. While we are at it, also share the code that sets up logging/kmod context. After: $ lddtree ./build/systemd systemd => ./build/systemd (interpreter => /lib64/ld-linux-x86-64.so.2) libsystemd-core-255.so => ./build/src/core/libsystemd-core-255.so libaudit.so.1 => /lib64/libaudit.so.1 libcap-ng.so.0 => /lib64/libcap-ng.so.0 ld-linux-x86-64.so.2 => /lib64/ld-linux-x86-64.so.2 libm.so.6 => /lib64/libm.so.6 libmount.so.1 => /lib64/libmount.so.1 libblkid.so.1 => /lib64/libblkid.so.1 libseccomp.so.2 => /lib64/libseccomp.so.2 libselinux.so.1 => /lib64/libselinux.so.1 libpcre2-8.so.0 => /lib64/libpcre2-8.so.0 libsystemd-shared-255.so => /home/lennart/projects/systemd/build/src/shared/libsystemd-shared-255.so libacl.so.1 => /lib64/libacl.so.1 libattr.so.1 => /lib64/libattr.so.1 libcap.so.2 => /lib64/libcap.so.2 libcrypt.so.2 => /lib64/libcrypt.so.2 libgcrypt.so.20 => /lib64/libgcrypt.so.20 libgpg-error.so.0 => /lib64/libgpg-error.so.0 liblz4.so.1 => /lib64/liblz4.so.1 libcrypto.so.3 => /lib64/libcrypto.so.3 libz.so.1 => /lib64/libz.so.1 libpam.so.0 => /lib64/libpam.so.0 libeconf.so.0 => /lib64/libeconf.so.0 liblzma.so.5 => /lib64/liblzma.so.5 libzstd.so.1 => /lib64/libzstd.so.1 libc.so.6 => /lib64/libc.so.6 Before: $ lddtree ./build/systemd systemd => ./build/systemd (interpreter => /lib64/ld-linux-x86-64.so.2) libsystemd-core-255.so => ./build/src/core/libsystemd-core-255.so libaudit.so.1 => /lib64/libaudit.so.1 libcap-ng.so.0 => /lib64/libcap-ng.so.0 ld-linux-x86-64.so.2 => /lib64/ld-linux-x86-64.so.2 libkmod.so.2 => /lib64/libkmod.so.2 libzstd.so.1 => /lib64/libzstd.so.1 liblzma.so.5 => /lib64/liblzma.so.5 libz.so.1 => /lib64/libz.so.1 libcrypto.so.3 => /lib64/libcrypto.so.3 libgcc_s.so.1 => /lib64/libgcc_s.so.1 libm.so.6 => /lib64/libm.so.6 libmount.so.1 => /lib64/libmount.so.1 libblkid.so.1 => /lib64/libblkid.so.1 libseccomp.so.2 => /lib64/libseccomp.so.2 libselinux.so.1 => /lib64/libselinux.so.1 libpcre2-8.so.0 => /lib64/libpcre2-8.so.0 libsystemd-shared-255.so => /home/lennart/projects/systemd/build/src/shared/libsystemd-shared-255.so libacl.so.1 => /lib64/libacl.so.1 libattr.so.1 => /lib64/libattr.so.1 libcap.so.2 => /lib64/libcap.so.2 libcrypt.so.2 => /lib64/libcrypt.so.2 libgcrypt.so.20 => /lib64/libgcrypt.so.20 libgpg-error.so.0 => /lib64/libgpg-error.so.0 liblz4.so.1 => /lib64/liblz4.so.1 libpam.so.0 => /lib64/libpam.so.0 libeconf.so.0 => /lib64/libeconf.so.0 libc.so.6 => /lib64/libc.so.6
* | Merge pull request #32085 from yuwata/udev-check-processingLuca Boccassi2024-04-051-1/+1
|\ \ | | | | | | udev: check ID_PROCESSING udev property more
| * | tree-wide: use device_is_processed() moreYu Watanabe2024-04-041-1/+1
| |/
* | udevadm-test: also show security labels if specifiedYu Watanabe2024-04-041-0/+7
| | | | | | | | Follow-up for 03b6879f4d45c49264708aef872fd05af30ddcf0.
* | udev: do not update sysattr and sysctl value on testingYu Watanabe2024-04-041-12/+21
| | | | | | | | Follow-up for 089bef66316e5bdc91b9984148e5a6455449c1da.
* | udevadm-test: insert missing line breakYu Watanabe2024-04-041-1/+1
|/ | | | | Addresses post-merge comment: https://github.com/systemd/systemd/commit/03b6879f4d45c49264708aef872fd05af30ddcf0#r140587790
* udevadm-test: prettify test resultsYu Watanabe2024-03-291-10/+70
|
* udev: make udevadm test and test-builtin not destructiveYu Watanabe2024-03-2926-244/+341
| | | | | | | | | | | | | Previously, 'udevadm test' performs not only processing udev rules, but made several destructive change on the system; updating udev database, device node permission, devlinks, network interface properties, and so on. Similary, 'udevadm test-builtin' may perform something destructive, especially by 'keyboard', 'kmod', and 'net_setup_link' builtins. Let's make these commands and test executables not change device configurations.
* udev-event: split out update_clone()Yu Watanabe2024-03-281-18/+30
| | | | No functional change, preparation for later commits.
* daemon-util: introduce notify_reloading helperMike Yuan2024-03-261-8/+2
| | | | Prompted by #31951
* udev: add assert for EVENT_RESULT_EXIT_STATUS_BASE (#31710)sharad30012024-03-131-0/+1
| | | | EVENT_RESULT_EXIT_STATUS_BASE and EVENT_RESULT_SUCCESS has the same value. Code updated to add assert statement for EVENT_RESULT_EXIT_STATUS_BASE.
* Merge pull request #30480 from keszybz/kernel-install-more-pathsZbigniew Jędrzejewski-Szmek2024-03-083-6/+5
|\ | | | | Read kernel-install config from /run/kernel too
| * udevd: inline iterator variableZbigniew Jędrzejewski-Szmek2024-03-071-3/+2
| |
| * udev,backlight,kernel-install: reword sentences starting with "Skipping to"Zbigniew Jędrzejewski-Szmek2024-03-072-3/+3
| | | | | | | | | | | | | | That's not gramatically correct. In backlight, change "assocation" to "deduplication". Without the context, it's probably not clear at all that we "associate" them to ignore them.
* | udev: use strndupa_safe() rather than strndupa()Lennart Poettering2024-03-061-6/+6
| | | | | | | | | | | | | | | | As per coding style, we don't use strndupa(), but strndupa_safe() only. As a side-effect, this means musl folks can just drop this mess: https://git.openembedded.org/openembedded-core/tree/meta/recipes-core/systemd/systemd/0003-src-basic-missing.h-check-for-missing-strndupa.patch
* | extract-word: modernize extract_many_wordsMike Yuan2024-03-032-4/+4
| |
* | udev/net: fix ReceivePacketSteeringCPUMask=disable assignmentYu Watanabe2024-03-021-4/+2
| | | | | | | | | | | | Follow-up for 0f30bf5886f839984df545df74e9658daf3533d2. If 'mask' is newly allocated, previously the value was ignored.
* | udevd: Add ReceivePacketSteeringCPUMask for systemd.linkRenjaya Raga Zenta2024-02-283-0/+111
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Takes a list of CPU indices or ranges separated by either whitespace or commas. Alternatively, takes the special value "all" in which will include all available CPUs in the mask. CPU ranges are specified by the lower and upper CPU indices separated by a dash (e.g. "2-6"). This option may be specified more than once, in which case the specified CPU affinity masks are merged. If an empty string is assigned, the mask is reset, all assignments prior to this will have no effect. Defaults to unset and RPS CPU list is unchanged. To disable RPS when it was previously enabled, use the special value "disable". Currently, this will set CPU mask to all `rx` queue of matched device (if it has multiple queues). The `/sys/class/net/<dev>/queues/rx-<n>/rps_cpus` only accept cpu bitmap mask in hexadecimal. Fix: #30323
* | signal-util: imply sentinel -1 in sigprocmask_many() + sigset_add_many() ↵Lennart Poettering2024-02-234-4/+4
|/ | | | args list
* udev: introduce ID_PROCESSING=1 boolean propertyYu Watanabe2024-02-112-0/+37
| | | | This indicates that the device is being processed by udevd.
* mountpoint-util: introduce path_is_mount_point_fullMike Yuan2024-02-062-2/+2
|
* udev: even if a device is a zac device, scsi-$ID_SERIAL will be reserved for ↵我超厉害2024-01-161-3/+10
| | | | | it (#30459) Co-authored-by: wangyuhang <wangyuhang27@huawei.com>
* udev: distinguish host-managed zoned block in scsi_idchenjiayi2024-01-121-0/+7
| | | | | | | | | According to SPC4, the value of 0x14 is reserved to distinguish host managed zoned block, e.g., some SMR (Shingled Magnetic Recording) disks. Other utilities such as sg3_utils can successfully recognize such kind of disks. This patch implements the same ability.
* Merge pull request #30867 from dtardon/udev-conf-dropinsYu Watanabe2024-01-111-57/+17
|\ | | | | Allow dropins for udev.conf
| * udev: factor out config parser call into functionDavid Tardon2024-01-111-10/+1
| | | | | | | | | | | | ... which is then called from both places. This makes sure that the configuration is parsed by udevd and other tools in exactly the same way.
| * udevd: use config. parser to parse udev.confDavid Tardon2024-01-111-55/+24
| | | | | | | | | | | | | | This adds support for the usual config. file hierarchy (including dropins). Fixes #30460.
* | tree-wide: replace string functions with fundamental functionsRose2024-01-111-1/+1
| |
* | udev/net: introduce [Link] Property=, ImportProperty=, and UnsetProperty= ↵Yu Watanabe2024-01-095-3/+198
| | | | | | | | | | | | | | settings The applied order is equivalent to Environment=, PassEnvironment=, and UnsetEnvironment= for [Service] or so.
* | udev: split out check that udev property can be updatedYu Watanabe2024-01-091-3/+1
| |
* | udev/net: split out udev property assignment logicYu Watanabe2024-01-093-22/+40
| | | | | | | | No functional change, just refactoring.
* | udev/net: do not set unapplied .link file name to ID_NET_LINK_FILEYu Watanabe2024-01-092-8/+22
| | | | | | | | | | Instead, import already assigned value from the udev database. Then, return the builtin earlier.
* | udev-builtin-path_id: drop redundant debugging logsYu Watanabe2024-01-091-12/+4
| | | | | | | | The function udev_builtin_add_property() internally logs the failure.
* | udev/builtin: introduce udev_builtin_import_property() helper functionYu Watanabe2024-01-092-0/+24
| | | | | | | | This is not used in this commit, but will be used later commits.