Lines Matching refs:dev

257 static void log_unknown_owner(sd_device *dev, UdevRules *rules, int error, const char *entity, cons…  in log_unknown_owner()  argument
259 log_rule_error(dev, rules, "Unknown %s '%s', ignoring", entity, name); in log_unknown_owner()
261 … log_rule_error_errno(dev, rules, error, "Failed to resolve %s '%s', ignoring: %m", entity, name); in log_unknown_owner()
1375 static bool token_match_attr(UdevRules *rules, UdevRuleToken *token, sd_device *dev, UdevEvent *eve… in token_match_attr() argument
1383 assert(dev); in token_match_attr()
1392 log_rule_debug(dev, rules, in token_match_attr()
1402 … if (device_get_sysattr_value_maybe_from_netlink(dev, &event->rtnl, name, &value) < 0) in token_match_attr()
1472 static int import_parent_into_properties(sd_device *dev, const char *filter) { in import_parent_into_properties() argument
1477 assert(dev); in import_parent_into_properties()
1480 r = sd_device_get_parent(dev, &parent); in import_parent_into_properties()
1489 r = device_add_property(dev, key, val); in import_parent_into_properties()
1543 sd_device *dev, in udev_rule_apply_token_to_event() argument
1553 assert(dev); in udev_rule_apply_token_to_event()
1567 r = sd_device_get_action(dev, &a); in udev_rule_apply_token_to_event()
1569 … return log_rule_error_errno(dev, rules, r, "Failed to get uevent action type: %m"); in udev_rule_apply_token_to_event()
1576 r = sd_device_get_devpath(dev, &val); in udev_rule_apply_token_to_event()
1578 return log_rule_error_errno(dev, rules, r, "Failed to get devpath: %m"); in udev_rule_apply_token_to_event()
1586 r = sd_device_get_sysname(dev, &val); in udev_rule_apply_token_to_event()
1588 return log_rule_error_errno(dev, rules, r, "Failed to get sysname: %m"); in udev_rule_apply_token_to_event()
1595 FOREACH_DEVICE_DEVLINK(dev, val) in udev_rule_apply_token_to_event()
1605 if (sd_device_get_property_value(dev, token->data, &val) < 0) in udev_rule_apply_token_to_event()
1625 FOREACH_DEVICE_TAG(dev, val) in udev_rule_apply_token_to_event()
1634 r = sd_device_get_subsystem(dev, &val); in udev_rule_apply_token_to_event()
1638 return log_rule_error_errno(dev, rules, r, "Failed to get subsystem: %m"); in udev_rule_apply_token_to_event()
1646 r = sd_device_get_driver(dev, &val); in udev_rule_apply_token_to_event()
1650 return log_rule_error_errno(dev, rules, r, "Failed to get driver: %m"); in udev_rule_apply_token_to_event()
1656 return token_match_attr(rules, token, dev, event); in udev_rule_apply_token_to_event()
1664 …log_rule_debug(dev, rules, "The sysctl entry name '%s' is truncated while substituting into '%s', " in udev_rule_apply_token_to_event()
1671 … return log_rule_error_errno(dev, rules, r, "Failed to read sysctl '%s': %m", buf); in udev_rule_apply_token_to_event()
1683 … log_rule_debug(dev, rules, "The file name '%s' is truncated while substituting into '%s', " in udev_rule_apply_token_to_event()
1693 r = sd_device_get_syspath(dev, &val); in udev_rule_apply_token_to_event()
1695 … return log_rule_error_errno(dev, rules, r, "Failed to get syspath: %m"); in udev_rule_apply_token_to_event()
1708 … return log_rule_error_errno(dev, rules, r, "Failed to test for the existence of '%s': %m", buf); in udev_rule_apply_token_to_event()
1727 … log_rule_debug(dev, rules, "The command '%s' is truncated while substituting into '%s', " in udev_rule_apply_token_to_event()
1732 log_rule_debug(dev, rules, "Running PROGRAM '%s'", buf); in udev_rule_apply_token_to_event()
1737 … log_rule_warning_errno(dev, rules, r, "Failed to execute \"%s\": %m", buf); in udev_rule_apply_token_to_event()
1739 … log_rule_debug(dev, rules, "Command \"%s\" returned %d (error)", buf, r); in udev_rule_apply_token_to_event()
1746 log_rule_debug(dev, rules, "Replaced %zu character(s) in result of \"%s\"", in udev_rule_apply_token_to_event()
1759 …log_rule_debug(dev, rules, "The file name '%s' to be imported is truncated while substituting into… in udev_rule_apply_token_to_event()
1764 log_rule_debug(dev, rules, "Importing properties from '%s'", buf); in udev_rule_apply_token_to_event()
1769 return log_rule_error_errno(dev, rules, errno, in udev_rule_apply_token_to_event()
1780 log_rule_debug_errno(dev, rules, r, in udev_rule_apply_token_to_event()
1789 log_rule_debug_errno(dev, rules, r, in udev_rule_apply_token_to_event()
1797 r = device_add_property(dev, key, value); in udev_rule_apply_token_to_event()
1799 return log_rule_error_errno(dev, rules, r, in udev_rule_apply_token_to_event()
1813 … log_rule_debug(dev, rules, "The command '%s' is truncated while substituting into '%s', " in udev_rule_apply_token_to_event()
1818 log_rule_debug(dev, rules, "Importing properties from results of '%s'", buf); in udev_rule_apply_token_to_event()
1823 … log_rule_warning_errno(dev, rules, r, "Failed to execute '%s', ignoring: %m", buf); in udev_rule_apply_token_to_event()
1825 … log_rule_debug(dev, rules, "Command \"%s\" returned %d (error), ignoring", buf, r); in udev_rule_apply_token_to_event()
1845 log_rule_warning_errno(dev, rules, r, in udev_rule_apply_token_to_event()
1855 log_rule_debug_errno(dev, rules, r, in udev_rule_apply_token_to_event()
1863 r = device_add_property(dev, key, value); in udev_rule_apply_token_to_event()
1865 return log_rule_error_errno(dev, rules, r, in udev_rule_apply_token_to_event()
1882 log_rule_debug(dev, rules, "Skipping builtin '%s' in IMPORT key", in udev_rule_apply_token_to_event()
1893 … log_rule_debug(dev, rules, "The builtin command '%s' is truncated while substituting into '%s', " in udev_rule_apply_token_to_event()
1898 … log_rule_debug(dev, rules, "Importing properties from results of builtin command '%s'", buf); in udev_rule_apply_token_to_event()
1900 r = udev_builtin_run(dev, &event->rtnl, cmd, buf, false); in udev_rule_apply_token_to_event()
1903 log_rule_debug_errno(dev, rules, r, "Failed to run builtin '%s': %m", buf); in udev_rule_apply_token_to_event()
1917 return log_rule_error_errno(dev, rules, r, in udev_rule_apply_token_to_event()
1921 r = device_add_property(dev, token->value, val); in udev_rule_apply_token_to_event()
1923 … return log_rule_error_errno(dev, rules, r, "Failed to add property '%s=%s': %m", in udev_rule_apply_token_to_event()
1932 return log_rule_error_errno(dev, rules, r, in udev_rule_apply_token_to_event()
1938 r = device_add_property(dev, token->value, value ?: "1"); in udev_rule_apply_token_to_event()
1940 … return log_rule_error_errno(dev, rules, r, "Failed to add property '%s=%s': %m", in udev_rule_apply_token_to_event()
1950 … log_rule_debug(dev, rules, "The property name '%s' is truncated while substituting into '%s', " in udev_rule_apply_token_to_event()
1955 r = import_parent_into_properties(dev, buf); in udev_rule_apply_token_to_event()
1957 return log_rule_error_errno(dev, rules, r, in udev_rule_apply_token_to_event()
1971 device_set_db_persist(dev); in udev_rule_apply_token_to_event()
1982 device_set_devlink_priority(dev, PTR_TO_INT(token->data)); in udev_rule_apply_token_to_event()
1994 … log_device_uevent(dev, "The log level is changed to 'debug' while processing device"); in udev_rule_apply_token_to_event()
2012 … log_rule_warning(dev, rules, "The user name '%s' is truncated while substituting into '%s', " in udev_rule_apply_token_to_event()
2019 log_unknown_owner(dev, rules, r, "user", owner); in udev_rule_apply_token_to_event()
2021 log_rule_debug(dev, rules, "OWNER %s(%u)", owner, event->uid); in udev_rule_apply_token_to_event()
2036 … log_rule_warning(dev, rules, "The group name '%s' is truncated while substituting into '%s', " in udev_rule_apply_token_to_event()
2043 log_unknown_owner(dev, rules, r, "group", group); in udev_rule_apply_token_to_event()
2045 log_rule_debug(dev, rules, "GROUP %s(%u)", group, event->gid); in udev_rule_apply_token_to_event()
2059 … log_rule_warning(dev, rules, "The mode '%s' is truncated while substituting into %s, " in udev_rule_apply_token_to_event()
2066 … log_rule_error_errno(dev, rules, r, "Failed to parse mode '%s', ignoring: %m", mode_str); in udev_rule_apply_token_to_event()
2068 log_rule_debug(dev, rules, "MODE %#o", event->mode); in udev_rule_apply_token_to_event()
2079 log_rule_debug(dev, rules, "OWNER %u", event->uid); in udev_rule_apply_token_to_event()
2089 log_rule_debug(dev, rules, "GROUP %u", event->gid); in udev_rule_apply_token_to_event()
2099 log_rule_debug(dev, rules, "MODE %#o", event->mode); in udev_rule_apply_token_to_event()
2112 … log_rule_warning(dev, rules, "The security label '%s' is truncated while substituting into '%s', " in udev_rule_apply_token_to_event()
2131 … return log_rule_error_errno(dev, rules, r, "Failed to store SECLABEL{%s}='%s': %m", name, label);; in udev_rule_apply_token_to_event()
2133 log_rule_debug(dev, rules, "SECLABEL{%s}='%s'", name, label); in udev_rule_apply_token_to_event()
2148 r = device_add_property(dev, name, NULL); in udev_rule_apply_token_to_event()
2150 … return log_rule_error_errno(dev, rules, r, "Failed to remove property '%s': %m", name); in udev_rule_apply_token_to_event()
2155 sd_device_get_property_value(dev, name, &val) >= 0) { in udev_rule_apply_token_to_event()
2158 … log_rule_warning(dev, rules, "The buffer for the property '%s' is full, " in udev_rule_apply_token_to_event()
2166 … log_rule_warning(dev, rules, "The property value '%s' is truncated while substituting into '%s', " in udev_rule_apply_token_to_event()
2174 … log_rule_debug(dev, rules, "Replaced %zu slash(es) from result of ENV{%s}%s=\"%s\"", in udev_rule_apply_token_to_event()
2178 r = device_add_property(dev, name, value_new); in udev_rule_apply_token_to_event()
2180 … return log_rule_error_errno(dev, rules, r, "Failed to add property '%s=%s': %m", name, value_new); in udev_rule_apply_token_to_event()
2189 … log_rule_warning(dev, rules, "The tag name '%s' is truncated while substituting into '%s'," in udev_rule_apply_token_to_event()
2196 device_cleanup_tags(dev); in udev_rule_apply_token_to_event()
2199 log_rule_error(dev, rules, "Invalid tag name '%s', ignoring", buf); in udev_rule_apply_token_to_event()
2203 device_remove_tag(dev, buf); in udev_rule_apply_token_to_event()
2205 r = device_add_tag(dev, buf, true); in udev_rule_apply_token_to_event()
2207 … return log_rule_error_errno(dev, rules, r, "Failed to add tag '%s': %m", buf); in udev_rule_apply_token_to_event()
2221 if (sd_device_get_ifindex(dev, NULL) < 0) { in udev_rule_apply_token_to_event()
2222 log_rule_error(dev, rules, in udev_rule_apply_token_to_event()
2230 …log_rule_warning(dev, rules, "The network interface name '%s' is truncated while substituting into… in udev_rule_apply_token_to_event()
2241 … log_rule_debug(dev, rules, "Replaced %zu character(s) from result of NAME=\"%s\"", in udev_rule_apply_token_to_event()
2248 log_rule_debug(dev, rules, "NAME '%s'", event->name); in udev_rule_apply_token_to_event()
2258 if (sd_device_get_devnum(dev, NULL) < 0) in udev_rule_apply_token_to_event()
2263 device_cleanup_devlinks(dev); in udev_rule_apply_token_to_event()
2268 …log_rule_warning(dev, rules, "The symbolic link path '%s' is truncated while substituting into '%s… in udev_rule_apply_token_to_event()
2280 … log_rule_debug(dev, rules, "Replaced %zu character(s) from result of SYMLINK=\"%s\"", in udev_rule_apply_token_to_event()
2297 r = device_add_devlink(dev, filename); in udev_rule_apply_token_to_event()
2299 … return log_rule_error_errno(dev, rules, r, "Failed to add devlink '%s': %m", filename); in udev_rule_apply_token_to_event()
2301 log_rule_debug(dev, rules, "LINK '%s'", p); in udev_rule_apply_token_to_event()
2312 sd_device_get_syspath(dev, &val) >= 0) { in udev_rule_apply_token_to_event()
2315 log_rule_warning(dev, rules, in udev_rule_apply_token_to_event()
2324 … log_rule_error_errno(dev, rules, r, "Could not find file matches '%s', ignoring: %m", buf); in udev_rule_apply_token_to_event()
2329 …log_rule_warning(dev, rules, "The attribute value '%s' is truncated while substituting into '%s', " in udev_rule_apply_token_to_event()
2334 log_rule_debug(dev, rules, "ATTR '%s' writing '%s'", buf, value); in udev_rule_apply_token_to_event()
2341 … log_rule_error_errno(dev, rules, r, "Failed to write ATTR{%s}, ignoring: %m", buf); in udev_rule_apply_token_to_event()
2350 …log_rule_warning(dev, rules, "The sysctl entry name '%s' is truncated while substituting into '%s'… in udev_rule_apply_token_to_event()
2357 … log_rule_warning(dev, rules, "The sysctl value '%s' is truncated while substituting into '%s', " in udev_rule_apply_token_to_event()
2363 log_rule_debug(dev, rules, "SYSCTL '%s' writing '%s'", buf, value); in udev_rule_apply_token_to_event()
2366 … log_rule_error_errno(dev, rules, r, "Failed to write SYSCTL{%s}='%s', ignoring: %m", buf, value); in udev_rule_apply_token_to_event()
2385 … log_rule_warning(dev, rules, "The command '%s' is truncated while substituting into '%s', " in udev_rule_apply_token_to_event()
2398 … return log_rule_error_errno(dev, rules, r, "Failed to store command '%s': %m", cmd); in udev_rule_apply_token_to_event()
2402 log_rule_debug(dev, rules, "RUN '%s'", token->value); in udev_rule_apply_token_to_event()
2434 event->dev_parent = ASSERT_PTR(event->dev); in udev_rule_apply_parent_token_to_event()
2473 r = sd_device_get_action(event->dev, &action); in udev_rule_apply_line_to_event()
2478 if (sd_device_get_devnum(event->dev, NULL) >= 0) in udev_rule_apply_line_to_event()
2481 if (sd_device_get_ifindex(event->dev, NULL) >= 0) in udev_rule_apply_line_to_event()
2490 … DEVICE_TRACE_POINT(rules_apply_line, event->dev, line->rule_file->filename, line->line_number); in udev_rule_apply_line_to_event()
2507 …r = udev_rule_apply_token_to_event(rules, event->dev, event, timeout_usec, timeout_signal, propert… in udev_rule_apply_line_to_event()