1
0
mirror of https://github.com/systemd/systemd.git synced 2024-12-22 17:35:35 +03:00
systemd/shell-completion/bash
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 fix(SC2148): add ShellCheck directive to bash completion scripts 2024-02-27 15:41:28 +01:00
homectl user-record: Add preferredSession{Type,Launcher} 2024-03-01 16:28:10 +00:00
hostnamectl fix(SC2148): add ShellCheck directive to bash completion scripts 2024-02-27 15:41:28 +01:00
importctl shell completion: add bash completion for importctl 2024-04-26 12:07:53 +03:00
journalctl journalctl: add --list-invocations command and -I/--invocation options 2024-08-01 07:31:44 +09:00
kernel-install fix(SC2148): add ShellCheck directive to bash completion scripts 2024-02-27 15:41:28 +01:00
localectl localectl: introduce -l/--full option 2024-08-02 09:33:46 +02:00
loginctl fix(SC2148): add ShellCheck directive to bash completion scripts 2024-02-27 15:41:28 +01:00
machinectl shell completion: fix machinectl import-{tar,raw} 2024-04-26 12:10:30 +03:00
meson.build shell completion: add systemd-creds 2024-12-12 00:14:42 +00:00
networkctl networkctl: introduce --no-ask-password option 2024-08-19 11:28:22 +09:00
oomctl fix(SC2148): add ShellCheck directive to bash completion scripts 2024-02-27 15:41:28 +01:00
portablectl bash completion: add missing parameters for portablectl 2024-04-18 10:47:29 +01:00
resolvectl resolvectl: introduce --no-ask-password option 2024-08-19 11:36:22 +09:00
run0 shell-completion: add bash-completion for run0 command 2024-04-26 18:45:13 +03:00
systemctl.in Bash completion: no more ANSI colorcode in pathnames 2024-12-02 16:56:12 +00:00
systemd-analyze shell-completion: add smbios11 verb to systemd-analyze 2024-12-13 11:43:48 +00:00
systemd-cat shell-completion: add systemd-cat --namespace= 2024-03-14 13:07:19 +00:00
systemd-cgls fix(SC2148): add ShellCheck directive to bash completion scripts 2024-02-27 15:41:28 +01:00
systemd-cgtop fix(SC2148): add ShellCheck directive to bash completion scripts 2024-02-27 15:41:28 +01:00
systemd-confext fix(SC2148): add ShellCheck directive to bash completion scripts 2024-02-27 15:41:28 +01:00
systemd-creds bash-completion/creds: generate suggestions by systemd-creds itself 2024-12-12 15:25:38 +09:00
systemd-cryptenroll bash-completion: add --list-devices to systemd-cryptenroll 2024-11-22 10:38:19 +01:00
systemd-delta fix(SC2148): add ShellCheck directive to bash completion scripts 2024-02-27 15:41:28 +01:00
systemd-detect-virt fix(SC2148): add ShellCheck directive to bash completion scripts 2024-02-27 15:41:28 +01:00
systemd-dissect fix(SC2148): add ShellCheck directive to bash completion scripts 2024-02-27 15:41:28 +01:00
systemd-id128 id128: add 'var-partition-uuid' verb 2024-07-17 18:05:40 +02:00
systemd-nspawn Revert "nspawn: Allow specifying custom init program" 2024-08-22 22:20:42 +02:00
systemd-path fix(SC2148): add ShellCheck directive to bash completion scripts 2024-02-27 15:41:28 +01:00
systemd-resolve fix(SC2148): add ShellCheck directive to bash completion scripts 2024-02-27 15:41:28 +01:00
systemd-run systemd-run: add unit and invocation_id JSON output 2024-08-12 20:19:01 +02:00
systemd-sysext fix(SC2148): add ShellCheck directive to bash completion scripts 2024-02-27 15:41:28 +01:00
systemd-vmspawn shell-completion: add bash completion for systemd-vmspawn 2024-05-01 20:47:59 +03:00
systemd-vpick shell-completion: add bash-completion for systemd-vpick command 2024-04-26 18:45:13 +03:00
timedatectl fix(SC2148): add ShellCheck directive to bash completion scripts 2024-02-27 15:41:28 +01:00
udevadm udev: add option to trigger parent devices despite filters 2024-12-16 15:43:52 +01:00