1
0
mirror of https://github.com/systemd/systemd.git synced 2024-11-08 11:27:32 +03:00
Commit Graph

570 Commits

Author SHA1 Message Date
Zbigniew Jędrzejewski-Szmek
bdd13f6be4 Remove dead lines in various places
As pointed-out by clang -Wunreachable-code.

No behaviour changes.
2014-02-24 19:24:14 -05:00
Lennart Poettering
5556b5fe41 core: clean up some confusing regarding SI decimal and IEC binary suffixes for sizes
According to Wikipedia it is customary to specify hardware metrics and
transfer speeds to the basis 1000 (SI decimal), while software metrics
and physical volatile memory (RAM) sizes to the basis 1024 (IEC binary).
So far we specified everything in IEC, let's fix that and be more
true to what's otherwise customary. Since we don't want to parse "Mi"
instead of "M" we document each time what the context used is.
2014-02-23 03:19:04 +01:00
Tom Gundersen
733f7a2c69 udev: net - allow MTU and Speed to be specified with units
This also changes the names to MTUBytes and BitsPerSecond, respectively. Notice
that the speed was mistakenly documented to be in bytes before this change.
2014-02-22 18:29:43 +01:00
Tom Gundersen
bf175aafd2 net-util: match on the driver as exposed by ethtool if DRIVER not set
Also fix a copy-paste error that broke matching on interface name.
2014-02-21 22:59:29 +01:00
Tom Gundersen
6c0519c012 net: initialize structs when declaring 2014-02-21 21:32:38 +01:00
Lennart Poettering
61f3af4fed net: initialize structs when declaring them/do not clobber caller variables
Just two minor style fixes...
2014-02-21 21:23:40 +01:00
Tom Gundersen
847a8a5fed udev - link-setup - expose ID_NET_DRIVER
This is the same as shown by 'ethtool -i <ifname>', and is sometimes
set even though DRIVER is not.
2014-02-21 21:00:39 +01:00
Tom Gundersen
edbb03e95a .network/.netdev/.link: allow to match on architecture 2014-02-21 16:05:02 +01:00
Tom Gundersen
2cc412b593 network/link: Match - filter on kernel cmdline, host and virt 2014-02-20 21:50:34 +01:00
Lennart Poettering
bcfce235a3 macro: introduce a nice macro for disabling -Wformat-nonliteral temporarily 2014-02-20 18:18:32 +01:00
Lennart Poettering
151b9b9662 api: in constructor function calls, always put the returned object pointer first (or second)
Previously the returned object of constructor functions where sometimes
returned as last, sometimes as first and sometimes as second parameter.
Let's clean this up a bit. Here are the new rules:

1. The object the new object is derived from is put first, if there is any

2. The object we are creating will be returned in the next arguments

3. This is followed by any additional arguments

Rationale:

For functions that operate on an object we always put that object first.
Constructors should probably not be too different in this regard. Also,
if the additional parameters might want to use varargs which suggests to
put them last.

Note that this new scheme only applies to constructor functions, not to
all other functions. We do give a lot of freedom for those.

Note that this commit only changes the order of the new functions we
added, for old ones we accept the wrong order and leave it like that.
2014-02-20 00:03:10 +01:00
Tom Gundersen
e51660ae56 udev: net-config - allow interface names to be set from the hwdb 2014-02-19 23:29:51 +01:00
Lennart Poettering
d4f1ef4437 udev: make sure we always return a valid error code in trie_store() 2014-02-19 17:53:50 +01:00
Lennart Poettering
39883f622f make gcc shut up
If -flto is used then gcc will generate a lot more warnings than before,
among them a number of use-without-initialization warnings. Most of them
without are false positives, but let's make them go away, because it
doesn't really matter.
2014-02-19 17:53:50 +01:00
Tom Gundersen
9b1c2626ce net-match: fix Driver= match
It should match on the driver of the parent device.
2014-02-18 22:34:26 +01:00
Zbigniew Jędrzejewski-Szmek
06beed6dc6 Remove unused variable and two function stubs 2014-02-17 22:35:35 -05:00
Jan Engelhardt
73e231abde doc: update punctuation
Resolve spotted issues related to missing or extraneous commas, dashes.
2014-02-17 19:03:07 -05:00
Lennart Poettering
c8a202b7d4 everywhere: always use O_CLOEXEC where it makes sense 2014-02-13 14:59:56 +01:00
Lennart Poettering
955d98c9c1 everywhere: make use of new0() and macro() macros, and stop using perror() 2014-02-13 14:45:51 +01:00
Lennart Poettering
cf6a891173 rtnl: drop "sd_" prefix from cleanup macros
The "sd_" prefix is supposed to be used on exported symbols only, and
not in the middle of names. Let's drop it from the cleanup macros hence,
to make things simpler.

The bus cleanup macros don't carry the "sd_" either, so this brings the
APIs a bit nearer.
2014-02-13 03:44:14 +01:00
Zbigniew Jędrzejewski-Szmek
90b2de37b8 Update some message formats
Use PID_FMT/USEC_FMT/... in more places.

Also update logind error messages to print the full path to a file that
failed. This should make debugging easier for people who do not know
off the top of their head where logind stores it state.
2014-02-05 19:00:36 -05:00
Greg KH
29804cc1e0 use memzero(foo, length); for all memset(foo, 0, length); calls
In trying to track down a stupid linker bug, I noticed a bunch of
memset() calls that should be using memzero() to make it more "obvious"
that the options are correct (i.e. 0 is not the length, but the data to
set).  So fix up all current calls to memset(foo, 0, length) to
memzero(foo, length).
2014-01-31 11:55:01 +01:00
Kay Sievers
d6f116a7b1 udev: static_node - do not exit rule after first static_node item
The nodes usually do not exist, so handle the next item instead of
skipping the entire rule.
2014-01-22 10:47:48 +01:00
Hendrik Brueckner
e0d4a0ac06 udev/net_id: Introduce predictable network names for Linux on System z
Use the bus-ID to create predicatable devices names for network interfaces
on Linux on System z instances.  The bus-ID identifies a device in the s390
channel subsystem.

Network interfaces of device type Ethernet are named as:
    enccw0.0.1234    (13 characters)
up to
    enccwff.7.ffff   (14 characters)

CTC network devices of device type SLIP, use a different prefix as follows:
    slccw0.0.1234    (13 characters)

See also Red Hat Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=870859
[tomegun: typical problem of netdevs switching names between reboots.]
2014-01-11 15:03:25 +00:00
Zbigniew Jędrzejewski-Szmek
2ad8416dd0 No need to canonicalize fixed paths 2014-01-08 22:15:27 -05:00
Tom Gundersen
e3d563346c udev: net_id - handle virtio buses
This was already supported in path_id, so should be uncontroversial.
2014-01-04 15:21:58 +01:00
Kay Sievers
ed14edc04f udev: LOG_PRIORITY -> LOG_LEVEL 2013-12-29 18:05:25 +01:00
Zbigniew Jędrzejewski-Szmek
e3e0314b56 systemctl: allow globbing in commands which take multiple unit names 2013-12-26 13:24:36 -05:00
Lennart Poettering
9f6445e34a log: log_error() and friends add a newline after each line anyway, so avoid including it in the log strings 2013-12-24 16:39:37 +01:00
Lennart Poettering
eff0527098 util: unify SO_PEERCRED/SO_PEERSEC invocations
Introduce new call getpeercred() which internally just uses SO_PEERCRED
but checks if the returned data is actually useful due to namespace
quirks.
2013-12-24 15:53:04 +01:00
Lennart Poettering
9bf3b53533 shared: switch our hash table implementation over to SipHash
SipHash appears to be the new gold standard for hashing smaller strings
for hashtables these days, so let's make use of it.
2013-12-22 21:12:25 +01:00
Zbigniew Jędrzejewski-Szmek
44433ebdb1 udevadm: modernization 2013-12-18 23:58:23 -05:00
Zbigniew Jędrzejewski-Szmek
7643ac9a8a udevadm,scsi_id: add short options to help strings and to the man page
Also clean things up a bit here and there.
2013-12-18 23:58:23 -05:00
Zbigniew Jędrzejewski-Szmek
ed142bdb68 scsi_id: cleanup
Remove -i option which would case exit(1) to happen.
Remove some unused code.
Convert to bool where appropriate.
Simplify things a bit.
Always free everything.

