Home
last modified time | relevance | path

Searched refs:dev (Results 1 – 25 of 262) sorted by relevance

1234567891011

/systemd-251/src/udev/
Dudev-builtin-net_id.c76 static sd_device *skip_virtio(sd_device *dev) { in skip_virtio() argument
80 while (dev) { in skip_virtio()
83 if (sd_device_get_subsystem(dev, &subsystem) < 0) in skip_virtio()
89 if (sd_device_get_parent(dev, &dev) < 0) in skip_virtio()
93 return dev; in skip_virtio()
167 static int dev_pci_onboard(sd_device *dev, const LinkInfo *info, NetNames *names) { in dev_pci_onboard() argument
174 assert(dev); in dev_pci_onboard()
201 if (sd_device_get_sysattr_value(dev, "dev_port", &attr) >= 0) { in dev_pci_onboard()
204 log_device_debug_errno(dev, r, "Failed to parse dev_port, ignoring: %m"); in dev_pci_onboard()
205 log_device_debug(dev, "dev_port=%lu", dev_port); in dev_pci_onboard()
[all …]
Dudev-node.c67 static int node_symlink(sd_device *dev, const char *node, const char *slink) { in node_symlink() argument
73 assert(dev); in node_symlink()
79 return log_device_debug_errno(dev, SYNTHETIC_ERRNO(EEXIST), in node_symlink()
82 return log_device_debug_errno(dev, errno, "Failed to lstat() '%s': %m", slink); in node_symlink()
86 … return log_device_debug_errno(dev, r, "Failed to get parent directory of '%s': %m", slink); in node_symlink()
91 …return log_device_debug_errno(dev, r, "Failed to get relative path from '%s' to '%s': %m", slink, … in node_symlink()
93 r = device_get_device_id(dev, &id); in node_symlink()
95 return log_device_debug_errno(dev, r, "Failed to get device id: %m"); in node_symlink()
102 …return log_device_debug_errno(dev, r, "Failed to create symlink '%s' to '%s': %m", slink_tmp, targ… in node_symlink()
105 … r = log_device_debug_errno(dev, errno, "Failed to rename '%s' to '%s': %m", slink_tmp, slink); in node_symlink()
[all …]
Dudev-event.c56 UdevEvent *udev_event_new(sd_device *dev, usec_t exec_delay_usec, sd_netlink *rtnl, int log_level) { in udev_event_new() argument
59 assert(dev); in udev_event_new()
66 .dev = sd_device_ref(dev), in udev_event_new()
84 sd_device_unref(event->dev); in udev_event_free()
244 sd_device *parent, *dev = event->dev; in udev_event_subst_format() local
252 r = sd_device_get_devpath(dev, &val); in udev_event_subst_format()
258 r = sd_device_get_sysname(dev, &val); in udev_event_subst_format()
264 r = sd_device_get_sysnum(dev, &val); in udev_event_subst_format()
293 r = sd_device_get_devnum(dev, &devnum); in udev_event_subst_format()
330 log_device_debug(dev, "requested part of result string not found"); in udev_event_subst_format()
[all …]
Dudev-builtin-blkid.c29 static void print_property(sd_device *dev, bool test, const char *name, const char *value) { in print_property() argument
35 udev_builtin_add_property(dev, test, "ID_FS_TYPE", value); in print_property()
38 udev_builtin_add_property(dev, test, "ID_FS_USAGE", value); in print_property()
41 udev_builtin_add_property(dev, test, "ID_FS_VERSION", value); in print_property()
45 udev_builtin_add_property(dev, test, "ID_FS_UUID", s); in print_property()
47 udev_builtin_add_property(dev, test, "ID_FS_UUID_ENC", s); in print_property()
51 udev_builtin_add_property(dev, test, "ID_FS_UUID_SUB", s); in print_property()
53 udev_builtin_add_property(dev, test, "ID_FS_UUID_SUB_ENC", s); in print_property()
57 udev_builtin_add_property(dev, test, "ID_FS_LABEL", s); in print_property()
59 udev_builtin_add_property(dev, test, "ID_FS_LABEL_ENC", s); in print_property()
[all …]
Dudev-builtin-keyboard.c20 static int install_force_release(sd_device *dev, const unsigned *release, unsigned release_count) { in install_force_release() argument
29 assert(dev); in install_force_release()
32 r = sd_device_get_parent_with_subsystem_devtype(dev, "serio", NULL, &atkbd); in install_force_release()
34 return log_device_error_errno(dev, r, "Failed to get serio parent: %m"); in install_force_release()
58 static int map_keycode(sd_device *dev, int fd, int scancode, const char *keycode) { in map_keycode() argument
75 … return log_device_error_errno(dev, r, "Failed to parse key identifier '%s': %m", keycode); in map_keycode()
81 log_device_debug(dev, "keyboard: mapping scan code %d (0x%x) to key code %d (0x%x)", in map_keycode()
85 …return log_device_error_errno(dev, errno, "Failed to call EVIOCSKEYCODE with scan code 0x%x, and k… in map_keycode()
110 static int override_abs(sd_device *dev, int fd, unsigned evcode, const char *value) { in override_abs() argument
115 return log_device_error_errno(dev, errno, "Failed to call EVIOCGABS"); in override_abs()
[all …]
Dudevd.c129 sd_device *dev; member
181 sd_device_unref(event->dev); in event_free()
375 static void device_broadcast(sd_device_monitor *monitor, sd_device *dev, EventResult result) { in device_broadcast() argument
378 assert(dev); in device_broadcast()
385 (void) device_add_property(dev, "UDEV_WORKER_FAILED", "1"); in device_broadcast()
391 (void) device_add_propertyf(dev, "UDEV_WORKER_ERRNO", "%i", -result); in device_broadcast()
395 (void) device_add_property(dev, "UDEV_WORKER_ERRNO_NAME", str); in device_broadcast()
399 …(void) device_add_propertyf(dev, "UDEV_WORKER_EXIT_STATUS", "%i", result - EVENT_RESULT_EXIT_STATU… in device_broadcast()
409 … (void) device_add_propertyf(dev, "UDEV_WORKER_SIGNAL", "%i", result - EVENT_RESULT_SIGNAL_BASE); in device_broadcast()
413 (void) device_add_property(dev, "UDEV_WORKER_SIGNAL_NAME", str); in device_broadcast()
[all …]
Dudev-watch.c44 _cleanup_(sd_device_unrefp) sd_device *dev = NULL; in udev_watch_restore()
56 r = device_new_from_watch_handle_at(&dev, dirfd(dir), wd); in udev_watch_restore()
64 log_device_debug(dev, "Restoring old watch"); in udev_watch_restore()
65 (void) udev_watch_begin(inotify_fd, dev); in udev_watch_restore()
76 int udev_watch_begin(int inotify_fd, sd_device *dev) { in udev_watch_begin() argument
81 assert(dev); in udev_watch_begin()
83 r = sd_device_get_devname(dev, &devnode); in udev_watch_begin()
85 return log_device_debug_errno(dev, r, "Failed to get device name: %m"); in udev_watch_begin()
87 log_device_debug(dev, "Adding watch on '%s'", devnode); in udev_watch_begin()
92 r = log_device_full_errno(dev, ignore ? LOG_DEBUG : LOG_WARNING, errno, in udev_watch_begin()
[all …]
Dudev-builtin-input_id.c48 static void extract_info(sd_device *dev, bool test) { in extract_info() argument
53 fd = sd_device_open(dev, O_RDONLY|O_CLOEXEC|O_NONBLOCK); in extract_info()
67 udev_builtin_add_property(dev, test, "ID_INPUT_WIDTH_MM", width); in extract_info()
68 udev_builtin_add_property(dev, test, "ID_INPUT_HEIGHT_MM", height); in extract_info()
131 static struct input_id get_input_id(sd_device *dev) { in get_input_id() argument
135 if (sd_device_get_sysattr_value(dev, "id/bustype", &v) >= 0) in get_input_id()
137 if (sd_device_get_sysattr_value(dev, "id/vendor", &v) >= 0) in get_input_id()
139 if (sd_device_get_sysattr_value(dev, "id/product", &v) >= 0) in get_input_id()
141 if (sd_device_get_sysattr_value(dev, "id/version", &v) >= 0) in get_input_id()
148 static bool test_pointers(sd_device *dev, in test_pointers() argument
[all …]
Dudev-builtin-usb_id.c136 static int dev_if_packed_info(sd_device *dev, char *ifs_str, size_t len) { in dev_if_packed_info() argument
156 r = sd_device_get_syspath(dev, &syspath); in dev_if_packed_info()
163 return log_device_debug_errno(dev, errno, "Failed to open \"%s\": %m", filename); in dev_if_packed_info()
167 return log_device_warning_errno(dev, SYNTHETIC_ERRNO(EIO), in dev_if_packed_info()
182 return log_device_debug_errno(dev, SYNTHETIC_ERRNO(EIO), in dev_if_packed_info()
227 static int builtin_usb_id(sd_device *dev, sd_netlink **rtnl, int argc, char *argv[], bool test) { in builtin_usb_id() argument
253 assert(dev); in builtin_usb_id()
255 r = sd_device_get_syspath(dev, &syspath); in builtin_usb_id()
259 r = sd_device_get_sysname(dev, &sysname); in builtin_usb_id()
264 if (sd_device_get_devtype(dev, &devtype) >= 0 && streq(devtype, "usb_device")) { in builtin_usb_id()
[all …]
Dudev-builtin-hwdb.c20 int udev_builtin_hwdb_lookup(sd_device *dev, in udev_builtin_hwdb_lookup() argument
41 r = udev_builtin_add_property(dev, test, key, value); in udev_builtin_hwdb_lookup()
49 static const char *modalias_usb(sd_device *dev, char *s, size_t size) { in modalias_usb() argument
53 if (sd_device_get_sysattr_value(dev, "idVendor", &v) < 0) in modalias_usb()
55 if (sd_device_get_sysattr_value(dev, "idProduct", &p) < 0) in modalias_usb()
61 (void) sd_device_get_sysattr_value(dev, "product", &n); in modalias_usb()
67 static int udev_builtin_hwdb_search(sd_device *dev, sd_device *srcdev, in udev_builtin_hwdb_search() argument
74 assert(dev); in udev_builtin_hwdb_search()
77 srcdev = dev; in udev_builtin_hwdb_search()
105 log_device_debug(dev, "hwdb modalias key: \"%s\"", modalias); in udev_builtin_hwdb_search()
[all …]
Dudev-rules.c257 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()
[all …]
Dudev-builtin-net_setup_link.c13 static int builtin_net_setup_link(sd_device *dev, sd_netlink **rtnl, int argc, char **argv, bool te… in builtin_net_setup_link() argument
18 … return log_device_error_errno(dev, SYNTHETIC_ERRNO(EINVAL), "This program takes no arguments."); in builtin_net_setup_link()
20 r = link_new(ctx, rtnl, dev, &link); in builtin_net_setup_link()
22 … log_device_debug_errno(dev, r, "Link vanished while getting information, ignoring."); in builtin_net_setup_link()
26 return log_device_warning_errno(dev, r, "Failed to get link information: %m"); in builtin_net_setup_link()
29 udev_builtin_add_property(dev, test, "ID_NET_DRIVER", link->driver); in builtin_net_setup_link()
34 … log_device_debug_errno(dev, r, "No matching link configuration found, ignoring device."); in builtin_net_setup_link()
38 return log_device_error_errno(dev, r, "Failed to get link config: %m"); in builtin_net_setup_link()
43 … log_device_debug_errno(dev, r, "Link vanished while applying configuration, ignoring."); in builtin_net_setup_link()
45 … log_device_warning_errno(dev, r, "Could not apply link configuration, ignoring: %m"); in builtin_net_setup_link()
[all …]
Dtest-udev-netlink.c13 _cleanup_(sd_device_unrefp) sd_device *dev = NULL, *dev_with_netlink = NULL; in test_link_info_one()
20 assert_se(sd_device_new_from_ifindex(&dev, ifindex) >= 0); in test_link_info_one()
25 assert_se(sd_device_get_sysattr_value(dev, "type", &s) >= 0); in test_link_info_one()
34 assert_se(sd_device_get_sysattr_value(dev, "addr_len", &s) >= 0); in test_link_info_one()
43 assert_se(sd_device_get_sysattr_value(dev, "address", &s) >= 0); in test_link_info_one()
50 assert_se(sd_device_get_sysattr_value(dev, "broadcast", &s) >= 0); in test_link_info_one()
57 assert_se(sd_device_get_sysname(dev, &s) >= 0); in test_link_info_one()
64 assert_se(sd_device_get_sysattr_value(dev, "mtu", &s) >= 0); in test_link_info_one()
73 assert_se(sd_device_get_sysattr_value(dev, "iflink", &s) >= 0); in test_link_info_one()
82 assert_se(sd_device_get_sysattr_value(dev, "link_mode", &s) >= 0); in test_link_info_one()
[all …]
/systemd-251/mkosi.default.d/ubuntu/
D10-mkosi.ubuntu21 libacl1-dev
22 libaudit-dev
23 libblkid-dev
24 libbz2-dev
25 libcap-dev
26 libcryptsetup-dev
27 libcurl4-gnutls-dev
28 libdbus-1-dev
29 libdw-dev
30 libfdisk-dev
[all …]
/systemd-251/mkosi.default.d/debian/
D10-mkosi.debian22 libacl1-dev
23 libaudit-dev
24 libblkid-dev
25 libbpf-dev
26 libbz2-dev
27 libcap-dev
28 libcryptsetup-dev
29 libcurl4-gnutls-dev
30 libdbus-1-dev
31 libdw-dev
[all …]
/systemd-251/src/libsystemd/sd-device/
Dtest-sd-device.c20 _cleanup_(sd_device_unrefp) sd_device *dev = NULL; in test_sd_device_one()
33 assert_se(sd_device_new_from_syspath(&dev, syspath) >= 0); in test_sd_device_one()
34 assert_se(sd_device_get_syspath(dev, &val) >= 0); in test_sd_device_one()
36 dev = sd_device_unref(dev); in test_sd_device_one()
38 assert_se(sd_device_new_from_path(&dev, syspath) >= 0); in test_sd_device_one()
39 assert_se(sd_device_get_syspath(dev, &val) >= 0); in test_sd_device_one()
41 dev = sd_device_unref(dev); in test_sd_device_one()
47 r = sd_device_new_from_ifindex(&dev, ifindex); in test_sd_device_one()
54 assert_se(sd_device_get_syspath(dev, &val) >= 0); in test_sd_device_one()
56 dev = sd_device_unref(dev); in test_sd_device_one()
[all …]
/systemd-251/src/core/
Ddevice.c33 static int device_dispatch_io(sd_device_monitor *monitor, sd_device *dev, void *userdata);
369 static int device_update_description(Unit *u, sd_device *dev, const char *path) { in device_update_description() argument
379 if (dev && in device_update_description()
380 (sd_device_get_property_value(dev, "ID_MODEL_FROM_DATABASE", &model) >= 0 || in device_update_description()
381 sd_device_get_property_value(dev, "ID_MODEL", &model) >= 0)) { in device_update_description()
385 if (sd_device_get_property_value(dev, "ID_FS_LABEL", &label) >= 0 || in device_update_description()
386 sd_device_get_property_value(dev, "ID_PART_ENTRY_NAME", &label) >= 0 || in device_update_description()
387 sd_device_get_property_value(dev, "ID_PART_ENTRY_NUMBER", &label) >= 0) { in device_update_description()
402 static int device_add_udev_wants(Unit *u, sd_device *dev) { in device_add_udev_wants() argument
409 assert(dev); in device_add_udev_wants()
[all …]
/systemd-251/.github/workflows/
Dbuild_test.sh28 libblkid-dev
29 libbpf-dev
30 libc6-dev-i386
31 libcap-dev
32 libcurl4-gnutls-dev
33 libfdisk-dev
34 libfido2-dev
35 libgpg-error-dev
36 liblz4-dev
37 liblzma-dev
[all …]
Dunit_tests.sh12 libbpf-dev
13 libfdisk-dev
14 libfido2-dev
15 libp11-kit-dev
16 libpwquality-dev
17 libqrencode-dev
18 libssl-dev
19 libtss2-dev
20 libxkbcommon-dev
21 libzstd-dev
/systemd-251/test/units/
Dtestsuite-17.04.sh10 udevadm info /dev/null | grep -E 'E: (TAGS|CURRENT_TAGS)=.*:(added|changed):' && exit 1
19 SYSTEMD_LOG_LEVEL=debug udevadm trigger --verbose --settle --action add /dev/null
23 udevadm info /dev/null | grep -q 'E: TAGS=.*:added:.*'
24 udevadm info /dev/null | grep -q 'E: CURRENT_TAGS=.*:added:.*'
25 udevadm info /dev/null | grep -q 'E: TAGS=.*:changed:.*' && { echo 'unexpected TAGS='; exit 1; }
26 udevadm info /dev/null | grep -q 'E: CURRENT_TAGS=.*:changed:.*' && { echo 'unexpected CURRENT_TAGS…
28 SYSTEMD_LOG_LEVEL=debug udevadm trigger --verbose --settle --action change /dev/null
32 udevadm info /dev/null | grep -q 'E: TAGS=.*:added:.*'
33 udevadm info /dev/null | grep -q 'E: CURRENT_TAGS=.*:added:.*' && { echo 'unexpected CURRENT_TAGS='…
34 udevadm info /dev/null | grep -q 'E: TAGS=.*:changed:.*'
[all …]
Dtestsuite-17.01.sh10 udevadm trigger --settle /dev/sda
14 udevadm info /dev/sda | grep -q -v SYSTEMD_WANTS=foobar.service
15 udevadm info /dev/sda | grep -q -v SYSTEMD_WANTS=waldo.service
28 udevadm trigger --settle /dev/sda
32 udevadm info /dev/sda | grep -q SYSTEMD_WANTS=foobar.service
33 udevadm info /dev/sda | grep -q -v SYSTEMD_WANTS=waldo.service
46 udevadm trigger --settle /dev/sda
50 udevadm info /dev/sda | grep -q -v SYSTEMD_WANTS=foobar.service
51 udevadm info /dev/sda | grep -q SYSTEMD_WANTS=waldo.service
62 udevadm trigger --settle /dev/sda
[all …]
Dtestsuite-64.sh13 local dev link path paths target
36 dev="/dev/$(udevadm info -q name "$link")"
37 if [[ "$target" != "$dev" ]]; then
38 echo >&2 "ERROR: symlink '$link' points to '$target' but '$dev' was expected"
83 ls -l /dev/disk/by-id/
196 /dev/disk/by-id/ata-foobar_deadbeeflvm{0..3}
268 /dev/disk/by-id/ata-foobar_deadbeefbtrfs{0..3}
292 udevadm wait --settle --timeout=30 /dev/disk/by-partlabel/diskpart{1..4}
293 …udevadm lock --device="${devices[0]}" mkfs.btrfs -d single -m raid1 -L "$label" -U "$uuid" /dev/di…
298 udevadm wait --settle --timeout=30 --removed /dev/disk/by-partlabel/diskpart{1..4}
[all …]
/systemd-251/src/test/
Dtest-devnum-util.c11 dev_t dev; in TEST() local
13 assert_se(parse_devnum("", &dev) == -EINVAL); in TEST()
14 assert_se(parse_devnum("junk", &dev) == -EINVAL); in TEST()
15 assert_se(parse_devnum("0", &dev) == -EINVAL); in TEST()
16 assert_se(parse_devnum("5", &dev) == -EINVAL); in TEST()
17 assert_se(parse_devnum("5:", &dev) == -EINVAL); in TEST()
18 assert_se(parse_devnum(":5", &dev) == -EINVAL); in TEST()
19 assert_se(parse_devnum("-1:-1", &dev) == -EINVAL); in TEST()
21 assert_se(parse_devnum("4294967295:4294967295", &dev) == -EINVAL); in TEST()
23 assert_se(parse_devnum("8:11", &dev) >= 0 && major(dev) == 8 && minor(dev) == 11); in TEST()
[all …]
Dtest-udev.c29 _cleanup_(sd_device_unrefp) sd_device *dev = NULL; in device_new_from_synthetic_event()
41 r = sd_device_new_from_syspath(&dev, syspath); in device_new_from_synthetic_event()
45 r = device_read_uevent_file(dev); in device_new_from_synthetic_event()
49 r = device_set_action(dev, a); in device_new_from_synthetic_event()
53 *ret = TAKE_PTR(dev); in device_new_from_synthetic_event()
89 _cleanup_(sd_device_unrefp) sd_device *dev = NULL; in run()
130 r = device_new_from_synthetic_event(&dev, syspath, action); in run()
134 assert_se(event = udev_event_new(dev, 0, NULL, log_get_max_level())); in run()
139 if (sd_device_get_devname(dev, &devname) >= 0) { in run()
143 if (sd_device_get_subsystem(dev, &subsystem) >= 0 && streq(subsystem, "block")) in run()
[all …]
/systemd-251/src/login/
Dlogind-session-device.c37 major = major(sd->dev); in session_device_notify()
38 minor = minor(sd->dev); in session_device_notify()
241 static DeviceType detect_device_type(sd_device *dev) { in detect_device_type() argument
245 if (sd_device_get_sysname(dev, &sysname) < 0 || in detect_device_type()
246 sd_device_get_subsystem(dev, &subsystem) < 0) in detect_device_type()
263 sd_device *dev; in session_device_verify() local
266 r = sd_device_new_from_devnum(&p, 'c', sd->dev); in session_device_verify()
270 dev = p; in session_device_verify()
272 if (sd_device_get_syspath(dev, &sp) < 0 || in session_device_verify()
273 sd_device_get_devname(dev, &node) < 0) in session_device_verify()
[all …]

1234567891011