Commit Graph

11018 Commits

Author SHA1 Message Date
Boian Bonev
fc9050ca28
Merge pull request #280 from masahisak/fix_dev_urandom
random-util.c: sync dev_urandom implementation to systemd-udev
2024-04-28 12:49:34 +05:30
Masahisa Kojima
a49a3aaa46 random-util.c: sync dev_urandom implementation to systemd-udev
Current dev_urandom() assumes that reading /dev/urandom
will never block regardless if the random pool is fully
initialized or not.
This assumption is no longer applicable since linux kerrnel
enforces the /dev/urandom entropy initialization from
v5.18-rc2 with the commit:
48bff1053c17 ("random: opportunistically initialize on /dev/urandom reads").

With this, when we use the linux v5.18-rc2 or later,
dev_urandom() will block if enough random pool is not supplied.
It causes the boot delay, typically 1024msec(4msec * 256 = 1024msec)
delay to fill the 256 bits entropy for the case CONFIG_HZ=250.

To prevent this boot delay, this commit syncs dev_urandom()
implementation to the systemd-udev.
The systemd-udev implementation of reading /dev/urandom is as follows.
 - Try to get random with calling getrandom(GRND_INSECURE)
 - If kernel does not support GRND_INSECURE, fallback to GRND_NONBLOCK
 - If enough entropy is not supplied, fallback to reading /dev/urandom,
   this will block when the kernel version is v5.18-rc2 or later

With this modification, dev_urandom() tries not to block
as much as possible.

This modification still keeps the backword compatibility,
dev_random() will never block if the commit(48bff1053c17) is not
applied to the linux kernel, the behavior is same as before
in this case.

Signed-off-by: Masahisa Kojima <kojima.masahisa@socionext.com>
2024-04-26 10:40:17 +09:00
Boian Bonev
e98a66787d
Better wording
Suggested-by: CuriouslyCurious <thecuriouslycurious@protonmail.com>
Closes: #277
2024-02-29 02:52:58 +00:00
Boian Bonev
efcd41202e
Merge pull request #278 from CuriouslyCurious/alpine-libtool
build: Add libtool as build-dependency for Alpine
2024-02-28 12:59:54 +02:00
CuriouslyCurious
fe4df4cd6a
build: Add libtool as build-dependency for Alpine 2024-02-28 08:29:51 +01:00
Boian Bonev
aae4ea8cc4
Merge pull request #276 from vaerksted/master
fix typos
2024-02-26 23:01:52 +02:00
spaette
cead7bcd11 typos 2024-02-26 08:47:47 -06:00
Boian Bonev
611b6fbae2
Merge pull request #274 from jwslater0823/master
80-net-name-slot.rules: consider ID_NET_NAME_MAC as a name
2024-01-18 01:03:06 +05:30
Joe Slater
e00158c522 80-net-name-slot.rules: consider ID_NET_NAME_MAC as a name
If nothing else is available, even a MAC name is better
than nothing.

Signed-off-by: Joe Slater <joe.slater@windriver.com>
2024-01-17 08:59:39 -08:00
Boian Bonev
3465d068b2
Merge pull request #272 from mscdex/add-nvme-by-path
udev/path_id: introduce support for NVMe devices
2023-12-31 20:31:25 +02:00
Keith Busch
cad674e76e
udev/path_id: introduce support for NVMe devices
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>
2023-12-31 01:20:55 -05:00
Boian Bonev
f2d455e5d1
Merge pull request #271 from mixi/sound-ID_PATH
78-sound-card.rules: Import ID_PATH early
2023-12-24 23:22:24 +02:00
Johannes Nixdorf
917ae648f6 78-sound-card.rules: Import ID_PATH early
Pipewire requires ID_PATH to use the same device names as with systemd's
udev. Some rules, such as the ones in asahi-audio [1] use those names, and
fail if they don't match [2].

On systemd's udev this is instead imported in 71-seat.rules, which we don't
have.

[1]: https://github.com/AsahiLinux/asahi-audio
[2]: https://github.com/AsahiLinux/asahi-audio/issues/16

