Commit Graph

1145 Commits

Author SHA1 Message Date
Lennart Poettering a55d8bedd2
Merge pull request #10176 from yuwata/udev-cleanup-7
udev: replace udev_device by sd_device
2018-10-12 12:26:33 +02:00
Yu Watanabe be44b572f3 meson: fix '-Dstatic-libsystemd=true' or '-Dstatic-libudev=true'
Follow-up for a5d8835c78.
2018-10-12 17:54:23 +09:00
Yu Watanabe 5eddbba3a1 meson: do not use mempool from libudev.so
Follow-up for a5d8835c78.
2018-10-12 17:54:23 +09:00
Yu Watanabe 07a26e42da udev-builtin: move definitions related to builtin commands to udev-builtin.h 2018-10-11 04:21:14 +09:00
Yu Watanabe 7d68eb1bdf udev-ctrl: move prototypes of udev_ctrl_*() to udev-ctrl.h 2018-10-11 04:21:14 +09:00
Yu Watanabe a2554acec6 udev-node: replace udev_device by sd_device and modernize code a bit 2018-10-11 04:21:14 +09:00
Yu Watanabe 7006860271 udev-watch: replace udev_device by sd_device and modernize code a bit 2018-10-11 04:21:14 +09:00
Yu Watanabe da4bb75f59 udev: drop unused function udev_build_argv() 2018-10-11 04:21:14 +09:00
Lennart Poettering 083d27b654
Merge pull request #10152 from yuwata/udev-use-extract
udev: small cleanups
2018-10-05 17:11:43 +02:00
Joe Hershberger d81186ef4f udev: Allow acpi_index and index to be "0"
0 can be a valid index returned by the BIOS, so allow that by using the
parsing function safe_atolu() to check for errors without excluding the
valid value "0".

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
2018-10-02 22:58:15 +02:00
Susant Sahani 6cf0a20491 udev/net: add support for the equivalent of "ethtool advertise" to .link files
This work adds support for the equivalent of "ethtool advertise" to .link files?
http://lists.freedesktop.org/archives/systemd-devel/2015-April/030112.html
2018-09-26 22:21:42 +02:00
Yu Watanabe c1ee267489 udev: use path_make_relative() 2018-09-26 22:58:57 +09:00
Yu Watanabe 6d93eeb7c8 udev-builtin: replace udev_build_argv() by strv_split_extract() 2018-09-26 22:58:51 +09:00
Yu Watanabe feaa6db7ac udev-event: replace udev_build_argv() by strv_split_full()
This also modernize udev_event_spawn() a bit.
2018-09-26 22:55:22 +09:00
Zbigniew Jędrzejewski-Szmek 8a76031152 udev-builtin-net_id: do not assume "type" attribute exists
It *should*, but who knows, let's be more defensive here.

CID #1395805.
2018-09-25 11:29:54 +02:00
Lennart Poettering 614a8274f2 udev: fix some type sloppiness
We use strtoul() which returns an "unsigned long", but then assign this
to int or unsigned in, i.e. drop 32bit silently on 64bit systems. Let's
clean this up a bit, and retain the right types.
2018-09-25 09:20:16 +02:00
Zbigniew Jędrzejewski-Szmek f11aae7151
Merge pull request #10082 from porrided/udev-ipoib
Introduce predictable naming for IP-over-InfiniBand NICs
2018-09-24 13:14:06 +02:00
Yu Watanabe 51b006e18d udevadm: show only version number for '--version' option
This effectively reverts 2bc54be485
and relevant changes in #9920, as it is used to determine the version
of udev, e.g., dracut.

Fixes dracutdevs/dracut#468.
2018-09-21 10:58:54 +02:00
Yu Watanabe d6609f8280 hwdb,udevadm: also unify hwdb_query() and hwdb_test() 2018-09-19 17:38:07 +09:00
Yu Watanabe 6a34639e76 hwdb: unify duplicated code and move it to hwdb-util.c
Both 'systemd-hwdb update' and 'udevadm hwdb --update' creates hwdb
database. The database created by systemd-hwdb containes additional
information such that priority, line number, and source filename.
The unified function 'hwdb_update()' can take a flag 'compat' which
controls the format version of created database.
2018-09-19 17:36:03 +09:00
Yu Watanabe bc861c2e09 tree-wide: use typesafe_bsearch() or typesafe_bsearch_r() 2018-09-19 08:08:03 +09:00
Yu Watanabe ba0a7bfb98 tree-wide: use typesafe_qsort_r() 2018-09-19 08:05:13 +09:00
Yu Watanabe 93bab28895 tree-wide: use typesafe_qsort() 2018-09-19 08:02:52 +09:00
Arseny Maslennikov b8e8823e63 udev: Fix "strtol" -> "strtoul" for unsigned source values 2018-09-18 20:13:42 +03:00
Arseny Maslennikov cdd63a03ce udev: Provide a fallback for IPoIB device port numbers
In older kernels IPoIB network devices expose the port number via
the sysfs attribute 'dev_id', which is not intended to be used this way.
Let's support both options for a while.
2018-09-18 20:13:42 +03:00
Arseny Maslennikov a0d415da3a udev: Disable HW-address-based naming for IB NICs
An InfiniBand network address is 20 bytes long. Only the least
significant 8 bytes can be interpreted as a persistent hardware unit
identifier; the other 12 are transiently derived at runtime from metadata
specific to the protocol stack.