https://bugzilla.redhat.com/show_bug.cgi?id=1043304
2013-12-18 23:58:23 -05:00
Shawn Landden
919ce0b7af _noreturn_ --> noreturn for C11 compat
also define noreturn w/o <stdnoreturn.h>
2013-12-17 21:51:24 +01:00
Thomas Hindoe Paaboel Andersen
187dc6e554 udev link-config: add asserts to silence scan-build 2013-12-17 16:09:52 +01:00
Zbigniew Jędrzejewski-Szmek
b5dd814873 Fix a few signed/unsigned format string issues
Since numbers involved are all small, behaviour was correct already.

https://bugzilla.redhat.com/show_bug.cgi?id=1043304
2013-12-15 17:49:28 -05:00
Zbigniew Jędrzejewski-Szmek
2fd069b18e Fix a few resource leaks in error paths
https://bugzilla.redhat.com/show_bug.cgi?id=1043304
2013-12-15 17:49:28 -05:00
Zbigniew Jędrzejewski-Szmek
d9de321f78 udev-builtin-path: fix printf specifiers 2013-12-14 23:10:03 -05:00
Thomas Hindoe Paaboel Andersen
9091e686f4 Add more _printf_'s for format-nonliterals
Clang is a bit more strict wrt format-nonliterals:
http://clang.llvm.org/docs/LanguageExtensions.html#format-string-checking

Adding these extra printf attributes also makes gcc able to find more
problems. E.g. this patch uncovers a format issue in udev-builtin-path_id.c

Some parts looked intetional about breaking the format-nonliteral check.
I added some supression for warnings there.
2013-12-14 13:32:22 +01:00
Thomas Hindoe Paaboel Andersen
f168c27313 trivial coding style clean ups
- Add space between if/for and the opening parentheses
- Place the opening brace on same line as the function (not for  udev)

From the CODING_STYLE
Try to use this:
    void foo() {
    }
instead of this:
    void foo()
    {
    }
2013-12-03 22:27:45 +01:00
Tom Gundersen
ff83aac364 Revert "link-config: match length for kernel commandline option"
This reverts commit da66338e17.

It is superseeded by 70f75a523b
2013-11-28 20:06:42 +01:00
Daniel Buch
f5f6d0e255 tree-wide usage of %m specifier instead of strerror(errno)
Also for log_error() except where a specific error is specified

e.g. errno ? strerror(errno) : "Some user specified message"
2013-11-26 21:07:46 +10:00
Tom Gundersen
71a6151083 conf-parser: distinguish between multiple sections with the same name
Pass on the line on which a section was decleared to the parsers, so they
can distinguish between multiple sections (if they chose to). Currently
no parsers take advantage of this, but a follow-up patch will do that
to distinguish

[Address]
Address=192.168.0.1/24
Label=one

[Address]
Address=192.168.0.2/24
Label=two

from

[Address]
Address=192.168.0.1/24
Label=one
Address=192.168.0.2/24
Label=two
2013-11-25 19:35:44 +01:00
Martin Pitt
0ba696e20c udev-builtin-keyboard: More useful error message
Make the "Error calling EVIOCSKEYCODE" error message more useful by mentioning
which scan/key code it tried to set.
2013-11-25 17:44:57 +01:00
Tom Gundersen
d2df0d0ed3 udev: net_setup_link - don't use Description as Alias
Use Description only internally, and allow Alias to be set
as a separate option. For instance SNMP uses ifalias for
a specific purpose, so let's not write to it by default.
2013-11-25 14:53:56 +01:00
Karel Zak
4561be3a64 Remove duplicate includes 2013-11-18 20:28:55 -05:00
Kay Sievers
b26618399e udev: declare some symbols static 2013-11-13 03:34:24 +01:00
Kay Sievers
e3dc56a219 udev: declare some symbols static 2013-11-12 18:09:08 +01:00
Lennart Poettering
9588bc3209 Remove dead code and unexport some calls
"make check-api-unused" informs us about code that is not used anymore
or that is exported but only used internally. Fix these all over the
place.
2013-11-08 18:12:45 +01:00
Dave Reisner
489124365d link-config: Fix typo in log_warning 2013-11-08 09:38:50 -05:00
Dave Reisner
da66338e17 link-config: match length for kernel commandline option
This prevents enable_name_policy() from invariably returning false when
it matches a zero length string at the end of /proc/cmdline.
2013-11-08 09:25:19 -05:00
Lennart Poettering
9d458c0902 clients: fix some signal handler issues 2013-11-08 14:07:27 +01:00
Michal Sekletar
0a2c229426 net-util: call ioctl() only if necessary
In case when update of current values is not necessary we still might end up
calling ioctl(), because need_update variable is not explicitly initialized.
2013-11-07 22:25:42 +01:00
Zbigniew Jędrzejewski-Szmek
86198b2788 udevadm-settle: add missing brace 2013-11-07 01:34:19 -05:00
Yang Zhiyong
c5383e7942 udevadm-trigger: add parameters checking 2013-11-07 01:23:54 -05:00
Yang Zhiyong
4e93793da8 udevadm-settle: add parameters checking 2013-11-07 01:23:54 -05:00
Lennart Poettering
74df0fca09 util: unify reading of /proc/cmdline
Instead of individually checking for containers in each user do this
once in a new call proc_cmdline() that read the file only if we are not
in a container.
2013-11-06 03:15:16 +01:00
Tom Gundersen
b3e0131486 net-util: don't use libudev
Should fix linking with old toolchain.
2013-11-05 01:39:46 +01:00
Tom Gundersen
be32eb9b7f net-config: start split out matching and parsing logic
Move this to src/share/net-util.c, so it can be used elsewhere.
2013-11-04 23:00:12 +01:00
Kay Sievers
5c11fbe3a7 udev: udevd - rules can be NULL when reloading 2013-11-04 15:54:33 +01:00
Martin Pitt
b151ca9933 udev-builtin-keyboard: Fix large scan codes on 32 bit architectures
Use strtoul(), as scan codes are always positive. On 32 bit architectures
strtol gives wrong results:

  strtol("fffffff0", &endptr, 16)

returns 2147483647 instead of 4294967280.

https://launchpad.net/bugs/1247676
2013-11-04 07:25:45 +01:00
Dave Reisner
c50e28a38c link-config: support --enable-split-usr 2013-10-30 11:00:46 -04:00
Kay Sievers
75716dd8ea udev: rules - move parsing error to log_error() 2013-10-30 15:49:46 +01:00
Tom Gundersen
98a375f6d5 udev: config-link - one less log_info 2013-10-30 15:47:29 +01:00
Tom Gundersen
f61942250a udev: link-config - less verbose logging
Also reinstate print to kmsg when renaming netif.
2013-10-30 15:36:04 +01:00
Tom Gundersen
3e137a1b9a udev: link-config - let udevd set the ifname 2013-10-30 15:36:04 +01:00
Kay Sievers
1cb8df46cb udev: ata_id: log faling ioctls as "debug" 2013-10-30 14:50:04 +01:00
Kay Sievers
0aa5b4d1f7 udev: do not allow to change the DEVPATH of a device 2013-10-30 01:58:26 +01:00
Tom Gundersen
e0221a35c8 udev: link-config - reset ctx on exit 2013-10-29 23:36:18 +01:00
Tom Gundersen
16d26d559d udev-event: use rtnl to set ifname 2013-10-29 21:26:22 +01:00
Tom Gundersen
3aeb37bc4f rtnl: move set_link_properties to rtnl-utils 2013-10-29 21:26:22 +01:00
Tom Gundersen
977085794d udev: link-config - split connection to sockets from loading of configs
We want to load the config in _init, but not connect to the sockets before we are forked.
2013-10-29 17:57:21 +01:00
Tom Gundersen
98dd77e86e rtnl: introduce default timeout
We set it to 10 secs (as we are only communicating with the kernel,
it seems we should be able to bail out sooner than sd-bus, which
uses 25).