Signed-off-by: Johannes Nixdorf <mixi@shadowice.org>
2023-12-22 10:27:08 +01:00
Boian Bonev
ddfdf863d7
Merge pull request #269 from bbonev/my-patch-1
Fix a mistake in the length of USEC_INITIALIZED when parsing property…
2023-10-30 01:30:10 +02:00
Aitor Cuadrado Zubizarreta
c79438307b Fix a mistake in the length of USEC_INITIALIZED when parsing property string 2023-10-29 12:19:17 +01:00
Boian Bonev
7d1085839f
Merge pull request #267 from schiffermtq/persistent-mtd
rules: add mtd/by-name symlinks
2023-10-18 15:22:05 +03:00
Matthias Schiffer
944803d916 rules: add mtd/by-name symlinks
Add persistent symlinks for MTD devices like SPI-NOR flash, based on the
partition names specified on the cmdline, in a Device Tree, or by other
MTD partitioning parser drivers. Using the persistent name can be
preferable to using the numbered /dev/mtdX device, as the latter can
change depending on probe order or when partitioning has changed.
2023-10-17 11:55:55 +02:00
Boian Bonev
9e7c4e744b
Commit the generated man page 2023-10-05 20:20:45 +03:00
Boian Bonev
901dc17e48
Merge pull request #266 from bbonev/std-fds
Ensure that standard file descriptors are open
2023-10-05 20:18:39 +03:00
Boian Bonev
5262448fd9
Ensure that standard file descriptors are open
- this will avoid unwillingly using fd in the 0..2 range
- closes: #185
2023-10-03 22:41:28 +03:00
Boian Bonev
231c23fbbc
Tabs to spaces 2023-10-03 20:54:58 +03:00
Boian Bonev
c5bae0b656
Merge pull request #253 from bbonev/bump251
Add missing API from 247
2023-10-03 19:41:39 +03:00
Boian Bonev
2e4dd05900
Merge pull request #265 from vivien-consider-dropping-github/master
More wording fixes for the manual page for udev
2023-10-01 20:53:06 +03:00
Vivien Kraus
89a68e7c7e Clarify the /etc/udev/hwdb.d file override with respect to UDEV_HWDB_PATH
Overriding a file in /etc/udev/hwdb.d also hides the files with that
name in UDEV_HWDB_PATH.
2023-10-01 19:51:23 +02:00
Vivien Kraus
672cbb5742 Remove references to /run/udev/hwdb.d
This directory never seemed to exist. The wording is very similar to
that of the Rules Files section, so it is possible that the same text
was copied and pasted by mistake. The HWDB never looked for files in
/run.

Having a non-volatile index of volatile files would probably not be
useful.
2023-10-01 19:50:37 +02:00
Boian Bonev
02a2afffc1
Improve wording
Generate udevadm.8 from udevadm.xml
2023-09-30 22:35:38 +00:00
Boian Bonev
218489052f
Improve wording and restore lines lost in merges
Generate udev.7 from udev.xml
2023-09-30 22:29:22 +00:00
Boian Bonev
805c07a07b
Merge pull request #262 from vivien-consider-dropping-github/master
Dynamically get the udevadm hwdb files with a path variable
2023-10-01 00:45:45 +03:00
Vivien Kraus
92ab29e3d5 fixup! Dynamically get the udevadm hwdb files with a path variable 2023-09-30 23:40:24 +02:00
Boian Bonev
060dc0ffaf
Merge branch 'master' into master 2023-10-01 00:26:08 +03:00
Boian Bonev
0c8f0021a4
Merge pull request #263 from vivien-consider-dropping-github/udevadm-hwdb-update-output
Add a generic --output argument to udevadm hwdb
2023-10-01 00:21:12 +03:00
Boian Bonev
701d83f686
Merge branch 'master' into udevadm-hwdb-update-output 2023-10-01 00:16:38 +03:00
Boian Bonev
a3ee57f010
Merge pull request #264 from vivien-consider-dropping-github/hwdb-bin-file-environment
Let libudev find hwdb.bin under UDEV_HWDB_BIN
2023-10-01 00:09:44 +03:00
Boian Bonev
5f98fb38c1
Merge branch 'master' into hwdb-bin-file-environment 2023-10-01 00:04:32 +03:00
Vivien Kraus
65e17b2f2f Dynamically get the udevadm hwdb files with a path variable
Introduce UDEV_HWDB_PATH, containing a colon-separated path with hwdb
files in it. The whole path is searched, in addition to the system
locations, when searching for hwdb files.

