| Commit message (Collapse) | Author | Age | Files | Lines |
|\
| |
| | |
Restore backwards compat in 60-evdev.rules
|
| | |
|
|/
|
|
|
|
|
|
|
|
|
|
|
|
| |
This tool was "deprecated" back in 65eb4378c3e1de25383d8cd606909e64c71edc80,
but only by removing documentation. This is somewhat surprising, but udevadm
hwdb --update and systemd-hwdb update generate different databases. udevadm
runs in compat mode and (as far as I have been able to figure out from a quick
look), it omits filename information and does some other changes to the
datastructures. The consuming code (udev) is the same in both cases, so this
"compatibility mode" seems very strange. But I don't think it's worth trying to
figure out why things were done this way. Let's just push people towards the
new code.
Inspired by https://github.com/systemd/systemd/issues/25698#issuecomment-1346298094.
|
|
|
|
| |
just some refactoring to make things simpler.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
If no root= switch is specified on the kernel command line we'll use the
root disk on which the partition the LoaderDevicePartUUID efi var is
located – as long as that partition is an ESP. Let's slightly liberalize
that and also allow it if that partition is an XBOOTLDR partition. This
ensures that UKIs spawned directly from XBOOTLDR work the same as those
from the ESP.
(Note that this makes no difference if sd-boot is in the mix, as in that
case LoaderDevicePartUUID is always set to the ESP, as that's where
sd-boot is located, and sd-boot will set the var first, sd-stub will
only set it later if it#s not set yet.)
|
| |
|
|\
| |
| | |
Split/rename util.c+h and def.h
|
| |
| |
| |
| |
| |
| | |
The name "def.h" originates from before the rule of "no needless abbreviations"
was established. Let's rename the file to clarify that it contains a collection
of various semi-related constants.
|
| |
| |
| |
| |
| | |
util.h is now about logarithms only, so we can rename it. Many files included
util.h for no apparent reason… Those includes are dropped.
|
|/ |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
On various ARM systems, it is possible to find devices on AMBA bus.
This is defined in Linux kernel drivers/amba/bus.c as separate bus
type. Udev currently does not recognize this when building ID_PATH
which leads to ID_PATH containing the suffix from next recognized
parent device. On ST STM32MP15xx with SDIO WiFi, the ID_PATH looks
like 'platform-soc', which is not unique and basically useless. On
NXP i.MX8M Plus with SDIO WiFi, ID_PATH is 'platform-30b40000.mmc'
which is far more useful.
Add the 'amba' subsystem handling the same way 'platform' subsystem
is handled to get ID_PATH 'platform-soc-amba-48004000.sdmmc' on the
former, which is far more useful compared to 'platform-soc'.
---
```
$ udevadm info --attribute-walk --path=/devices/platform/soc/48004000.mmc/mmc_host/mmc1/mmc1:0001/mmc1:0001:1/net/wlan0
Udevadm info starts with the device specified by the devpath and then
walks up the chain of parent devices. It prints for every device
found, all possible attributes in the udev rules key format.
A rule to match, can be composed by the attributes of the device
and the attributes from one single parent device.
looking at device '/devices/platform/soc/48004000.mmc/mmc_host/mmc1/mmc1:0001/mmc1:0001:1/net/wlan0':
KERNEL=="wlan0"
SUBSYSTEM=="net"
DRIVER==""
ATTR{addr_assign_type}=="0"
ATTR{addr_len}=="6"
ATTR{address}=="10:98:c3:5f:4b:80"
ATTR{broadcast}=="ff:ff:ff:ff:ff:ff"
ATTR{carrier_changes}=="1"
ATTR{carrier_down_count}=="1"
ATTR{carrier_up_count}=="0"
ATTR{dev_id}=="0x0"
ATTR{dev_port}=="0"
ATTR{flags}=="0x1002"
ATTR{gro_flush_timeout}=="0"
ATTR{ifalias}==""
ATTR{ifindex}=="3"
ATTR{iflink}=="3"
ATTR{link_mode}=="0"
ATTR{mtu}=="1500"
ATTR{napi_defer_hard_irqs}=="0"
ATTR{netdev_group}=="0"
ATTR{operstate}=="down"
ATTR{power/control}=="auto"
ATTR{power/runtime_active_time}=="0"
ATTR{power/runtime_status}=="unsupported"
ATTR{power/runtime_suspended_time}=="0"
ATTR{proto_down}=="0"
ATTR{queues/rx-0/rps_cpus}=="0"
ATTR{queues/rx-0/rps_flow_cnt}=="0"
ATTR{queues/tx-0/byte_queue_limits/hold_time}=="1000"
ATTR{queues/tx-0/byte_queue_limits/inflight}=="0"
ATTR{queues/tx-0/byte_queue_limits/limit}=="0"
ATTR{queues/tx-0/byte_queue_limits/limit_max}=="1879048192"
ATTR{queues/tx-0/byte_queue_limits/limit_min}=="0"
ATTR{queues/tx-0/tx_maxrate}=="0"
ATTR{queues/tx-0/tx_timeout}=="0"
ATTR{queues/tx-0/xps_rxqs}=="0"
ATTR{statistics/collisions}=="0"
ATTR{statistics/multicast}=="0"
ATTR{statistics/rx_bytes}=="0"
ATTR{statistics/rx_compressed}=="0"
ATTR{statistics/rx_crc_errors}=="0"
ATTR{statistics/rx_dropped}=="0"
ATTR{statistics/rx_errors}=="0"
ATTR{statistics/rx_fifo_errors}=="0"
ATTR{statistics/rx_frame_errors}=="0"
ATTR{statistics/rx_length_errors}=="0"
ATTR{statistics/rx_missed_errors}=="0"
ATTR{statistics/rx_nohandler}=="0"
ATTR{statistics/rx_over_errors}=="0"
ATTR{statistics/rx_packets}=="0"
ATTR{statistics/tx_aborted_errors}=="0"
ATTR{statistics/tx_bytes}=="0"
ATTR{statistics/tx_carrier_errors}=="0"
ATTR{statistics/tx_compressed}=="0"
ATTR{statistics/tx_dropped}=="0"
ATTR{statistics/tx_errors}=="0"
ATTR{statistics/tx_fifo_errors}=="0"
ATTR{statistics/tx_heartbeat_errors}=="0"
ATTR{statistics/tx_packets}=="0"
ATTR{statistics/tx_window_errors}=="0"
ATTR{threaded}=="0"
ATTR{tx_queue_len}=="1000"
ATTR{type}=="1"
looking at parent device '/devices/platform/soc/48004000.mmc/mmc_host/mmc1/mmc1:0001/mmc1:0001:1':
KERNELS=="mmc1:0001:1"
SUBSYSTEMS=="sdio"
DRIVERS=="brcmfmac"
ATTRS{class}=="0x00"
ATTRS{coredump}=="(write-only)"
ATTRS{device}=="0xa9bf"
ATTRS{power/control}=="auto"
ATTRS{power/runtime_active_time}=="0"
ATTRS{power/runtime_status}=="unsupported"
ATTRS{power/runtime_suspended_time}=="0"
ATTRS{revision}=="0.0"
ATTRS{vendor}=="0x02d0"
looking at parent device '/devices/platform/soc/48004000.mmc/mmc_host/mmc1/mmc1:0001':
KERNELS=="mmc1:0001"
SUBSYSTEMS=="mmc"
DRIVERS==""
ATTRS{device}=="0xa9bf"
ATTRS{ocr}=="0x00200000"
ATTRS{power/control}=="auto"
ATTRS{power/runtime_active_time}=="0"
ATTRS{power/runtime_status}=="unsupported"
ATTRS{power/runtime_suspended_time}=="0"
ATTRS{rca}=="0x0001"
ATTRS{revision}=="0.0"
ATTRS{type}=="SDIO"
ATTRS{vendor}=="0x02d0"
looking at parent device '/devices/platform/soc/48004000.mmc/mmc_host/mmc1':
KERNELS=="mmc1"
SUBSYSTEMS=="mmc_host"
DRIVERS==""
ATTRS{power/control}=="auto"
ATTRS{power/runtime_active_time}=="0"
ATTRS{power/runtime_status}=="unsupported"
ATTRS{power/runtime_suspended_time}=="0"
looking at parent device '/devices/platform/soc/48004000.mmc':
KERNELS=="48004000.mmc"
SUBSYSTEMS=="amba" <------------------------------------------------------- AMBA is here
DRIVERS=="mmci-pl18x"
ATTRS{driver_override}=="(null)"
ATTRS{id}=="00253180"
ATTRS{power/autosuspend_delay_ms}=="50"
ATTRS{power/control}=="on"
ATTRS{power/runtime_active_time}=="666709"
ATTRS{power/runtime_status}=="active"
ATTRS{power/runtime_suspended_time}=="0"
looking at parent device '/devices/platform/soc':
KERNELS=="soc"
SUBSYSTEMS=="platform"
DRIVERS=="simple-pm-bus"
ATTRS{driver_override}=="(null)"
ATTRS{power/control}=="auto"
ATTRS{power/runtime_active_time}=="0"
ATTRS{power/runtime_status}=="unsupported"
ATTRS{power/runtime_suspended_time}=="0"
looking at parent device '/devices/platform':
KERNELS=="platform"
SUBSYSTEMS==""
DRIVERS==""
ATTRS{power/control}=="auto"
ATTRS{power/runtime_active_time}=="0"
ATTRS{power/runtime_status}=="unsupported"
ATTRS{power/runtime_suspended_time}=="0"
```
|
|
|
|
|
|
|
|
|
|
|
| |
To support predictable interface names in various embeeded systems
add support for an additional naming scheming using the USB host
interface. Several asics have usb controllers that are platform
devices and not children of a pci interface. These embedded systems
should be able to enumerate interfaces by udev path as well to support
configurations and policies.
Signed-off-by: Charles Hardin <charles.hardin@chargepoint.com>
|
|\
| |
| | |
udev: cleanup for ID_RENAMING property
|
| | |
|
| |
| |
| |
| |
| |
| |
| | |
As the properties loaded from the database are stored to UdevEvent.dev_db_clone,
instead of UdevEvent.dev.
This also makes the removal done unconditionally, for safety.
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Previously, ata_id might not be able to retrieve attributes correctly,
and properties from usb_id were used as a fallback. See issue #24921
and PR #24923. To keep backward compatibility, still we need to create
symlinks based on USB serial.
Fixes #25179.
|
|/
|
|
|
|
| |
Fixes a bug introduced by 5bbcfbaa11a92732f9bbc8d5f77e9311e6ac3d56.
Fixes #25181.
|
|
|
|
| |
Follow-up to 691a596da15.
|
| |
|
|
|
|
| |
Follow-up for f714ecd450828e45a6f04e6277011d67a10c323f.
|
|
|
|
| |
Follow-up for 5bbcfbaa11a92732f9bbc8d5f77e9311e6ac3d56.
|
|
|
|
|
|
|
|
|
|
|
| |
If no module name is provided, then try to load modules based on the
device modealias.
Previously, MODALIAS property is passed as an argument, but it may
contain quotation. Hence, unfortunately the modalias may be modified
and cannot load expected modules.
Fixes #24715.
|
|
|
|
| |
Follow-up for 6209bbbd4b1c9ed2886028ab2ee3df0a7d0e2494.
|
|
|
|
|
| |
We check the same list of error codes on various xattr operations, and
we should on some more. Add a common helper for this purpose.
|
|
|
|
|
|
| |
Fixes a bug introduced by 67c3e1f63a5221b47a8fea85ae421671f29f3b7e.
Fixes #24945.
|
|
|
|
|
|
| |
The Response Code is contained in the first byte of the SCSI Sense Data.
Bit number 7 is reserved or has a different meaning for some Response Codes
and is set to 1 for some drives.
|
|
|
|
|
|
|
| |
If reading the sysattr failed with such error, the whole operation in
net_id builtin command will fail, and the interface will not be renamed.
Fixes a bug introduced by 5bbcfbaa11a92732f9bbc8d5f77e9311e6ac3d56.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Otherwise, we provide misleading error message.
Before:
---
$ udevadm info /sys/class/foo
Bad argument "/sys/class/foo", expected an absolute path in /dev/ or /sys/ or a unit name: Invalid argument
---
After:
---
$ udevadm info /sys/class/foo
Unknown device "/sys/class/foo": No such device
---
|
|\
| |
| | |
udev: drop workaround for slow read of phys_port_name sysattr
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
TL;DR
This effectively reverts 8327fd1b11c5fb6529d46dfb40e2af981ffa8545,
eaba9bb3e69635d2c490c5e1b0d262b763753e1d, and its follow-ups, as the
original issue was already fixed by the kernel side.
The original issue that the above commits tried to 'fix' is that reading
phys_port_name triggers a lock in the kernel, hence processing multiple
interfaces at the same time causes extreme slow down.
To workaround the issue, the above commits made several necessary
information retrieved through netlink instead of sysfs attributes.
A patch set for the kernel was proposed as a fix for the issue:
https://lore.kernel.org/all/20210928125500.167943-1-atenart@kernel.org/
and some of them were merged to v5.16:
https://github.com/torvalds/linux/commit/146e5e733310379f51924111068f08a3af0db830,
It has been already backported to 5.4.160, 5.10.80, 5.14.19, and 5.15.3.
When these commits were proposed, it is already claimed that such issue
should be fixed by the kernel side, and udevd should not workaround it.
Neverthless the feature was introduced, as these have theoretical
performance improvement, even if phys_port_name sysattr does not have the
above issue, as in that way udevd can obtain multiple information about
the interface with a single netlink socket operation. See the discussion
in #20744.
However, in reality, only `iflink`, `type`, `address`, and `phys_port_name`
attributes from netlink are used in the udev net_id builtin command. Hence,
after the original issue being fixed in the kernel side, there should be
almost no performance improvement for udevd.
Furthermore, combining attributes from netlink and sysfs makes hard to
test net_id builtin. See #21725.
Let's drop mostly meaningless code, and make net_id builtin easily testable.
Closes #21725.
|
|\ \
| |/
|/| |
sd-device: introduce sd_device_get_child_first() and _next()
|
| | |
|
|/
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
If multipath feature is enabled, nvme block devices may belong to the
"nvme-subsystem" subsystem, instead of "nvme" subsystem.
(What a confusing name...)
Then, the syspath is something like the following,
/sys/devices/virtual/nvme-subsystem/nvme-subsys0/nvme0n1
Hence, we need to find the 'real parent' device, such as
/sys/devices/pci0000:00/0000:00:1c.4/0000:3c:00.0/nvme/nvme0
Fixes https://bugzilla.redhat.com/show_bug.cgi?id=2031810.
Fixes https://bugzilla.redhat.com/show_bug.cgi?id=2124964.
Replaces #24748.
|
|\
| |
| | |
Expose various GPT UUIDs as public contants and link them up in docs
|
| |
| |
| |
| |
| |
| | |
I think those constants are generally useful. It's quite easy to make a mistake
when copying things from the docs, so let's make them easy and convenient to
access.
|
| |
| |
| |
| |
| |
| |
| |
| | |
No functional changes, just refactoring.
Note, this also makes synthesize_change() propagate the error from
synthesize_change_one(). However, the caller of synthesize_change()
ignores the failure anyway, hence the change does not take any effect.
|
| | |
|
| |
| |
| |
| | |
No functional changes, just refactoring.
|
| |
| |
| |
| | |
No functional changes, just refactoring.
|
|\ \
| | |
| | | |
udev: introduce symlink_atomic_full() and use it
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
If the filename of a device symlink is too long, then the temporary
filename may become invalid, and we fail to create symlink.
The function `tempfn_random()` used in symlink_atomic_full() generates
a safe temporary filename.
Note that, thanks to the PR #23043, now only one worker can handle
the same symlink simultaneously. Hence, the device ID based temporary
filename is not necessary.
|
|\ \ \
| | | |
| | | |
| | | |
| | | | |
yuwata/blockdev-util-introduce-block_device_get_whole_disk
blockdev-util: introduce block_device_get_whole_disk()
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
We already checked that the sd_device object 'dev' is for a whole block
device. So, -ENOENT should not be triggeered here, and if it is, there
exists something spurious. Hence we should not ignore the failure.
|
| | | |
| | | |
| | | |
| | | | |
This should not change anything effectively.
|
|\ \ \ \
| | | | |
| | | | | |
udev: check existence of device node
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
Previously, the stack directory contains empty regular files named with
device ID, and we create sd_device object from the device name.
Hence, we implicitly checked the existence of the device node.
However, now the files in the stack directory are symlink, and we
retrieve the path to the device node and its priority from the symlink.
Hence, the existence of the device node is not checked.
Let's check if the device node is still exist.
|
| | |_|/
| |/| |
| | | |
| | | | |
No functional changes, just refactoring.
|
| |/ /
|/| |
| | |
| | | |
Follow-up for 790da548b0c37af60aed2f46867ba3885ea78718.
|
|\ \ \
| |/ /
|/| | |
udev: open with O_NOCTTY
|