Skip to content

udev: make udevadm test and test-builtin not destructive#31998

Merged
yuwata merged 2 commits intosystemd:mainfrom
yuwata:udev-event-mode
Mar 29, 2024
Merged

udev: make udevadm test and test-builtin not destructive#31998
yuwata merged 2 commits intosystemd:mainfrom
yuwata:udev-event-mode

Conversation

@yuwata
Copy link
Member

@yuwata yuwata commented Mar 28, 2024

No description provided.

No functional change, preparation for later commits.
@yuwata yuwata added the udev label Mar 28, 2024
@github-actions github-actions bot added btrfs build-system tests meson please-review PR is ready for (re-)review by a maintainer labels Mar 28, 2024
@bluca bluca added good-to-merge/with-minor-suggestions and removed please-review PR is ready for (re-)review by a maintainer labels Mar 28, 2024
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.
@yuwata yuwata added good-to-merge/waiting-for-ci 👍 PR is good to merge, but CI hasn't passed at time of review. Please merge if you see CI has passed and removed good-to-merge/with-minor-suggestions labels Mar 29, 2024
@yuwata yuwata merged commit fee6510 into systemd:main Mar 29, 2024
@yuwata yuwata deleted the udev-event-mode branch March 29, 2024 02:32
@github-actions github-actions bot removed the good-to-merge/waiting-for-ci 👍 PR is good to merge, but CI hasn't passed at time of review. Please merge if you see CI has passed label Mar 29, 2024
@ddiss
Copy link

ddiss commented Aug 19, 2024

FWIW, we used the "destructive" udevadm test behavior to manually initialize /sys/class/net/ devices prior to systemd-network invocation in lightweight (initramfs only) VMs.
It was working very well over the years, but fails as of 089bef6 (bisected).

@yuwata
Copy link
Member Author

yuwata commented Aug 19, 2024

udevadm test is for testing. You should use udevadm trigger for processing specific device(s).

Note, trigger command has --prioritized-subsystem=. So if you want to initialize network devices earlier, reorder prioritized subsystems in systemd-udev-trigger.service.

@ddiss
Copy link

ddiss commented Aug 19, 2024

udevadm test is for testing. You should use udevadm trigger for processing specific device(s).

udevadm test could be used standalone, while udevadm trigger (AFAICT) requires a running udevd. I realize it perhaps wasn't a standard environment, but it was nice for lightweight VM images.

Note, trigger command has --prioritized-subsystem=. So if you want to initialize network devices earlier, reorder prioritized subsystems in systemd-udev-trigger.service.

Thanks for the advice (and quick response)!

@yuwata
Copy link
Member Author

yuwata commented Aug 19, 2024

udevadm test is for testing. You should use udevadm trigger for processing specific device(s).

udevadm test could be used standalone, while udevadm trigger (AFAICT) requires a running udevd. I realize it perhaps wasn't a standard environment, but it was nice for lightweight VM images.

Interesting. But, (at least currently) such use case is not supported. If you'd like, please open an RFE about that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Development

Successfully merging this pull request may close these issues.

3 participants