Due to how conf_files_list_strv is implemented, as a thin wrapper
around the internal function, it is easy to also implement a variant
accepting a search path in the same way. Since the internal function
expects an allocated array of allocated strings, the path scanning is
done in 2 steps, to first get the array length, and then duplicate the
items. It is not possible to use strtok(_r) here because it would work
for only 1 pass.

* src/shared/conf-files.c (conf_files_list_follow_path): New function.
(conf_files_list_strv_path): Use it here.
* src/shared/conf-files.h: Export the signature for the _path variant.
* src/udev/udevadm-hwdb.c (list_conf_file_path): New function
replacing conf_file_dirs.
(help): Document the search path for hwdb files.
(adm_hwdb): Use list_conf_file_path and conf_files_list_strv_path.
* man/udevadm.xml: Mention UDEV_HWDB_PATH.
* man/udev.xml: Same.
* man/udevadm.8: Regenerate.
* man/udev.7: Same.
2023-09-30 19:40:17 +02:00
Vivien Kraus
1eca0ef6c4 Add a generic --output argument to udevadm hwdb
Instead of always writing /etc/udev/hwdb.bin or UDEV_LIBEXEC_DIR
/hwdb.bin, let the user specify a full file name.

* src/udev/udevadm-hwdb.c (adm_hwdb): New option "output". Construct
hwdb_bin when processing options, and prepend root after processing
options.
* man/udev.xml: Mention --output.
* man/udevadm.xml: Document --output.
* man/udev.7: Regenerate.
* man/udevadm.8: Same.
2023-09-30 19:38:30 +02:00
Vivien Kraus
c7da117e5c Let libudev find hwdb.bin under UDEV_HWDB_BIN
* src/libudev/libudev-hwdb.c (get_hwdb_bin_paths): New function,
replacing hwdb_bin_paths.
(struct udev_hwdb): New bin_paths field.
(udev_hwdb_new): Initialize it with get_hwdb_bin_paths.
(udev_hwdb_validate): Use the bin_paths field to find hwdb.bin.
(udev_hwdb_unref): Free the bin_paths field.
* src/libudev/libudev.h: Warn about UDEV_HWDB_BIN.
* man/udev.xml: Mention run-time UDEV_HWDB_BIN.
* man/udev.7: Re-generate.
2023-09-30 19:36:55 +02:00
Boian Bonev
19aa81d9bf
Regenerate according to 0cf14fb and e5e4013 2023-09-30 16:55:44 +00:00
Boian Bonev
e5e4013cb7
Move the changes from udev.7 to udev.xml
Commit 0cf14fb changed only the generated udev.7 without touching the
source file udev.xml
2023-09-30 16:52:12 +00:00
Boian Bonev
072d94137f
Merge pull request #257 from bbonev/issue256
Fix := not preventing further assignments to RUN
2023-09-30 19:18:50 +03:00
Boian Bonev
0d86dd9a2a
Merge pull request #260 from bbonev/usrlocal
Add /usr/local/lib/udev/rules.d
2023-09-12 00:10:06 +02:00
Boian Bonev
298ef249e3
Add /usr/local/lib/udev/rules.d
Closes #259
2023-09-11 19:15:17 +03:00
Boian Bonev
f49af0b03b
Fix := not preventing further assignments to RUN
Closes #256

Suggested by: Aksel Lunde Aase
2023-08-31 23:46:56 +00:00
NaofumiHonda
b9cc389aab
Clear sysattr cache if a null pointer is passed (#255)
* Clear sysattr cache if a null pointer is passed

* remove tabs
2023-08-21 18:17:45 +03:00
Boian Bonev
df220edbc5
bump version to 3.2.14 2023-08-11 23:16:10 +00:00
Boian Bonev
dacff83d87
Export dummies for
- udev_device_has_current_tag
 - udev_device_get_current_tags_list_entry

since the current eudev device database does not support the concept of
current tags
2023-08-11 23:14:02 +00:00
Boian Bonev
7d2123ead5
Bump udev version to 251 2023-08-11 22:08:27 +00:00
Boian Bonev
ffc1b77871
Update as per IRC discussion 2023-05-30 16:16:33 +00:00
Boian Bonev
2703baf556
Include unaligned.h in dist 2023-05-16 15:08:56 +00:00
Boian Bonev
490b90da5a
Merge branch 'master' of github.com:eudev-project/eudev 2023-05-16 14:18:09 +00:00