<term><option>-t</option></term>
<term><option>--type=<replaceable>TYPE</replaceable></option></term>
<listitem>
- <para>Trigger a specific type of devices. Valid types are:
- <command>devices</command>, <command>subsystems</command>.
- The default value is <command>devices</command>.</para>
+ <para>Trigger a specific type of devices. Valid types are <literal>all</literal>,
+ <literal>devices</literal>, and <literal>subsystems</literal>. The default value is
+ <literal>devices</literal>.</para>
</listitem>
</varlistentry>
<varlistentry>
if __contains_word "$prev" ${OPTS[TRIGGER_ARG]}; then
case $prev in
-t|--type)
- comps='devices subsystems'
+ comps='all devices subsystems'
;;
-c|--action)
comps=$( udevadm trigger --action help )
'--verbose[Print the list of devices which will be triggered.]' \
'--dry-run[Do not actually trigger the event.]' \
'--quiet[Suppress error logging in triggering events.]' \
- '--type=[Trigger a specific type of devices.]:types:(devices subsystems failed)' \
+ '--type=[Trigger a specific type of devices.]:types:(all devices subsystems failed)' \
'--action=[Type of event to be triggered.]:actions:(add change remove move online offline bind unbind)' \
'--subsystem-match=[Trigger events for devices which belong to a matching subsystem.]' \
'--subsystem-nomatch=[Do not trigger events for devices which belong to a matching subsystem.]' \
enum {
TYPE_DEVICES,
TYPE_SUBSYSTEMS,
+ TYPE_ALL,
} device_type = TYPE_DEVICES;
sd_device_action_t action = SD_DEVICE_CHANGE;
_cleanup_(sd_device_enumerator_unrefp) sd_device_enumerator *e = NULL;
device_type = TYPE_DEVICES;
else if (streq(optarg, "subsystems"))
device_type = TYPE_SUBSYSTEMS;
+ else if (streq(optarg, "all"))
+ device_type = TYPE_ALL;
else
return log_error_errno(SYNTHETIC_ERRNO(EINVAL), "Unknown type --type=%s", optarg);
break;
if (r < 0)
return log_error_errno(r, "Failed to scan devices: %m");
break;
+ case TYPE_ALL:
+ r = device_enumerator_scan_devices_and_subsystems(e);
+ if (r < 0)
+ return log_error_errno(r, "Failed to scan devices and subsystems: %m");
+ break;
default:
assert_not_reached();
}