1
0
mirror of https://github.com/systemd/systemd.git synced 2025-01-03 05:18:09 +03:00
systemd/shell-completion/zsh
Federico Giovanardi 7fd45eec37 udev: add option to trigger parent devices despite filters
This commit add the `-i` option to `udevadm trigger` that force it to
match parent devices even if they're excluded from filters.
The rationale is that some embedded devices have a huge number of
platform devices ( ~ 4k for MX8 ) they are there because they're defined
in the device tree but there isn't any action or udev rules associated
with them.

So at boot a significant time is spend triggering and processing rules
for devices that don't produce any effect and we would like to filter
them by calling:

```
udevadm trigger --type=device --action=add -s block -s tty
```

instead of the normal

```
udevadm trigger --type=device --action=add
```

so we can use filter to filter out only subsystems for we we know that
we have rules in place that do something useful.

On the other side action / rules are not triggered until the parent is
triggered ( which is part of another subsystem), so the additional option
will allows udev to complete the coldplug with only the devices we care.

Example on iMX8:

.Without the new option
```
root@dev:~# udevadm trigger --dry-run  -s block --action=add -v
/sys/devices/platform/bus@5b000000/5b010000.mmc/mmc_host/mmc0/mmc0:0001/block/mmcblk0
/sys/devices/platform/bus@5b000000/5b010000.mmc/mmc_host/mmc0/mmc0:0001/block/mmcblk0/mmcblk0boot0
/sys/devices/platform/bus@5b000000/5b010000.mmc/mmc_host/mmc0/mmc0:0001/block/mmcblk0/mmcblk0boot1
/sys/devices/platform/bus@5b000000/5b010000.mmc/mmc_host/mmc0/mmc0:0001/block/mmcblk0/mmcblk0p1
/sys/devices/platform/bus@5b000000/5b010000.mmc/mmc_host/mmc0/mmc0:0001/block/mmcblk0/mmcblk0p2
/sys/devices/platform/bus@5b000000/5b010000.mmc/mmc_host/mmc0/mmc0:0001/block/mmcblk0/mmcblk0p3
/sys/devices/platform/bus@5b000000/5b010000.mmc/mmc_host/mmc0/mmc0:0001/block/mmcblk0/mmcblk0p4
```

.With the new option
```
root@dev:~# udevadm trigger --dry-run -i -s block --action=add -v
/sys/devices/platform
/sys/devices/platform/bus@5b000000
/sys/devices/platform/bus@5b000000/5b010000.mmc
/sys/devices/platform/bus@5b000000/5b010000.mmc/mmc_host/mmc0
/sys/devices/platform/bus@5b000000/5b010000.mmc/mmc_host/mmc0/mmc0:0001
/sys/devices/platform/bus@5b000000/5b010000.mmc/mmc_host/mmc0/mmc0:0001/block/mmcblk0
/sys/devices/platform/bus@5b000000/5b010000.mmc/mmc_host/mmc0/mmc0:0001/block/mmcblk0/mmcblk0boot0
/sys/devices/platform/bus@5b000000/5b010000.mmc/mmc_host/mmc0/mmc0:0001/block/mmcblk0/mmcblk0boot1
/sys/devices/platform/bus@5b000000/5b010000.mmc/mmc_host/mmc0/mmc0:0001/block/mmcblk0/mmcblk0p1
/sys/devices/platform/bus@5b000000/5b010000.mmc/mmc_host/mmc0/mmc0:0001/block/mmcblk0/mmcblk0p2
/sys/devices/platform/bus@5b000000/5b010000.mmc/mmc_host/mmc0/mmc0:0001/block/mmcblk0/mmcblk0p3
/sys/devices/platform/bus@5b000000/5b010000.mmc/mmc_host/mmc0/mmc0:0001/block/mmcblk0/mmcblk0p4
```
Boot time reduction with this is place is ~ 1 second.
2024-12-16 15:43:52 +01:00
..
_bootctl bootctl: add --random-seed=yes/no 2024-06-20 14:26:13 +09:00
_busctl busctl: rename --num-matches= → --limit-messages= 2024-10-29 16:50:06 +01:00
_coredumpctl improve zsh completion (#32098) 2024-04-15 10:58:48 +02:00
_hostnamectl improve zsh completion (#32098) 2024-04-15 10:58:48 +02:00
_journalctl improve zsh completion (#32098) 2024-04-15 10:58:48 +02:00
_kernel-install improve zsh completion (#32098) 2024-04-15 10:58:48 +02:00
_localectl localectl: introduce -l/--full option 2024-08-02 09:33:46 +02:00
_loginctl improve zsh completion (#32098) 2024-04-15 10:58:48 +02:00
_machinectl improve zsh completion (#32098) 2024-04-15 10:58:48 +02:00
_networkctl networkctl: introduce --no-ask-password option 2024-08-19 11:28:22 +09:00
_oomctl improve zsh completion (#32098) 2024-04-15 10:58:48 +02:00
_resolvectl resolvectl: introduce --no-ask-password option 2024-08-19 11:36:22 +09:00
_run0 zsh: add run0 completions 2024-07-04 01:21:43 +02:00
_sd_hosts_or_user_at_host license: LGPL-2.1+ -> LGPL-2.1-or-later 2020-11-09 13:23:58 +09:00
_sd_machines shell-completion/zsh: silence error when machinectl is not installed 2022-10-20 09:58:00 +02:00
_sd_outputmodes shared/logs-show: add new --output= format "short-delta" 2022-09-23 10:07:03 +02:00
_sd_unit_files license: LGPL-2.1+ -> LGPL-2.1-or-later 2020-11-09 13:23:58 +09:00
_systemctl.in shell-completion: zsh: fix incorrect unescaping 2024-08-15 20:28:12 +02:00
_systemd shell-completion: on zsh, systemd-cat is a precommand 2024-05-09 13:25:32 +02:00
_systemd-analyze shell-completion/analyze: add has-tpm2 2024-09-19 19:08:49 +09:00
_systemd-delta improve zsh completion (#32098) 2024-04-15 10:58:48 +02:00
_systemd-inhibit logind: drop new delay-weak inhibitor 2024-09-13 12:32:42 +02:00
_systemd-nspawn Revert "nspawn: Allow specifying custom init program" 2024-08-22 22:20:42 +02:00
_systemd-path improve zsh completion (#32098) 2024-04-15 10:58:48 +02:00
_systemd-run systemd-run: add unit and invocation_id JSON output 2024-08-12 20:19:01 +02:00
_systemd-tmpfiles improve zsh completion (#32098) 2024-04-15 10:58:48 +02:00
_timedatectl improve zsh completion (#32098) 2024-04-15 10:58:48 +02:00
_udevadm udev: add option to trigger parent devices despite filters 2024-12-16 15:43:52 +01:00
_varlinkctl zsh: update varlinkctl completions 2024-07-19 23:07:37 +02:00
meson.build zsh: add varlinkctl completions 2024-07-19 17:06:17 +02:00