However, since the network interface name length is hard-capped by
IFNAMSIZ at 16 chars and the 2-byte type prefix with '\0' at the end
leave us only at 13, we cannot squeeze a descriptive representation of a
HW address into an interface name. Thus, it makes the most sense to drop
the scheme for IPoIB interfaces entirely.

Currently udev just gets confused and does what it has been taught
to do: fetches the first six bytes and puts them into a permanent
device attribute.
2018-09-18 20:13:42 +03:00
Arseny Maslennikov 938d30aa98 udev: Introduce predictable naming for InfiniBand NICs
We've long neglected IP-over-InfiniBand network interfaces, let's treat
them the same way we treat anyone else.

IPoIB interfaces will retain the 'ib' prefix; otherwise the naming scheme
is the same one we use for other network interfaces. E.g. a IPoIB network
device provided by a PCI card at bus 21 slot 0 function 6 will be named
'ibp21s0f6'.
2018-09-18 20:13:42 +03:00
Yu Watanabe 2bc54be485 udevadm-util: drop unused function print_version() 2018-09-10 18:27:36 +09:00
Yu Watanabe ee4a776d93 udevadm-info: make info_main() returns negative value on error
Also, this replaces fprintf(stderr, ...) by log_error().
2018-09-10 18:27:36 +09:00
Yu Watanabe bb084d42f8 udevadm-trigger: make trigger_main() returns negative value on error 2018-09-10 18:27:36 +09:00
Yu Watanabe 89e94ad333 udevadm-test: modernize code 2018-09-10 18:27:36 +09:00
Yu Watanabe 8450abf423 udevadm-test-builtin: modernize code 2018-09-10 18:27:36 +09:00
Yu Watanabe c71509028f udevadm-settle: modernize code 2018-09-10 18:27:36 +09:00
Yu Watanabe 2b25284ed0 udevadm-monitor: modernize code 2018-09-10 18:27:36 +09:00
Yu Watanabe bb291b7224 udevadm-control: modernize code a bit 2018-09-10 18:27:36 +09:00
Yu Watanabe b77200b6ba udevadm-hwdb: modernize code a bit 2018-09-10 18:27:36 +09:00
Yu Watanabe 3d05193e67 udevadm: use dispatch_verb() and drop udevadm_cmd struct 2018-09-10 18:27:36 +09:00
Yu Watanabe bd696b953e udevd: drop unused refcount 2018-09-10 18:27:36 +09:00
Yu Watanabe 8f71a0d163 udev-ctrl: use DEFINE_TRIVIAL_REF_FUNC() macro or friends 2018-09-10 18:27:36 +09:00
Yu Watanabe 2024ed616e udev: drop unused udev struct 2018-09-10 18:27:36 +09:00
Yu Watanabe 187e1d977a udev: drop unused udev_watch struct 2018-09-10 18:27:36 +09:00
Yu Watanabe 755c3fe9a7 libudev-util: drop unnecessary argument 'struct udev *udev' from util_resolve_subsys_kernel() 2018-09-10 18:27:36 +09:00
Yu Watanabe e5eadf53fe udev/net: replace udev_device by sd_device 2018-09-10 18:27:36 +09:00
Yu Watanabe 30e888c20a udev/scsi_id: drop never used code blocks 2018-09-10 18:27:36 +09:00
Yu Watanabe 057fc051a4 udev/scsi_id: coding style fixes 2018-09-10 18:27:36 +09:00
Yu Watanabe efc2774c25 udev/scsi_id: drop unused udev struct 2018-09-10 18:27:36 +09:00
Yu Watanabe f1ff9e8dd9 udev/cdrom_id: drop duplicated logs 2018-09-10 18:27:36 +09:00
Yu Watanabe 20a744b795 udev/cdrom_id: drop unused udev struct 2018-09-10 18:27:36 +09:00
Yu Watanabe 893e05590c udev/ata_id: coding style fixes 2018-09-10 18:27:36 +09:00
Yu Watanabe 3b77b4e12f udev/ata_id: drop unused udev struct 2018-09-10 18:27:36 +09:00