Commit Graph

1132 Commits

Author SHA1 Message Date
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
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
Yu Watanabe a168792c2d udev: drop collect 2018-09-10 18:27:36 +09:00
Thomas Haller 3301f9eb97 link: allocate correct number of bytes in ethtool_set_features()
sfeatures is a "struct ethtool_sfeatures". Use sizeof() on the correct
data type.

Since "struct ethtool_gstrings" is larger than "struct ethtool_sfeatures",
this had no serious consequences.

Fixes: 50725d10e3
2018-08-27 14:14:30 +02:00
Yu Watanabe 152d0efa2b udev: move udev cleanup functions from udev-util.h to udev.h 2018-08-23 04:57:39 +09:00
Yu Watanabe 51517f9e09 network: replace udev_device by sd_device 2018-08-23 04:57:39 +09:00
Yu Watanabe 3938f568a2 libudev: accept NULL as the argument 'struct udev*' for udev_monitor_new() or friends
As udev_monitor struct or friends are now almost independent of udev
struct. So, generating these objects without udev struct is reasonable.
2018-08-23 04:57:39 +09:00
Zbigniew Jędrzejewski-Szmek 7692fed98b
Merge pull request #9783 from poettering/get-user-creds-flags
beef up get_user_creds() a bit and other improvements
2018-08-21 10:09:33 +02:00
Lennart Poettering fafff8f1ff user-util: rework get_user_creds()
Let's fold get_user_creds_clean() into get_user_creds(), and introduce a
flags argument for it to select "clean" behaviour. This flags parameter
also learns to other new flags:

- USER_CREDS_SYNTHESIZE_FALLBACK: in this mode the user records for
  root/nobody are only synthesized as fallback. Normally, the synthesized
  records take precedence over what is in the user database.  With this
  flag set this is reversed, and the user database takes precedence, and
  the synthesized records are only used if they are missing there. This
  flag should be set in cases where doing NSS is deemed safe, and where
  there's interest in knowing the correct shell, for example if the
  admin changed root's shell to zsh or suchlike.

- USER_CREDS_ALLOW_MISSING: if set, and a UID/GID is specified by
  numeric value, and there's no user/group record for it accept it
  anyway. This allows us to fix #9767

This then also ports all users to set the most appropriate flags.

Fixes: #9767

[zj: remove one isempty() call]
2018-08-20 15:58:21 +02:00
Lennart Poettering 37ec0fdd34 tree-wide: add clickable man page link to all --help texts
This is a bit like the info link in most of GNU's --help texts, but we
don't do info but man pages, and we make them properly clickable on
terminal supporting that, because awesome.

I think it's generally advisable to link up our (brief) --help texts and
our (more comprehensive) man pages a bit, so this should be an easy and
straight-forward way to do it.
2018-08-20 11:33:04 +02:00
Thomas Haller cc2ff878fa link: fix type for link-config's "features" array of tristates
The "features" fields is parsed as a tristate value. The values
are thus not of type NetDevFeature enum but int. The NetDevFeature
enum is instead the index for the features array.

Adjust the type. In practice, this had no impact because NetDevFeature
enum commonly has size of int.

Also, don't use memset() 0xFF to initilize the int with -1. While
it works correctly in practice, it feels ugly.
2018-08-07 15:40:39 +02:00
Evgeni Golov eefe36e64c udev: net_id: document predictable names for SR-IOV virtual devices 2018-07-31 16:41:32 +09:00
Daniel 14a6aee050 changed exit(4) to asynchronous-safe _exit(4) in signal handler sig_alrm 2018-07-26 14:47:38 +02:00
Yu Watanabe f330408d62 tree-wide: drop empty lines in comments 2018-07-23 08:44:24 +02:00
Zbigniew Jędrzejewski-Szmek 4fdf69078a udev-builtin-kmod: adjust logging
I guess the one about "execute" was from the time when modprobe was called
directly.
2018-07-19 18:28:21 +02:00