When passing timout 0, the default is used, use this in link-config.
2013-10-29 16:37:30 +01:00
Tom Gundersen
f1ac700248 udev: link-config - use safe_atou instead of strtoul 2013-10-29 16:21:57 +01:00
Tom Gundersen
2a7e74e002 udev: link-config - use zero instead of memset 2013-10-29 16:12:12 +01:00
Tom Gundersen
55428d84f3 udev: link-config - use proper return values
Not sure if -ENOENT is the correct return value for when no persistent network
name is set, but couldn't think of anything better.
2013-10-29 16:12:12 +01:00
Tom Gundersen
a12fa4204d udev: link-config - use new0 instead of calloc 2013-10-29 16:12:12 +01:00
Tom Gundersen
5b9d4dc055 udev: link-config - use _cleanup_ macro locally 2013-10-29 16:12:11 +01:00
Tom Gundersen
97f2d76d4f path_check_timestamp: only keep the most recent timestamp
There is no point in keeping one timestamp for each directory, as we only
ever care about the most recent one.
2013-10-29 16:12:11 +01:00
Tom Gundersen
5fde13d748 udev: link-config - add proper parsing 2013-10-29 14:17:57 +01:00
Tom Gundersen
0b99c9f8f0 udev: builtin - rename net_link to net_setup_link
Also add shell completions.
2013-10-29 14:17:57 +01:00
Tom Gundersen
9dc670ea76 network: move configuration to /etc/systemd/network
This is private configuraiton, so let's not pollute the namespace (and hence make Debian happy :) ).
2013-10-29 14:17:57 +01:00
Tom Gundersen
16b9b87aee udev: link-config - add mac address policy
This introduces a new key MACAddressPolicy.

The possible policies are 'persistent' and 'random'.

'persistent' will do nothing if the current address is the hardware address,
but if the hardware does not have an address (or another address is set for
whatever reason), we will generate an address which will be random, but
persistent between boots (based on machineid and persistent netif name).

'random' will do nothing if the kernel already set a random address, otherwise
it will generate a random one and use that instead.

This patch sets MACAddressPolicy=persistent in the default .link file.
2013-10-28 18:10:23 +01:00
Tom Gundersen
daeb71a36a udev: link-config - move naming policy from udev rules
This introduces a new key NamePolicy, which takes an ordered list of naming
policies. The first successful one is applide. If all fail the value of Name
(if any) is used.

The possible policies are 'onboard', 'slot', 'path' and 'mac'.

This patch introduces a default link file, which replaces the equivalent udev
rule.
2013-10-28 01:18:04 +01:00
Tom Gundersen
2a73e0d39a udev: link-config - sanity check the ifname and mac address 2013-10-27 23:09:05 +01:00
Tom Gundersen
43b3a5ef61 udev: link-config: add rtnl support
This adds support for setting the mac address, name and mtu.

Example:

[Link]
MTU=1450
MACAddress=98:76:54:32:10:ab
Name=wireless0
2013-10-27 22:23:58 +01:00
Tom Gundersen
a501033335 udev: link-config: add ethtool support
This adds support for setting the link speed, duplex and WakeOnLan
settings.

Example:

[Link]
SpeedMBytes=100
Duplex=half
WakeOnLan=magic
2013-10-26 22:09:20 +02:00
Tom Gundersen
af6f0d422c udev: add network link configuration tool
This tool applies hardware specific settings to network devices before they
are announced via libudev.

Settings that will probably eventually be supported are MTU, Speed,
DuplexMode, WakeOnLan, MACAddress, MACAddressPolicy (e.g., 'hardware',
'synthetic' or 'random'), Name and NamePolicy (replacing our current
interface naming logic). This patch only introduces support for
Description, as a proof of concept.

Some of these settings may later be overriden by a network management
daemon/script. However, these tools should always listen and wait on libudev
before touching a device (listening on netlink is not enough). This is no
different from how things used to be, as we always supported changing the
network interface name from udev rules, which does not work if someone
has already started using it.

The tool is configured by .link files in /etc/net/links/ (with the usual
overriding logic in /run and /lib). The first (in lexicographical order)
matching .link file is applied to a given device, and all others are ignored.

The .link files contain a [Match] section with (currently) the keys
MACAddress, Driver, Type (see DEVTYPE in udevadm info) and Path (this
matches on the stable device path as exposed as ID_PATH, and not the
unstable DEVPATH). A .link file matches a given device if all of the
specified keys do. Currently the keys are treated as plain strings,
but some limited globbing may later be added to the keys where it
makes sense.

Example:

/etc/net/links/50-wireless.link
[Match]
MACAddress=98:f2:e4:42:c6:92
Path=pci-0000:02:00.0-bcma-0
Type=wlan

[Link]
Description=The wireless link
2013-10-26 22:09:20 +02:00
Tom Gundersen
89f17d4f80 udev-builtin: path_id - add support for bcma bus
This matches the bcma support in the network device naming.

Eventually wa want to make sure ID_PATH is equivalent to ID_NET_NAME_PATH,
so we never need to match on the latter.
2013-10-26 14:34:41 +02:00
Tom Gundersen
8e18485284 udev: move udev_rules_check_timestamp to shared
I want to use this from a bulitin in a subsequent patch.
2013-10-26 14:34:31 +02:00
Tom Gundersen
06f0639331 udev-builtin: uaccess - inherit logging form udev
Not that it makes a difference in this builtin, but otherwise /etc/udev/udev.conf is not respected.
2013-10-19 12:23:17 +02:00
Lennart Poettering
44b601bc79 macro: clean up usage of gcc attributes
Always use our own macros, and name all our own macros the same style.
2013-10-16 06:14:59 +02:00
Zbigniew Jędrzejewski-Szmek
97fec53e5e udev: use initialization instead of zeroing in one place 2013-10-13 17:56:55 -04:00
Zbigniew Jędrzejewski-Szmek
872c8faaf2 Fix write-only use of a few variables
Since the invention of read-only memory, write-only memory has been
considered deprecated. Where appropriate, either make use of the
value, or avoid writing it, to make it clear that it is not used.
2013-10-13 17:56:54 -04:00
Kay Sievers
f6f2ad9b9c udev: usb_id - remove obsoleted bInterfaceSubClass == 5 match
bInterfaceSubClass == 5 is not a "floppy"; just identify the obsolete
QIC-157 interface as "generic".
2013-10-11 11:23:34 +02:00
Kay Sievers
9a4e038c15 smack: minimize ifdef use, and move all labeling to smack-util.c 2013-10-11 10:16:41 +02:00
Lennart Poettering
d682b3a7e7 security: rework selinux, smack, ima, apparmor detection logic
Always cache the results, and bypass low-level security calls when the
respective subsystem is not enabled.
2013-10-10 16:35:44 +02:00
Kay Sievers
463b5dbb0d udev: add SECLABEL{selinux}= support 2013-10-09 17:31:41 +02:00
Kay Sievers
b7e2b7641e udev: reset Linux Security Module labels if no custom rules are given 2013-10-09 04:26:41 +02:00
Kay Sievers
c26547d612 udev: support custom Linux Security Module labels for device nodes 2013-10-08 02:23:24 +02:00
Dave Reisner
894a156de7 udev-builtin-blkid: export ID_PART_TABLE_UUID 2013-09-19 11:38:48 -04:00
Sebastian Ott
dd8b2bf433 udev: path_id - fix by-path link generation for scm devices
Set some_transport = true to prevent scm devices from being ignored.

Suggested-by: Harald Hoyer <harald@redhat.com>
Signed-off-by: Sebastian Ott <sebott@linux.vnet.ibm.com>
2013-09-17 13:53:58 -05:00
Dave Reisner
3cf0f8f7e0 udev-rules: avoid erroring on trailing whitespace
https://bugs.archlinux.org/task/36950
2013-09-16 11:46:05 -04:00
Shawn Landden
7c902b1468 udev: fix printf(3) type specifier
src/udev/udev-rules.c: In function 'add_rule':
src/udev/udev-rules.c:1078:33: warning: format '%lu' expects argument of type 'long unsigned int', but argument 8 has type 'int' [-Wformat=]
                                 log_error("invalid key/value pair in file %s on line %u,"
                                 ^
2013-08-23 12:48:14 -04:00
Colin Walters
73814ca287 Revert "udevd: simplify sigterm check"
This reverts commit 47e737dc13 - it
introduced a use-after-free.  The only way the code would get simpler
is with a cleanup function, but eh, not worth it for just this one
bit.

Reviewed by kay on IRC.
2013-08-22 17:07:02 -04:00
Zbigniew Jędrzejewski-Szmek
1291bc895b udev: when complaining about invalid characters, print them out
systemd-udevd[6260]: invalid key/value pair in file /usr/lib/udev/rules.d/60-ffado.rules on line 46,starting at character 84 ('#')
2013-08-20 21:18:43 -04:00
Kay Sievers
47e737dc13 udevd: simplify sigterm check 2013-08-15 19:55:32 +02:00
Tom Gundersen
689a97f523 udevd: respect the log-level set in /etc/udev/udev.conf
A regression introduced when we moved to systemd's logging is that the only
way to adjust the log-level of the udev daemon is via the env var, kernel
commandline or the commandline.

This reintroduces support for specifying this in the configuration file.
2013-08-09 01:38:17 +02:00
Kay Sievers
0238cf7cda udev: hwdb - try reading modalias for usb before falling back to the composed one 2013-08-07 16:47:31 +02:00
Dave Reisner
e736cf3582 udev-rules: report rule parsing errors from get_key 2013-07-29 21:51:58 -04:00
Tom Gundersen
15a722007d udev: static_node - don't touch permissions uneccessarily
Don't set default permissions if only TAGS were specified in a rule.
2013-07-24 15:13:00 +02:00
Tom Gundersen
490f008762 udev: log error if chmod/chown of static dev nodes fails 2013-07-24 15:13:00 +02:00
Zbigniew Jędrzejewski-Szmek
ef89eef77e udev: fix two trivial memleaks in error path
Based-on-a-patch-by: Ian Stakenvicius <axs@gentoo.org>
2013-07-19 09:57:04 -04:00
Tom Gundersen
84b6ad702e udev: export tags of "dead" device nodes to /run/udev/static_node-tags/
Based on a patch by Kay Sievers.

A tag is exported at boot as a symlinks to the device node in the folder
/run/udev/static_node-tags/<tagname>/, if the device node exists.

These tags are cleaned up by udevadm info --cleanup-db, but are otherwise
never removed.
2013-07-16 20:07:57 +02:00
Kay Sievers
ddc77f6224 switch from udev keymaps to hwdb 2013-07-16 16:22:01 +02:00
Martin Pitt
f3c19b70fa keymap: Drop non-existant Samsung 900XC3
Revert commit 90fc91d006 again. There is no 900XC3 model, that's 900X3C and
already covered by the 900X3* match.

See https://launchpad.net/bugs/1012365
2013-07-16 09:06:57 +02:00
Kay Sievers
9d7d42bc40 udev: add builtin 'keyboard' to manage key mappings 2013-07-10 22:52:55 +02:00
Kay Sievers
06639c0940 hwdb: allow list of lookup keys per given record
This allows to specify:
  dmi:bvn*:bvr*:bd*:svnVENDOR:pn:Model 231*:pvr*
  dmi:bvn*:bvr*:bd*:svnVENDOR:pn:Series 12*:pvr*
   KEY_A=value
   KEY_B=value

Instead of:
  dmi:bvn*:bvr*:bd*:svnVENDOR:pn:Model 231*:pvr*
   KEY_A=value
   KEY_B=value

  dmi:bvn*:bvr*:bd*:svnVENDOR:pn:Series 12*:pvr*
   KEY_A=value
   KEY_B=value
2013-07-10 15:05:05 +02:00
Kay Sievers
beef8df837 hwdb: return false if no property is found 2013-07-09 15:48:36 +02:00
Tom Gundersen
edeb68c53f static-nodes: move creation of static nodes from udevd to tmpfiles
As of kmod v14, it is possible to export the static node information from
/lib/modules/`uname -r`/modules.devname in tmpfiles.d(5) format.

Use this functionality to let systemd-tmpfilesd create the static device nodes
at boot, and drop the functionality from systemd-udevd.

As an effect of this we can move from systemd-udevd to systemd-tmpfiles-setup-dev:

 * the conditional CAP_MKNOD (replaced by checking if /sys is mounted rw)
 * ordering before local-fs-pre.target (see 89d09e1b5c)
2013-07-08 21:26:24 +02:00
Kay Sievers
a4bbef0992 hwdb: add --lookup-prefix= option 2013-07-08 11:44:17 +02:00
Kay Sievers
6824690f14 hwdb: allow to query arbitrary keys 2013-07-03 00:23:41 +02:00
Kay Sievers
efffb13e00 keymap: Asus -- do not overwrite explicitely kernel driver defined keys
If key mappings are defined in the kernel driver, userspace must
not overwrite them. If something is wrong with the kernel-provided
values, the kernel driver shold be fixed instead.

Some of the matches are not the input device name but the kernel
driver name, which will not match anything.
2013-07-02 02:16:36 +02:00
Kay Sievers
eb2059d897 keymap: remove non-existing driver string matches
There are no such strings for input devices in the kernel.
2013-07-01 23:55:34 +02:00
Kay Sievers
67410e9f73 hwdb: add --device=<device-id> and --filter=<key name glob> 2013-07-01 22:34:43 +02:00
Kay Sievers
3cf7b686e6 hwdb: remove support for (not fully implemented) conditional properties 2013-07-01 19:39:50 +02:00
장동준
cda4380d9f keymap: Add Samsung Series 3
Signed-off-by: Martin Pitt <martinpitt@gnome.org>
2013-06-28 10:51:28 +02:00
Jan Janssen
9c3fd04e7d libudev: Use correct type for sizeof 2013-06-24 12:41:01 +02:00
Martin Pitt
f6c9f322e8 keymap: Apply to all Latitude and Precision models
https://launchpad.net/bugs/1193147
2013-06-21 06:34:38 +02:00
Sean McGovern
214daa72cb udev: handle network controllers in nonstandard domains
Onboard network controllers are not always on PCI domain 0.

[Kay: use int instead of long, add [P] to slot naming, remove sysname var]
2013-06-18 13:18:27 +02:00
Pierre Neidhardt
f3dbb13c85 keymap: add some more Asus laptop keys
With Linux 3.9 (commit a935eaecef2b209ad661dadabb4e32b7c9a9b924), the
Asus keyboard driver has changed to be more compliant to the symbol
signification. This has led to some issues with udev. In particular,
the XF86TouchpadToggle (a Fn key) does not work anymore on Asus X52J.

I found another similar patch which does not seem to have been ever
submitted/merged:

  https://launchpadlibrarian.net/73337842/95-keymap.rules.patch

Find enclosed the patch containing both the launchpad patch and mine
into one file.

https://bugs.freedesktop.org/show_bug.cgi?id=65375
2013-06-04 17:45:41 -04:00
Martin Pitt
98627dced7 keymap: Add Logitech USB (iTouch)
https://launchpad.net/bugs/1152377
2013-05-24 08:35:47 +02:00
Martin Pitt
1bec44f2a5 keymap: Add DIXONSP
https://launchpad.net/bugs/1157334
2013-05-21 09:52:33 +02:00
Martin Pitt
718cd9ddda keymap: Add BenQ JoyBook
https://launchpad.net/bugs/727139
2013-05-21 09:40:21 +02:00
Martin Pitt
90fc91d006 keymap: Add Samsung 900XC3
https://launchpad.net/bugs/1012365
2013-05-21 09:28:29 +02:00
Johan Heikkilä
53789059e0 keymap: Add support for Eject button on MSI GE60/GE70 2013-05-14 21:49:13 -04:00
Ville Skyttä
c95686c6ed keymap/findkeyboards: avoid throwaway attribute-walk 2013-05-03 22:45:13 -04:00
Ville Skyttä
d2bbca6855 Spelling fixes 2013-05-03 22:45:09 -04:00
Zbigniew Jędrzejewski-Szmek
e4d2bfdd73 Add printf attributes in exported headers
gcc (and other compilers) sometimes generate spurious warnings, and
thus users of public headers must be able to disable warnings.

Printf format attributes can be disabled by setting
    #define _sd_printf_attr_
before including the header file.

Also, add similar logic for sentinel attribute:
    #define _sd_sentinel_attr_
before including the header file disables the attribute.
2013-04-25 21:50:48 -04:00
Zbigniew Jędrzejewski-Szmek
c79bb9e4e2 Standarize on one spelling of symlink error message
It's polite to print the name of the link that wasn't created,
and it makes little sense to print the target.
2013-04-24 00:25:04 -04:00
Harald Hoyer
7fd1b19bc9 move _cleanup_ attribute in front of the type
http://lists.freedesktop.org/archives/systemd-devel/2013-April/010510.html
2013-04-18 09:11:22 +02:00
Lennart Poettering
7027ff61a3 nspawn: introduce the new /machine/ tree in the cgroup tree and move containers there
Containers will now carry a label (normally derived from the root
directory name, but configurable by the user), and the container's root
cgroup is /machine/<label>. This label is called "machine name", and can
cover both containers and VMs (as soon as libvirt also makes use of
/machine/).

libsystemd-login can be used to query the machine name from a process.

This patch also includes numerous clean-ups for the cgroup code.
2013-04-16 04:41:21 +02:00
Anatol Pomozov
ab06eef810 Fix spelling errors using 'codespell' tool 2013-04-15 08:40:05 -04:00
Zbigniew Jędrzejewski-Szmek
1e8e0a3221 udev/ata_id: zero out variable properly
b8a2b0f76 'use initalization instead of explicit zeroing'
introduced a bug where only the first sizeof(uint_t*) bytes
would be zeroed out, instead of the whole array.
2013-04-14 18:52:24 -04:00
Zbigniew Jędrzejewski-Szmek
b8a2b0f76b udev/ata_id: use initalization instead of explicit zeroing 2013-04-10 18:59:42 -04:00
Martin Pitt
c8f5f5e728 keymap: Fix typo in previous commit 2013-04-09 15:44:41 +02:00
Pali Rohar
72bd03c636 keymap: Add HP EliteBook 8460p
Taken from
https://code.launchpad.net/~pali/ubuntu/raring/udev/hp-elitebook-8460p/+merge/157420

Signed-off-by: Martin Pitt <martinpitt@gnome.org>
2013-04-09 15:32:22 +02:00
Harald Hoyer
b97caef538 udev/udev-ctrl.c:udev_ctrl_new_from_fd() enable SO_PASSCRED
Avoid "sender uid=65534, message ignored" case, where no credentials can
be read on the sender side.

Seems, the server socket does not enable credential receiving fast
enough, and the message from the client (without credential) sometimes
is queued before the credential passing was active.
2013-04-08 20:03:50 +02:00
Zbigniew Jędrzejewski-Szmek
b92bea5d2a Use initalization instead of explicit zeroing
Before, we would initialize many fields twice: first
by filling the structure with zeros, and then a second
time with the real values. We can let the compiler do
the job for us, avoiding one copy.

A downside of this patch is that text gets slightly
bigger. This is because all zero() calls are effectively
inlined:

$ size build/.libs/systemd
         text    data     bss     dec     hex filename
before 897737  107300    2560 1007597   f5fed build/.libs/systemd
after  897873  107300    2560 1007733   f6075 build/.libs/systemd

… actually less than 1‰.

A few asserts that the parameter is not null had to be removed. I
don't think this changes much, because first, it is quite unlikely
for the assert to fail, and second, an immediate SEGV is almost as
good as an assert.
2013-04-05 19:50:57 -04:00
Zbigniew Jędrzejewski-Szmek
8c62ecf1a9 udevadm: do not free node on success
A fix for ff03aed06a.
2013-04-05 17:39:13 -04:00
Zbigniew Jędrzejewski-Szmek
bad490b051 udev-builtin-usb_id: avoid comparison of unsigned and ssize_t
For some reason this shows up on i686 only:
src/udev/udev-builtin-usb_id.c:192:20: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
2013-04-05 17:39:02 -04:00
Martin Pitt
79d860fe78 PAM, uaccess: check for logind, not for systemd
It is possible to build systemd without logind or run logind without systemd
init. Commit 66e41181 fixed sd_booted() to only succeed for systemd init; with
that, testing for systemd init is wrong in the parts that talk to logind.

In particular, this affects the PAM module and the "uaccess" udev builtin.
Change sd_booted() to a new logind_running() which tests for
/run/systemd/seats/.

For details, see:
<https://mail.gnome.org/archives/desktop-devel-list/2013-March/msg00092.html>

https://bugs.freedesktop.org/show_bug.cgi?id=62754
2013-04-05 18:16:58 +02:00
Zbigniew Jędrzejewski-Szmek
ff03aed06a udevadm-hwdb: avoid leak in error path 2013-04-04 22:46:19 -04:00
Lennart Poettering
574d5f2dfc util: rename write_one_line_file() to write_string_file()
You can write much more than just one line with this call (and we
frequently do), so let's correct the naming.
2013-04-03 20:12:56 +02:00
Zbigniew Jędrzejewski-Szmek
7a22620612 accelerometer: remove dead if and modernize
Based on a coverity warning.
2013-03-31 14:32:17 -04:00
Zbigniew Jędrzejewski-Szmek
4dd1de72e8 Remove some dead code
Based on coverity report.
2013-03-31 14:28:36 -04:00
Lennart Poettering
bcadcb64ee udev: extern on functions is pointless 2013-03-30 15:21:54 +01:00
Zbigniew Jędrzejewski-Szmek
844ec79b3c catalog: open up catalog internals
In order to write tests for the catalog functions, they
are made non-static and start taking a 'database' parameter,
which is the name of a file with the preprocessed catalog
entries.

This makes it possible to make test-catalog part of the
normal test suite, since it now only operates on files
in /tmp.

Some more tests are added.
2013-03-28 23:45:59 -04:00
Václav Pavlín
f459285212 udev: check return value of uname. 2013-03-28 23:45:58 -04:00
Kay Sievers
d8d4bee76c build-sys: fix HAVE/ENABLE_FIRMWARE
https://bugs.freedesktop.org/show_bug.cgi?id=62864
2013-03-28 15:28:10 +01:00
Martin Pitt
590888a0d0 keymap: Fix Touchpad Toggle on MSI Wind U90/U100
This key is handled by the hardware already, so handling it again in software
nullifies the effect. Newer kernels read the real state and send out a separate
KEY_TOUCHPAD_ON or KEY_TOUCHPAD_OFF event, so in both cases we need to ignore
that key.

https://bugs.freedesktop.org/show_bug.cgi?id=62404
2013-03-27 08:15:12 +01:00
Harald Hoyer
8cc3f8c0bc udevd.c: set udev children_max according to CPU count
Setting children_max according to RAM leads to too much concurrent I/O.
2013-03-25 13:11:18 +01:00
Zbigniew Jędrzejewski-Szmek
46512cd959 udevadm: place const in the right place
Otherwise clang at least thinks that both consts apply to char.
2013-03-22 23:08:17 -04:00
Lennart Poettering
2852ae2134 udev: no need to output OOM, if we call log_oom() anyway 2013-03-22 21:05:42 +01:00
Zbigniew Jędrzejewski-Szmek
7d56679902 udev/collect: avoid initalizing memory twice 2013-03-22 15:40:37 -04:00
Kay Sievers
9a8ae49d91 udev: always set selinux label at "add" events
https://bugs.freedesktop.org/show_bug.cgi?id=62615
2013-03-21 23:13:17 +01:00
Zbigniew Jędrzejewski-Szmek
131c01dbe9 Make two functions static 2013-03-20 19:16:01 -04:00
Ozan Çağlayan
278e73d6b7 keymap: Remap microphone mute and touchpad toggle for Lenovo U300s
Separate out Ideapad U300s to its own line and add Microphone mute key.

Signed-off-by: Martin Pitt <martinpitt@gnome.org>
2013-03-19 14:55:32 +01:00
Ozan Çağlayan
785af213b6 keymap: Fix touchpad toggling on Lenovo IdeaPad U300s
IdeaPad U300s needs mapping 0xf1 to f21 just like Lenovo V480.

Signed-off-by: Martin Pitt <martinpitt@gnome.org>
2013-03-19 11:28:09 +01:00
Kay Sievers
61e536e1b7 udev: ifdef all firmware special handling 2013-03-18 15:22:32 +01:00
Tom Gundersen
a3bd8447be udev: make firmware loading optional and disable by default
Distros that whish to support old kernels should set
  --with-firmware-dirs="/usr/lib/firmware/updates:/usr/lib/firmware"
to retain the old behaviour.
2013-03-18 15:19:51 +01:00
Zbigniew Jędrzejewski-Szmek
24be982274 Remove or indent #define GNU_SOURCE
It is only needed in files designed to be usable in standalone
compilation. In those files the #ifdefinery is indented. When
compiling in-tree, GNU_SOURCE is always defined, so remove one
definition.
2013-03-11 18:03:13 -04:00
Rob Clark
bb26309dd0 udev: fix segfault with android rndis
The android gadget driver for network tethering over rndis somehow has a
parent device with a null subsystem.  Probably this is bug in android driver,
but it is easy enough to make systemd/udev behave gracefully and not
segfault.  And this will help for making linux distros with systemd
(like fedora) work on android devices.
2013-03-03 19:02:36 +01:00
Kay Sievers
1d600df55b udev: remove database conversion code 2013-03-03 18:35:22 +01:00
Kay Sievers
3f60bcb5e6 udev: firmware - do not created /run/udev/firmware-missing/
The userspace firmware loader is deprecated now, and will be entirely
removed when we depend on a kernel version with the built-in firmware
loader available.
2013-03-03 18:31:52 +01:00
Kay Sievers
7962afbba9 udev: usb_id: parse only 'size' bytes of the 'descriptors' buffer 2013-02-17 21:16:56 +01:00
Kay Sievers
a2cbfd5916 udev: usb_id - ignore non-ASCII serial numbers
On Thu, Feb 7, 2013 at 3:52 PM, Robert Milasan <rmilasan@suse.com> wrote:
> Hi, seems that using some strange usb devices with really bogus serial
> numbers usb_id creates links with junk strings in it:
>
> /dev/disk/by-id/usb-TSSTcorp_BDDVDW_SE-506AB_㡒䍌䜶䉗ぁㄴ㌴†ँ-0:0
>
> Initially was believed that usb_id is to blame, then the kernel, but it
> turns out that really the usb cd/dvd drive has this bogus serial number:
>
> output from dmesg:
> [  538.200160] usb 1-2: new high-speed USB device number 5 using
> ehci_hcd [  538.335067] usb 1-2: New USB device found, idVendor=0e8d,
> idProduct=1956 [  538.335080] usb 1-2: New USB device strings: Mfr=1,
> Product=2, SerialNumber=3 [  538.335089] usb 1-2: Product: MT1956
> [  538.335097] usb 1-2: Manufacturer: MediaTek Inc
> [  538.335105] usb 1-2: SerialNumber:
> \xffffffe3\xffffffa1\xffffff92\xffffffe4\xffffff8d\xffffff8c ...
> [  538.337540] scsi6 : usb-storage 1-2:1.0 [  539.341385] scsi 6:0:0:0:
> CD-ROM            TSSTcorp BDDVDW SE-506AB  TS00 PQ: 0 ANSI: 0
> [  539.354240] sr0: scsi3-mmc drive: 0x/24x writer dvd-ram cd/rw
> xa/form2 cdda tray [  539.354777] sr 6:0:0:0: Attached scsi CD-ROM sr0
> [  539.355122] sr 6:0:0:0: Attached scsi generic sg2 type 5
2013-02-17 21:16:08 +01:00
Zeeshan Ali (Khattak)
ddb5bee15a udev: expose new ISO9660 properties from libblkid 2013-02-17 02:47:17 +01:00
Harald Hoyer
a5c32cff1f honor SELinux labels, when creating and writing config files
Also split out some fileio functions to fileio.c and provide a SELinux
aware pendant in fileio-label.c

see https://bugzilla.redhat.com/show_bug.cgi?id=881577
2013-02-14 16:19:38 +01:00
Thomas Hindoe Paaboel Andersen
090be86534 use streq instead of strcmp 2013-02-13 18:14:20 +01:00
Thomas Hindoe Paaboel Andersen
b43d1d01ea util: introduce strcaseeq/strncaseeq 2013-02-13 00:56:13 +01:00
Thomas Hindoe Paaboel Andersen
641906e936 use strneq instead of strncmp 2013-02-13 00:56:13 +01:00
Kay Sievers
38d70045d1 udev: use unique names for temporary files created in /dev
On Tue, Feb 12, 2013 at 2:18 PM, Robert Milasan <rmilasan@suse.com> wrote:
> Under some circumstances udev mixed with multipath fails:
>
> udevd-work[1376]:
> symlink(../../sdk, /dev/disk/by-id/scsi-36005076305ffc0670000000000002842.udev-tmp)
> failed: File exists udevd-work[1432]:
> rename(/dev/disk/by-id/scsi-36005076305ffc0850000000000000a88.udev-tmp, /dev/disk/by-id/scsi-36005076305ffc0850000000000000a88)
> failed: No such file or directory
>
> This is non-fatal, but there is no point of created the symlink or
> renaming the symlink if it already exists.
>
> Reference: https://bugzilla.novell.com/show_bug.cgi?id=791503

It looke like this now:
  stat("/dev/disk/by-id", {st_mode=S_IFDIR|0755, st_size=80, ...}) = 0
  symlink("../../sda", "/dev/disk/by-id/ata-INTEL...N.tmp-b8:0") = 0
  rename("/dev/disk/by-id/ata-INTEL...N.tmp-b8:0", "/dev/disk/by-id/ata-INTEL...N") = 0
2013-02-12 16:08:14 +01:00
Harald Hoyer
a0ec302b93 cdrom_id: add data track count for bad virtual drive implementations
/# /lib/udev/cdrom_id --debug /dev/sr0
probing: '/dev/sr0'
INQUIRY: [AMI     ][Virtual CDROM   ][1.00]
GET CONFIGURATION failed with SK=5h/ASC=20h/ACQ=00h
drive is pre-MMC2 and does not support 46h get configuration command
trying to work around the problem
READ DISC INFORMATION failed with SK=5h/ASC=20h/ACQ=00h
no current profile, but disc is present; assuming CD-ROM
READ TOC: len: 12, start track: 1, end track: 1
last track 1 starts at block 0
READ DISC INFORMATION failed with SK=5h/ASC=20h/ACQ=00h
ID_CDROM=1
ID_CDROM_MEDIA=1
ID_CDROM_MEDIA_CD=1

What is missing here is ID_CDROM_MEDIA_TRACK_COUNT_DATA to trigger
blkid in /lib/udev/rules.d/60-persistent-storage.rules

KERNEL=="sr*", ENV{DISK_EJECT_REQUEST}!="?*",
	ENV{ID_CDROM_MEDIA_TRACK_COUNT_DATA}=="?*",
	ENV{ID_CDROM_MEDIA_SESSION_LAST_OFFSET}=="", \
		  IMPORT{builtin}="blkid --noraid"
2013-02-12 15:27:30 +01:00
Kay Sievers
3e49f2ecb5 udev: udevadm hwdb - add --root=
https://bugs.freedesktop.org/show_bug.cgi?id=60398
2013-02-08 12:00:05 +01:00
Kay Sievers
7850b3b837 shared: conf-files - add root parameter 2013-02-08 10:23:04 +01:00
Kay Sievers
beb23689e3 udev: remove HWDB_BIN 2013-02-07 21:54:49 +01:00
Martin Pitt
4dbcb1b3ba keymap: Add HP HDX 9494NR
Add touchpad and www keys.

https://bugzilla.redhat.com/show_bug.cgi?id=757928
2013-01-28 07:41:36 +01:00
Ayan George
c437b20d6e keymap: Add support for the brower hotkey on the HP ProBook
https://bugs.launchpad.net/bugs/1105191
2013-01-28 07:30:01 +01:00
Kay Sievers
22582bb2cb udev: set default rules permissions only at "add" events 2013-01-27 21:46:36 +01:00
Kay Sievers
25da63b9da udev: net_id - add link to the wiki page 2013-01-19 16:01:26 +01:00
Kay Sievers
f4ddacbd4d udev: net_id - suppress bcma core == 0 2013-01-17 03:30:07 +01:00
Kay Sievers
984c4348ff udev: net_id - handle "bcma" buses 2013-01-17 02:10:58 +01:00
Kay Sievers
59d86149b0 udev: path_id - clarify comment about the kernel ATA naming problem 2013-01-17 00:00:02 +01:00
Bastien Nocera
1d010426c0 udev: Fix device matching in the accelerometer
As we were searching by ID_PATH, it would have been possible
for us to find a sibling device instead of the device we were
looking for.

This fixes device matching on the WeTab with the upstream kernel,
as it was trying to use the "Asus Laptop extra buttons" device
instead of the accelerometer.
2013-01-10 14:28:48 +01:00
Thomas Hindoe Paaboel Andersen
b929bf049d tabs to spaces
Skipped bootchart and various files that looked like they should be
kept in sync with external sources.
2013-01-09 21:20:43 +01:00
Kay Sievers
d5a89d7dc1 udev: move string copy functions to shared/ 2013-01-09 19:06:46 +01:00
Lukas Nykryn
3c123e0899 udev: don't call fclose on NULL in is_pci_multifunction 2013-01-09 17:14:40 +01:00
Kay Sievers
72bc96f078 udev: net_id - skip stacked network devices 2013-01-08 14:54:12 +01:00
Kay Sievers
1328f66ad1 udev: net_id - append "dev_id" value if needed 2013-01-04 19:08:08 +01:00
Kay Sievers
48a849ee17 udev: set device node permissions only at "add" events 2013-01-04 16:15:46 +01:00
Kay Sievers
1edefa4f1d udev: in addition to DEVMODE, honor DEVUID, DEVGID from the uevent 2012-12-31 04:48:44 +01:00
Lukas Nykryn
5bbbe461fd udevd: add missing ':' to getopt_long 'e'
Parameter -e is set without additional argument in getopt
and this leads to segfault when calling 'systemd-udevd -e'.
2012-12-22 15:19:15 +01:00
Sami Kerola
23757887f7 licence: remove references to old FSF address
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=57206
2012-12-17 11:41:31 +01:00
Kay Sievers
decd634e80 udev: net_id: update comments 2012-12-09 14:49:28 +01:00
Kay Sievers
971e7fb625 udev: net_id - fix OUI handling 2012-12-06 21:37:10 +01:00
Kay Sievers
0d6ce9236f udev: net_id - fix typos 2012-12-06 21:27:42 +01:00
Kay Sievers
ad37f393fa udev: net_id - update examples 2012-12-06 21:25:39 +01:00
Kay Sievers
f610d6de38 udev: net_id - update examples 2012-12-06 21:09:30 +01:00
Kay Sievers
0260944060 udev: net_id - provide path names for USB devices 2012-12-06 20:44:28 +01:00
Tom Gundersen
5fe25affc0 hwdb: add IAB to the OUI database
The individual address block is a poor man's organizationally unique
identifier.

Perhaps we should change the udev key from ID_OUI_FROM_DATABASE to
something like ID_IEEE_VENDOR_FROM_DATABASE?

Suggested-by: Diego Elio Pettenò <flameeyes@flameeyes.eu>
2012-12-04 02:11:37 +01:00
Kay Sievers
137661d875 udev: net_id - clarify comments 2012-12-03 15:47:18 +01:00
Kay Sievers
472780d8b1 udev: hwdb - fix OUI lookup 2012-12-02 02:00:57 +01:00
Kay Sievers
de892aea1c udev: net_id - suppress function number for single-function devices 2012-11-30 19:27:42 +01:00
Martin Pitt
a5dea3d43b keymap: Add Samsung 700T
https://bugzilla.redhat.com/show_bug.cgi?id=879691
2012-11-28 21:33:26 +01:00
Alessandro Crismani
68c77c2f61 keymap: Update the list of Samsung Series 9 models
Currently, keymaps are provided only for the NP90X3A laptop. Samsung
introduced updated models, codenamed 900X3B, 900X3C, 900X4B, 900X4C,
which are currently not matched by udev rules. This patch includes the
newer modules in udev rules and move the samsung-n90x3a file defining
keys to a more generic samsung-series-9 file.

The patch was tested on a 900X4C laptop, and other people reported
that the rules also work for 900X3B and 900X3C ones.
2012-11-28 21:27:03 +01:00
Kay Sievers
5b8180d3f6 udev: net_id - merge properties into the correct device 2012-11-26 15:03:06 +01:00
Kay Sievers
0035597a30 udev: net_id - export PCI hotplug slot names 2012-11-26 14:07:16 +01:00
Kay Sievers
01d183ddae udev: net_id - read ACPI _SUN -- slot user number 2012-11-23 15:02:46 +01:00
Hannes Reinecke
a24d03b8ee udev: path_id - handle Hyper-V devices
Hyper-V has an abstract bus, which gets renumbered on guest
startup. So instead of the bus numbers we should be using
the device GUIDs, which can be retrieved from the 'device_id'
sysfs attribute.
2012-11-23 14:12:39 +01:00
Tom Gundersen
e32a4e1ef4 hwdb: fix usage
--create is not a valid option.
2012-11-21 02:49:24 +01:00
Tom Gundersen
e30431623a build-sys: make loadable module support optional
kmod is unecessary if loadable module support is disabled in the kernel,
so make the dependency optional.
2012-11-20 19:35:27 +01:00
Kay Sievers
d23965a64e udev: net - add device naming properties 2012-11-20 18:10:45 +01:00
Kay Sievers
3fd0c4c66d udev: fix whitespace 2012-11-20 18:07:14 +01:00
Zbigniew Jędrzejewski-Szmek
ee623f0d0c hwdb: use $(localstatedir)/lib/udev/hwdb.bin for the binary database
It's not configuration, so it doesn't belong in udev.

Also, remove the catalog when uninstalling udev.
2012-11-16 23:29:56 +01:00
Umut Tezduyar
5bb633f13a udev: firmware - disable firmware loading when firmware file is 0 byte
If firmware file is not found in the file system, udev
terminates firmware loading. This is not the case if
firmware file exists in the file system but doesn't have
any data in it.
2012-11-16 17:07:19 +01:00
Anders Olofsson
f553b3b107 udev: make blkid optional
I'm building systemd for an embedded system and we would prefer not having
to include the entire util-linux package just to get a libblkid whose
functionality we don't need.
2012-11-16 01:17:18 +01:00
Kay Sievers
33c770b174 udev: hwdb - properly handle a missing database
On Thu, Nov 15, 2012 at 5:05 PM, Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> wrote:
> Something like this appeared with latest git:
>
> Nov 15 16:55:46 fedora-15 systemd-udevd[334]: worker [364] terminated by signal 11 (Segmentation fault)
> Nov 15 16:55:46 fedora-15 [387]: Process 364 (systemd-udevd) dumped core.
> Nov 15 16:55:46 fedora-15 systemd-udevd[334]: worker [364] failed while handling '/devices/virtual/net/lo'
> Nov 15 16:55:46 fedora-15 systemd-udevd[334]: worker [360] terminated by signal 11 (Segmentation fault)
> Nov 15 16:55:46 fedora-15 systemd-udevd[334]: worker [360] failed while handling '/devices/pci0000:00/0000:00:03.0/virtio0/net
> Nov 15 16:55:46 fedora-15 [389]: Process 360 (systemd-udevd) dumped core.
>
> Core was generated by usr/lib/systemd/systemd-udevd'.
> Program terminated with signal 11, Segmentation fault.
> #0  0x0000000000423c87 in udev_hwdb_get_properties_list_entry (hwdb=0x0, modalias=0x7fffbcd155f0
2012-11-15 17:30:03 +01:00
Kay Sievers
bf9d233f78 udev: properly handle symlink removal by 'change' event
If a 'change' event is supposed to remove created symlinks, we create
a new device structure from the sysfs device and fill it with the list
of links, to compute the delta of the old and new list of links to apply.
If the device is already 'remove'd by the kernel though, udev fails to
create the device structure, so the links are not removed properly.

> From: Neil Brown <nfbrown@suse.com>
> Date: Thu, 8 Nov 2012 10:39:06 +0100
> Subject: [PATCH] If a 'change' event does not get handled by udev until
> after the device has subsequently disappeared, udev mis-handles
> it. This can happen with 'md' devices which emit a change
> event and then a remove event when they are stopped. It is
> normally only noticed if udev is very busy (lots of arrays
> being stopped at once) or the machine is otherwise loaded
> and reponding slowly.
>
> There are two problems.
>
> 1/ udev_device_new_from_syspath() will refuse to create the device
>    structure if the device does not exist in /sys, and particularly if
>    the uevent file does not exist.
>    If a 'db' file does exist, that is sufficient evidence that the device
>    is genuine and should be created.  Equally if we have just received an
>    event from the kernel about the device, it must be real.
>
>    This patch just disabled the test for the 'uevent' file, it doesn't
>    try imposing any other tests - it isn't clear that they are really
>    needed.
>
> 2/ udev_event_execute_rules() calls udev_device_read_db() on a 'device'
>    structure that is largely uninitialised and in particular does not
>    have the 'subsystem' set.  udev_device_read_db() needs the subsystem
>    so it tries to read the 'subsystem' symlink out of sysfs.  If the
>    device is already deleted, this naturally fails.
>    udev_event_execute_rules() knows the subsystem (as it was in the
>    event message) so this patch simply sets the subsystem for the device
>    structure to be loaded to match the subsystem of the device structure
>    that is handling the event.
>
> With these two changes, deleted handling of change events will still
> correctly remove any symlinks that are not needed any more.

Use udev_device_new() instead of allowing udev_device_new_from_syspath()
to proceed without a sysfs device.
2012-11-13 02:14:17 +01:00
Thomas Hindoe Paaboel Andersen
33b4055123 remove duplicate semicolons 2012-11-12 22:38:44 +01:00
Kay Sievers
1298001ec5 use the same email address everywhere 2012-11-12 19:47:43 +01:00
Kay Sievers
40fe8b11be udev: use usec_t and now() 2012-11-12 01:03:14 +01:00
Kay Sievers
a660c63c55 udev: net_id - add builtin to retrieve data for network devices 2012-11-09 13:05:19 +01:00
Kay Sievers
59803c380d udev: hwdb - search parents for 'modalias' and data 2012-11-09 13:05:11 +01:00
Kay Sievers
c3cfed0d6c udev: update file headers 2012-11-09 12:39:27 +01:00
Kay Sievers
3a4431ef72 udev: break over-long lines 2012-11-02 00:32:10 +01:00
Kay Sievers
23b7245397 udev: add "udevadm hwdb --test=<modalias>" 2012-10-28 04:41:15 +01:00
Kay Sievers
ff944daa01 udev: get rid of SYSCONFDIR 2012-10-28 04:04:22 +01:00
Kay Sievers
2001208c2a libudev: import hwdb and export lookup interface 2012-10-27 23:39:41 +02:00
Martin Pitt
221a6c2a26 keymap: Add HP EliteBook 8440p
Thanks to Glen Ditchfield <gjditchfield@acm.org>!

https://launchpad.net/bugs/1071579
2012-10-26 06:31:14 +02:00
Kay Sievers
4af113f997 udev: builtin - do not fail builtin initialization if one of them returns an error 2012-10-26 03:45:25 +02:00
Kay Sievers
a9f4815da5 udev: kmod - fix typo 2012-10-26 00:36:32 +02:00
Kay Sievers
5b4d50efe8 udev: kmod, hwdb - do not fail if databases are not available 2012-10-25 22:58:02 +02:00
Kay Sievers
3b0a5f2023 udev: hwdb - exit if no database is available 2012-10-25 22:22:29 +02:00
Kay Sievers
7ee40fc3e9 udev: hwdb validate() return when the database is not opened 2012-10-25 22:08:33 +02:00
Kay Sievers
1c574591db udev: hwdb - remove run_once 2012-10-25 21:44:33 +02:00
Kay Sievers
c225f2ffc8 udev: hwdb - properly initialize search structure 2012-10-25 21:44:33 +02:00
Kay Sievers
e5f2783e73 udev: set optind = 0, not the usual 1, to reset getopt_long()s internal state 2012-10-25 21:31:38 +02:00
Kay Sievers
796b06c21b udev: add hardware database support 2012-10-23 16:43:32 +02:00