Commit Graph

193 Commits

Author SHA1 Message Date
Martin Pitt 561d496d0b rules: add persistent links for nbd devices (#4785)
https://bugs.debian.org/837999
2016-12-01 16:22:47 -05:00
Michal Sekletar a5110c9030 rules: introduce disk/by-id (model_serial) symlinks for NVMe drives (#3974)
$ ls -l /dev/disk/by-id/nvme*
lrwxrwxrwx. 1 root root 13 Aug 17 04:25 /dev/disk/by-id/nvme-HUSPR3216AHP301_STM0001B6780 -> ../../nvme0n1
lrwxrwxrwx. 1 root root 15 Aug 17 04:25 /dev/disk/by-id/nvme-HUSPR3216AHP301_STM0001B6780-part1 -> ../../nvme0n1p1

https://github.com/systemd/systemd/issues/1453
https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=779ff75617099f4defe14e20443b95019a4c5ae8
2016-08-17 14:10:28 +02:00
Lennart Poettering 32eae3c2a8 rules: make sure always set at least one property on rfkill devices
The rfkill service waits for rfkill device initialization as reported by
udev_device_is_initialized(), and if that is never reported it might dead-lock.

However, udev never reports completed initialization for devices that have no
properties or tags set. For some rfkill devices this might be the case, in
particular those which are connected to exotic busses, where path_id returns
nothing.

This patch simply sets the SYSTEM_RFKILL property on all rfkill devices, to
ensure that udev_device_is_initialized() always reports something useful and we
don't dead-lock.

Fixes: #2745
2016-07-20 09:17:57 +02:00
Rusty Bird 542127ea96 rules: UDEV_DISABLE_PERSISTENT_STORAGE_RULES_FLAG property (#3714)
Sometimes, the persistent storage rules should be skipped for a subset
of devices. For example, the Qubes operating system prevents dom0 from
parsing untrusted block device content (such as filesystem metadata) by
shipping a custom 60-persistent-storage.rules, patched to bail out early
if the device name matches a hardcoded pattern.

As a less brittle and more flexible alternative, this commit adds a line
to the two relevant .rules files which makes them test the value of the
UDEV_DISABLE_PERSISTENT_STORAGE_RULES_FLAG device property, modeled
after the various DM_UDEV_DISABLE_*_RULES_FLAG properties.
2016-07-15 18:47:42 +02:00
bgbhpe f3bc4ccc2e rules: block: add support for pmem devices (#3683)
Persistent memory devices can be exposed as block devices as /dev/pmemN
and /dev/pmemNs.  pmemN is the raw device and is byte-addressable from
within the kernel and when mmapped by applications from a DAX-mounted
file system.  pmemNs has the block translation table (BTT) layered on top,
offering atomic sector/block access.  Both pmemN and pmemNs are expected
to contain file systems.

blkid(8) and lsblk(8) seem to correctly report on pmemN and pmemNs.
systemd v219 will populate /dev/disk/by-uuid/ when, for example, mkfs is
used on pmem, but systemd v228 does not.

Add pmem to the whitelist.
2016-07-08 17:43:56 +02:00
Peter Hutterer 0bb7b9860f hwdb: add a 70-touchpad.hwdb to tag internal vs external touchpads
Add a new key ID_INPUT_TOUCHPAD_INTEGRATION=internal|external so we have a
single source for figuring out which touchpads are built-in.

Fairly simple approach: bluetooth is external, usb is external unless it's an
Apple touchpad. Everything else is internal.
2016-07-01 15:25:34 +10:00
Peter Hutterer 83b481599b rules: set ID_BUS for bluetooth, rmi and i8042
Something has to so we can have udev rules rely on this. Right now the ID_BUS
setting is inconsistent: usb is set, ata and pci are set, bluetooth is not
set, rmi is too new to be featured.

70-mouse even relied on bluetooth even though it was never set
2016-07-01 15:19:46 +10:00
Lennart Poettering a4e9499d8d rules: block - add scm block devices to whitelist (#3494)
Since the introduction of the whitelist in 60-persistent-storage.rules
block device symlinks are no longer created for scm block devices.

Add scm to the whitelist.

Signed-off-by: Sebastian Ott <sebott@linux.vnet.ibm.com>
2016-06-10 15:19:26 +02:00
Uwe Kleine-König cf1d3efce9 rules: add /dev/disk/by-partuuid symlinks also for dos partition tables
blkid reports PARTUUID values also for partitions that are defined by a
dos partitioning scheme. Instead of limiting the partitioning scheme to
"gpt or dos" just drop the test for the partitioning scheme and trust
blkid to do the right thing.
2016-05-19 08:37:20 +02:00
Ming Lin 427a28ecbe rules: add NVMe rules (#3136)
Add NVMe rules using the "wwid" attribute.

root@target:~# cat /sys/block/nvme0n1/wwid
eui.3825004235000591

root@target:~# ls /dev/disk/by-id/ -l |grep nvme
lrwxrwxrwx 1 root root 13 Apr 27 16:08 nvme-eui.3825004235000591 -> ../../nvme0n1
lrwxrwxrwx 1 root root 15 Apr 27 16:08 nvme-eui.3825004235000591-part1 -> ../../nvme0n1p1
lrwxrwxrwx 1 root root 15 Apr 27 16:08 nvme-eui.3825004235000591-part2 -> ../../nvme0n1p2
2016-04-29 13:02:57 +02:00
Wouter Verhelst 565754a37e Mark nbd as inactive until connected (#2422)
Currently, 99-systemd.rules.in contains a line for network block
devices, which mark them as inactive until the first change event, and
as active from then on forward. This is not correct. A network block
device can be connected or disconnected; this state is signalled by the
presence or absense of a "pid" file, which contains the PID of the
nbd client userspace process that started the connection.

Update the rules file so that it checks for the presence of that file to
decide what to set SYSTEMD_READY to.

Note that current kernels do issue a change event upon connecting the
device, but not yet upon disconnecting. While it's possible to wait
until that's been fixed, the behaviour of the rule with TEST!="pid" in
the absence of a proper uevent is exactly the same as the behaviour of
the old rule; so it should be safe to apply now.

Signed-off-by: Wouter Verhelst <w@uter.be>
2016-04-18 16:29:10 +02:00
Lukáš Nykrýn 35a6750d9e rules: set SYSTEMD_READY=0 on DM_UDEV_DISABLE_OTHER_RULES_FLAG=1 only with ADD event (#2747)
The "SYSTEMD_READY=0" will cause automatic unmount
of mountpoint that is on top of such DM device
if this is used with multipath which sets
DM_UDEV_DISABLE_OTHER_RULES_FLAG in case
we have a CHANGE event thatcomes after DM multipath
device reload when one of the paths is down or up.

See https://bugzilla.redhat.com/show_bug.cgi?id=1312011
2016-04-12 07:44:28 +02:00
Lennart Poettering d35c1bb1f4 rfkill: rework and make it listen on /dev/rfkill
With this rework we introduce systemd-rfkill.service as singleton that
is activated via systemd-rfkill.socket that listens on /dev/rfkill. That
way, we get notified each time a new rfkill device shows up or changes
state, in which case we restore and save its current setting to disk.

This is nicer than the previous logic, as this means we save/restore
state even of rfkill devices that are around only intermittently, and
save/restore the state even if the system is shutdown abruptly instead
of cleanly.

This implements what I suggested in #1019 and obsoletes it.
2015-10-01 16:21:09 +02:00
Thomas Meyer 7519d221e0 UML: Fix block device setup
User mode linux block devices start with ubd, e.g. ubda, ubdb, etc..
2015-08-09 18:07:55 +02:00
Kay Sievers 604f02add6 rules: block - add dasd to whitelist 2015-07-05 16:22:30 +02:00
Tom Gundersen ab49ae5ba6 Merge pull request #387 from kaysievers/wip
udev: Remove accelerometer helper
2015-06-29 16:02:33 +02:00
Cédric Delmas ba27fb2111 Process cciss devices
Do not skip the persistent storage rules for cciss devices
2015-06-29 09:54:58 +02:00
Bastien Nocera 0051ebf7e5 udev: Remove accelerometer helper
It's moved to the iio-sensor-proxy D-Bus service.
2015-06-27 21:48:52 +02:00
Greg Kroah-Hartman 57a2bf2329 Merge pull request #353 from kaysievers/hid
rules: remove all power management from udev
2015-06-26 09:51:11 -07:00
Peter Hutterer 0530459245 Revert "hwdb: add a touchpad hwdb"
The main purpose of this hwdb was to tag touchpads that have the physical
trackstick buttons wired to the touchpad (Lenovo Carbon X1 3rd, Lenovo *50
series).  This hwdb is not required on kernels 4.0 and above, the kernel now
re-routes button presses through the trackstick's device node. Userspace does
not need to do anything.

See kernel commit cdd9dc195916ef5644cfac079094c3c1d1616e4c.

This reverts commit 001a247324.
2015-06-26 16:09:48 +10:00
Kay Sievers e2452eef02 rules: remove all power management from udev
It is not udev's task to apply any of these setting that way, or
from udev rules files. Things need to be sortet out in the kernel,
or explicit whitelist can possibly be added to the hardware database.
Until that is sorted out, and general agreement, udev is not
willing to maintain any such lists or power management settings
in general.

"Thanks for digging this out! I thought my Kinesis keyboard got broken
and ordered a new one, only to find out that the new one doesn't work
as well. I'm not sure whether we should start collecting a blacklist
of keyboards which don't work with USB autosuspend, or rather a
whitelist? Or revert this wholesale?"

  https://github.com/systemd/systemd/issues/340
2015-06-24 13:18:53 +02:00
Alex Crawford fb2d301085 rules: re-add cciss rules
The original commit (1aff206) doesn't explain why these were removed.
This adds them back since they are in fact needed.
2015-06-10 15:49:41 -07:00
Alex Crawford bb5c512de2 rules: whitelist xvd* devices
Xen disks need to be whitelisted as well.
2015-06-08 18:22:21 -07:00
Ed Swierk ff2aa01e61 Add /dev/xvd* to 60-persistent-storage whitelist
Without this, systemd-udevd does not create persistent storage symlinks
for xen block devices.
2015-06-03 08:08:37 -07:00
David Mohr 19672f1e5f udev: Bring back persistant storage symlinks for bcache
https://bugs.debian.org/787367
2015-06-01 11:44:52 +02:00
Tom Gundersen b50063512d rules: restore block watch after CHANGE events
When processing an event, the watch is disabled, make sure it is restorted after
a CHANGE event has been processed.
2015-05-30 02:14:25 +02:00
Tom Gundersen f07689517e rules: fix typo in block watch rule
The intention was to turn this rule from using a blacklist to a whitelist, but
there was a stray '!'.
2015-05-30 02:14:25 +02:00
Adam Goode 5c0b72de3a rules: Add more firewire properties for sound, to be closer to USB and PCI
USB and PCI soundcards have a nice set of ID_* properties. It would
be handy for firewire soundcards to have the same.

Note that this removes the explicit setting of ID_ID in the firewire
conditional. Because we are now setting ID_SERIAL, ID_ID will come
from later in the file.
2015-04-23 13:40:54 +02:00
Adam Goode 0414af1dfe rules: Don't use ALSA card id in ID_ID
The ALSA id sysattr is generated by the sound subsystem and is not
a stable identifier. It is generated though some string manipulation
then made unique if there is a conflict. This means that it is
enumeration-dependent and shouldn't be used for ID_ID.

If ID_ID is supposed to be system-unique, it is not already since
for firewire it is generated from the guid and there are broken
firewire devices that have duplicate guids across devices.

This is tracked for PulseAudio at
https://bugs.freedesktop.org/show_bug.cgi?id=90129.

This is essentially a revert of systemd
ed1b2d9fc7.
2015-04-23 13:40:54 +02:00
Zbigniew Jędrzejewski-Szmek c7e3c3ecac rules: finish incomplete rename
Fixup for 51c0c28698.
2015-04-12 10:20:24 -04:00
Matthew Garrett 64713f9252 rules: fix tests for removable state
We only care about whether our direct parent is removable, not whether any
further points up the tree are - the kernel will take care of policy for
those itself. This enables autosuspend on devices where the root hub reports
that its removable state is unknown.
2015-04-11 12:22:17 +02:00
Peter Hutterer 51c0c28698 udev: builtin-keyboard: add support for EVDEV_ABS_*
Parse properties in the form
EVDEV_ABS_00="<min>:<max>:<res>:<fuzz>:<flat>"

and apply them to the kernel device. Future processes that open that device
will see the updated EV_ABS range.

This is particularly useful for touchpads that don't provide a resolution in
the kernel driver but can be fixed up through hwdb entries (e.g. bcm5974).

All values in the property are optional, e.g. a string of "::45" is valid to
set the resolution to 45.

The order intentionally orders resolution before fuzz and flat despite it
being the last element in the absinfo struct. The use-case for setting
fuzz/flat is almost non-existent, resolution is probably the most common case
we'll need.

To avoid multiple hwdb invocations for the same device, replace the
hwdb "keyboard:" prefix with "evdev:" and drop the separate 60-keyboard.rules
file. The new 60-evdev.rules is called for all event nodes
anyway, we don't need a separate rules file and second callout to the hwdb
builtin.
2015-04-11 08:44:33 +10:00
Harald Hoyer a06c8219a3 50-udev-default.rules: don't run anything but REMOVE_CMD on remove
we don't want to run usb_id and input_id on ACTION=="remove"
2015-03-27 15:42:04 +01:00
Mantas Mikulėnas afa91a7231 rules: storage - support MemoryStick (non-Pro) cards
These are handled by a different driver than MemoryStick Pro.
2015-03-24 23:34:58 +01:00
Kay Sievers 174470fbf1 rules: storage - whitelist partitioned MS & MMC devices
On Mon, Mar 23, 2015 at 8:55 AM, Mantas Mikulėnas <grawity@gmail.com> wrote:
> On Tue, Mar 17, 2015 at 11:50 PM, Kay Sievers <kay@vrfy.org> wrote:
>> On Tue, Mar 17, 2015 at 5:00 PM, Mantas Mikulėnas <grawity@gmail.com>
>> wrote:
>> > Accidentally dropped in 1aff20687f.
>> > ---
>> >  rules/60-persistent-storage.rules | 2 +-
>> >  1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> > +KERNEL!="loop*|mmcblk[0-9]*|mspblk[0-9]*|nvme*|sd*|sr*|vd*",
>> > GOTO="persistent_storage_end"
>>
>> We can't do that, we need to ignore the mmc*rpmb devices:
>>
>> http://cgit.freedesktop.org/systemd/systemd/commit/?id=b87b01cf83947f467f3c46d9831cd67955fc46b9
>>
>> Maybe "mmcblk*[0-9]" will work?
>
> Yeah, that would probably work (the names are like mmcblk0p1 etc.)
2015-03-24 23:28:25 +01:00
Tom Gundersen c6e20ceb09 rules: storage - don't apply rules to remove events
This line was accidentally lost in 52346b5f54.
2015-03-24 15:23:49 +01:00
David Herrmann 9a2e1571c0 rules: avoid 'device/' accesses
We should never access parents, as the sysfs hierarchy is in no way
stable. Use KERNELS== etc. to match on a parent, then access it via
$attr{} (which accesses the matching device, not the current device).
2015-03-20 12:28:12 +01:00
David Herrmann 568d800b78 rules: fix input-name for keyboard rules
We match on the evdev node, but only the parent has a "name" attribute.
Use $attr{device/name} to access it.

This is borked since 2013, I wonder how that ever worked? Maybe this will
suddenly fix all the DMI-based key detections.

Thanks to Peter Hutterer for catching this!
2015-03-20 10:45:42 +01:00
Kay Sievers 9a3d3aace3 rules: keyboard - prefix "atkbd" match strings like we prefix the "name" strings 2015-03-16 18:43:14 +01:00
Kay Sievers d83891ec7f rules: keyboard - only search the "input" subsystem for the modalias 2015-03-16 18:34:33 +01:00
David Herrmann b17de8449c Revert "hwdb: merge atkbd into platform matches"
This reverts commit ba76ee29bc. As it turns
out, we need to match on driver=atkbd to not load the fixups on any
plugged USB devices.

That is, whenever you use "name:<name>:dmi:<dmi>" style matches, you
better provide a name or you're screwing things up.
2015-03-16 15:52:48 +01:00
Kay Sievers 84a122a008 rules: keyboard - remove "platform" from comments 2015-03-16 13:46:48 +01:00
David Herrmann ba76ee29bc hwdb: merge atkbd into platform matches
Currently, we always run
  hwdb 'keyboard:name:$attr{name}:$attr{[dmi/id]modalias}'
as last step to match keyboards. Therefore, if nothing else matched so
far, we still try the device-name+dmi combination.

However, we have a special atkbd rule which is only run for atkbd as:
  hwdb 'keyboard:$attr{[dmi/id]modalias}'

This is redundant, as we already pass the same information to hwdb in the
last fallback step.

This patch converts the hwdb "keyboard:dmi:*" matches to
"keyboard:name:*:dmi:*" matches and drops the redundant rule.
2015-03-16 12:19:09 +01:00
David Herrmann a9c30bca57 rules: drop redundant match
The 60-keyboard rules are already guared by KERNEL!="event*" bail-outs,
therefore, KERNELS="input*" is always true. Drop it!
2015-03-16 12:05:36 +01:00
David Herrmann aee26b1276 hwdb: support bluetooth keyboard fixups
Drop the restriction not to match on bluetooth devices. They are supported
just fine!
2015-03-16 12:04:38 +01:00
David Herrmann b26e4ced91 hwdb: convert to generic input-modalias matches
There is no reason to match on usb-modaliases, if we can use the
input-modalias to achieve the same. This commit changes the
keyboard-lookups to not be restricted to USB, but pass all modaliases to
the hwdb. Furthermore, we convert all usb:* matches to input:* matches,
thus getting rid of any ambiguity if multiple usb devices are chained (or
a bluetooth device / etc. is on top).

Note that legacy keyboard:usb:* matches are still supported, but
deprecated. If possible, please use keyboard:input:* matches instead.

This is a required step to make other input devices work with
60-keyboard.hwdb. Other bus-types are often chained on usb and we want to
avoid any ambiguity here if we incorrectly match on a USB hub.
2015-03-16 12:00:46 +01:00
Kay Sievers 1c5f4cb190 rules: merge tty and serial rules file 2015-03-12 17:22:19 +01:00
Kay Sievers 654b036ba7 rules: merge udev-late.rules files 2015-03-12 16:34:18 +01:00
Kay Sievers 757ba25a8f rules: default - remove legacy agpgart 2015-03-12 16:30:05 +01:00
Kay Sievers ea7b52374c rules: systemd - remove legacy "ram" from block device blacklist 2015-03-12 16:28:38 +01:00
Kay Sievers 52346b5f54 rules: move block device rules to its own rules file 2015-03-12 16:09:46 +01:00
Kay Sievers 1aff20687f rules: storage - relace blacklist with explicit whitelist
Newly added kernel drivers repeatedly pass our blacklist and
cause trouble for the devices, because they do not expect to
be examined by udev's default rules which include blkid.

This turns the blacklist into a whitelist. Device type which
need support for additional symlinks need to be added to the
whitelist now.

Note, that the by-id, by-path symlinks are only intended for
hotpluggable devices. There is no reason for exotic, or for
statically configured devices to provide them.
2015-03-12 15:16:00 +01:00
Martin Pitt 0c13be389f rules: simplify mmc RPMB handling
We don't actually want a by-path/ symlink for MMC RPMB devices, so just add
them to the blacklist. This will prevent creating wrong by-path links and
blkid'ing those.
2015-02-13 10:59:38 +01:00
Martin Pitt b87b01cf83 rules: Fix by-path of mmc RPMB partitions and don't blkid them
Linux 3.10+ exposes RPMB (Replay Protected Memory Block) partitions of MMC
devices [1] ; trying to read them with blkid or other unspecific means will
cause kernel buffer I/O errors and timeouts. So don't run blkid on these.

Also ensure that /dev/disk/by-path creates proper symlinks and exposes the
-rpmb partition separately, instead of letting the "normal" partition symlink
point to the rpbm device (this is a race condition).

[1] http://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=090d25fe224c0

https://launchpad.net/bugs/1333140
2015-02-13 08:39:07 +01:00
Peter Hutterer 001a247324 hwdb: add a touchpad hwdb
Currently used to tag devices in the new Lenovo *50 series and the X1 Carbon
3rd. These laptops re-introduced the physical trackpoint buttons that were
missing from the *40 series but those buttons are now wired up to the
touchpad.

The touchpad now sends BTN_0, BTN_1 and BTN_2 for the trackpoint. The same
button codes were used in older touchpads that had dedicated scroll up/down
buttons. Input drivers need to work around this and thus know what they're
dealing with.

For the previous gen we introduced INPUT_PROP_TOPBUTTONPAD in the kernel, but
the resulting mess showed that these per-device quirks should really live in
userspace.

The list currently includes the X1 Carbon 3rd PNPID, others will be added as
get to know which PNPID they have.
2015-01-29 13:06:04 +10:00
Martin Pitt 3b48ce4ec4 rules: clean up stale CD drive mounts after ejection
Ejecting a CD with the hardware drive button only causes a change uevent, but
the device node stays around (just without a medium). Pick up these uevents and
mark the device as SYSTEMD_READY=0 on ejection, so that systemd stops the
device unit and consequently all mount units on it.

On media insertion, mark the device as SYSTEMD_READY=1 again.

https://bugs.freedesktop.org/show_bug.cgi?id=72206
https://bugzilla.opensuse.org/show_bug.cgi?id=909418
https://bugs.archlinux.org/task/42071
https://bugs.launchpad.net/bugs/1168742
2015-01-28 17:04:06 +01:00
David Herrmann 244477333a udev: merge evdev_id into input_id
There is no reason to keep both separated. We want to avoid API specific
tools and instead keep generic terms like 'input'.
2015-01-15 14:13:49 +01:00
Carlos Garnacho b9e616cc22 udev: Add builtin/rule to export evdev information as udev properties
This rule is only run on tablet/touchscreen devices, and extracts their size
in millimeters, as it can be found out through their struct input_absinfo.

The first usecase is exporting device size from tablets/touchscreens. This
may be useful to separate policy and application at the time of mapping
these devices to the available outputs in windowing environments that don't
offer that information as readily (eg. Wayland). This way the compositor can
stay deterministic, and the mix-and-match heuristics are performed outside.

Conceivably, size/resolution information can be changed through EVIOCSABS
anywhere else, but we're only interested in values prior to any calibration,
this rule is thus only run on "add", and no tracking of changes is performed.
This should only remain a problem if calibration were automatically applied
by an earlier udev rule (read: don't).

  v2: Folded rationale into commit log, made a builtin, set properties
      on device nodes themselves
  v3: Use inline function instead of macro for mm. size calculation,
      use DECIMAL_STR_MAX, other code style issues
  v4: Made rule more selective
  v5: Minor style issues, renamed to a more generic builtin, refined
      rule further.
2015-01-11 23:41:42 -05:00
Peter Hutterer 60329a9d9f hwdb: add rule and first entry for PS/2 mice
https://bugs.freedesktop.org/show_bug.cgi?id=87037
2014-12-24 08:08:23 +10:00
Peter Hutterer 0213a26f65 hwdb: add a new db for the DPI/frequency settings of mice
Pointer acceleration for relative input devices (mice, trackballs, etc.)
applies to the deltas of the device. Alas, those deltas have no physical
reference point - a delta of 10 may be caused by a large movement of a
low-dpi mouse or by a minute movement of a high-dpi mouse.
Which makes pointer acceleration a bit useless and high-dpi devices
essentially unusable.

In an ideal world, we could read the DPI from the device directly and work
with that. In the world we actually live in, we need to compile this list
manually. This patch introduces the database, with the usual match formats
and a single property to be set on a device: MOUSE_DPI

That is either a single value for most mice, or a list of values for mice
that can change resolution at runtime. The exact format is detailed in the
hwdb file.

Note that we're explicitly overshooting the requirements we have for
libinput atm. Frequency could be detected in software and we don't
actually use the list of multiple resolutions (because we can't detect
when they change anyway). However, we might as well collect those values
from the get-go, adding/modifying what will eventually amount to hundreds
of entries is a bit cumbersome.

Note: we rely on the input_id builtin to tag us as mouse first, ordering
of the rules is important.

(David: fixed up typos and moved hwdb file into ./hwdb/)
2014-11-27 12:30:08 +01:00
Lennart Poettering 812bd1e6ab units: make sure rfkill service is bount to the actual hardware 2014-11-21 01:20:57 +01:00
Zbigniew Jędrzejewski-Szmek 1b600437ba /proc/sys prefixes are not necessary for sysctl anymore 2014-10-07 09:19:51 -04:00
Tom Gundersen b081b27e14 udev: import the full db on MOVE events for devices without dev_t 2014-09-09 15:03:49 +02:00
Mantas Mikulėnas 52e231b046 rules: net-setup-link - remove stray linebreak
If not backslash-escaped, it splits the rule in two.
2014-09-08 22:03:17 +02:00
Tom Gundersen e4d7c49050 rules: net-setup-link - preserve ID_NET_LINK_FILE and ID_NET_NAME after MOVE 2014-09-08 17:18:43 +02:00
Zbigniew Jędrzejewski-Szmek 70e7d754dd rules: remove firmware loading rules
blueness> poettering, was there a reason for not removing
          50-firmware.rules when you nuked userland firmware
          loading?

Followup for v216-119-gbe2ea723b1.
2014-09-01 12:55:23 -04:00
Kevin Wells b5df2eabf3 rules: allow systemd to manage loop device partitions
SYSTEMD_READY is currently set to 0 for all loop devices (loop[0-9]*)
that do not have a backing_file. Partitioned loop devices (ex. loop0p1),
however, are matched by this rule and excluded by systemd even though
they are active devices.

This change adds an additional check to the rule, ensuring that only
top level loop devices (loop[0-9]+$) are excluded from systemd.
2014-07-31 17:38:21 +02:00
Kay Sievers 64dfe7b744 rules: consistently use "?*" instead of "*?" 2014-07-15 02:04:47 +02:00
Tom Hirst 52fb538361 rules: don't enable usb pm for Avocent devices
The Avocent KVM over IP devices doesn't work correctly with USB power
management enabled.
2014-06-27 20:02:15 +02:00
Kay Sievers 27e7c26268 rules: add loop-control and btrfs-control to "disk" group 2014-06-18 03:37:32 +02:00
Kay Sievers 3dff3e00e0 udev: assign group "input" to all input devices 2014-06-12 14:59:53 +02:00
Kay Sievers f31cf2b6d0 udev: stop using "floppy" group 2014-06-11 11:20:55 +02:00
Kay Sievers 49804365ea udev: keyboard - also hook into "change" events
Re-apply the keymaps when "udevadm trigger" is called. Hooking into
"add" only would just remove all keymap content from the udev database
instead of applying the new config.
2014-05-26 09:30:21 +08:00
Gerd Hoffmann cd31d1884f rules: update qemu hid rules
Update comment to be a bit more specific.

Change match to blacklist the serial number of the broken devices
instead of whitelisting the serial number of the fixed devices.
This allows to do something useful with the serial number in the
future.
2014-03-24 08:30:57 -04:00
Hendrik Brueckner fc6c7fe9be getty: Start getty on 3270 terminals available on Linux on System z
Add the first 3270 terminal device that is associated with the Linux preferred
console to the list of virtualization consoles.  This is required to
automatically start a getty if the conmode=3270 kernel parameter is specified
for Linux on z/VM instances.  Note that a queued upstream patch also enable
the 3270 terminal device if it is associated with the Linux preferred console.
How

To successfully start agetty on a 3270 terminal, a change in the agetty
parameter order is required.  Previously, agetty would started like this:

    /sbin/agetty --keep-baud 3270/tty1 115200,38400,9600 TERM

The agetty program interprets the "3270/tty1" as baud rate and fails to start
with the "bad speed: 3270/tty1" error message.  Fixing this in agetty is more
complex rather than reordering the command line parameters like this:

    /sbin/agetty --keep-baud 115200,38400,9600 3270/tty1 TERM

According to agetty sources and "agetty --help", agetty accepts the "tty",
"baudrate tty", and "tty baudrate" specifications.

P.S. The "tty: Set correct tty name in 'active' sysfs attribute" introduces
     a change to display the terminal device which is associated with the
     Linux preferred console.  This change helps to let systemd handle this
     particular case only.  Without the changes of this commit, no additional
     3270 terminal device can be managed by systemd.

     https://git.kernel.org/cgit/linux/kernel/git/gregkh/tty.git/commit/?id=723abd87f6e536f1353c8f64f621520bc29523a3
2014-03-13 10:42:26 +01:00
Lennart Poettering 98b2f766b2 gpt-auto-generator: rename root device node symlink to /dev/gpt-auto-root
Before it was placed in /dev/disk/by-id, which makes it a bit too much
API. However, it's mostly an implementation detail for now, hence move
it out of the stable block device dir.
2014-03-11 17:43:41 +01:00
Peter Rajnoha ebc54302d7 rules: mark loop device as SYSTEMD_READY=0 if no file is attached
Check existence of loop/backing_file in sysfs and mark loop devices with
SYSTEMD_READY if missing. Such loop files is uninitialized and it's not
ready for use yet (there's no file attached).
2014-03-10 22:58:14 +01:00
Lennart Poettering 329f7803ee udev: automatically create a symlink /dev/disk/by-id/gpt-auto-root if there's a suitable root partition 2014-03-07 03:30:30 +01:00
Lukas Nykryn c594cccee2 udev/rules: setup tty permissions and group for sclp_line, ttysclp and 3270/tty 2014-02-27 11:19:09 +01:00
Tom Gundersen 95f41b7298 udev: net_setup - import ID_NET_DRIVER
This will do until all net properties are imported.
2014-02-21 22:59:29 +01: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
Jóhann B. Guðmundsson 99bd4af0c7 udev: add zram to the list of devices inappropriate for symlinks
udev seems to have a race condition with swapon to see which can open
/dev/zram0 first, causing swapon to fail. Seems to be most noticeable
on arm devices one out of every 7 times or something.
2014-02-05 19:29:33 -05:00
Hendrik Brueckner 07901fc142 s390/getty-generator: initialize essential system terminals/consoles
Ensure to start getty programs on all essential system consoles on Linux on
System z.  Add these essential devices to the list of virtualization_consoles
to always generate getty configurations.

For the sake of completion, the list of essential consoles is:

  /dev/sclp_line0 - Operating system messages applet (LPAR)
  /dev/ttysclp0 - Integrated ASCII console applet (z/VM and LPAR)
  /dev/ttyS0 - Already handled by systemd (3215 console on z/VM)
  /dev/hvc0  - Already handled by systemd (IUCV HVC terminal on z/VM)

Depending on the environment, z/VM or LPAR, only a subset of these terminals
are available.

See also RH BZ 860158[1] "Cannot login via Operating System Console into RHEL7
instance installed on a LPAR".  This bugzilla actually blocks the installation
of Linux on System z instances in LPAR mode.

[1] https://bugzilla.redhat.com/show_bug.cgi?id=860158
2014-01-31 18:16:36 +01:00
Kay Sievers b11d8d1993 rules: drivers - do not reset RUN list 2014-01-03 01:32:03 +01:00
David Herrmann e9718c12a4 rules: simply 60-drm.rules
We don't need any GOTO, if we merge all matches into a single line.
2013-11-03 16:17:14 +01:00
David Herrmann 0a8da8305a rules: load path_id on DRM devices
The path_id-builtin provides useful unique aliases for DRM devices. If we
want to configure DRM render-nodes for compositors, we want to avoid
storing the whole sys-path in configuration files. Hence, allow users to
store the short PATH_ID instead.

Load path_id-builtin unconditionally on DRM devices now to always provide
this alias.
2013-11-03 13:12:13 +01:00
Tom Gundersen 3e137a1b9a udev: link-config - let udevd set the ifname 2013-10-30 15:36:04 +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 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 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
Kay Sievers d1f0e886e1 rules: remove pointless MODE= settings
Changing the default MODE= for the group accessi, but not specifying
a GROUP= does not provide anything.

It disables the default logic that the mode switches to 0660 as soon
as a GROUP= is specifed, which make custom rules uneccesarily complicated.

https://bugs.freedesktop.org/show_bug.cgi?id=70665
2013-10-21 03:49:03 +02:00
Lennart Poettering e0d856dd48 rules: don't limit some of the rules to the "add" action
Devices should show up in systemd regardless whether the user invoked
"udevadm trigger" or not. Before this change some devices might have
suddenly disappeared due issuing that command.
2013-10-16 06:14:59 +02:00
Lennart Poettering da99906847 rules: expose loop block devices to systemd
Since the kernel no longer exposes a large number of "dead" loop devices
it is OK to expose them now in systemd, so let's do that. This has the
benefit that mount dependencies on loop devices start to work.
2013-10-16 06:14:59 +02:00
Lennart Poettering be3f52f4ed backlight: include ID_PATH in file names for backlight settings
Much like for rfkill devices we should provide some stability regarding
enumeration order, hence include the stable bits of the device path in
the file name we store settings under.
2013-10-14 19:02:44 +02:00
Lennart Poettering f6f738db72 rfkill: use ID_PATH as identifier for rfkill state files
Let's include the stable device path for the rfkill devices in the name
of the file we store the rfkill state in, so that we have some stability
regarding enumeration order.
2013-10-14 19:02:44 +02:00
Lennart Poettering 3990f24765 rfkill: add new rfkill tool to save/restore rfkill state across reboots
This works analogous to the existing backlight and random seed services
2013-10-14 04:31:49 +02:00
Lennart Poettering 0f4ba83c39 backlight: always prefer "firmware"/"platform" backlights over "raw" backlights if we have both for the same device 2013-10-14 02:22:35 +02:00
Bastien Nocera 1a0464230c Add support for saving/restoring keyboard backlights
Piggy-backing on the display backlight code, this saves and restores
keyboard backlights on supported devices.

The detection code matches that of UPower:
http://cgit.freedesktop.org/upower/tree/src/up-kbd-backlight.c#n173

https://bugs.freedesktop.org/show_bug.cgi?id=70367

[tomegun: also work for devices named "{smc,samsung,asus}::kbd_backlight"]
2013-10-11 12:52:36 +02:00
Lennart Poettering 875c6e1b48 backlight: instead of syspath use sysname for identifying backlight devices
This makes the description string of the backlight service a bit nicer.
2013-08-14 02:55:57 +02:00
Lennart Poettering 3731acf1ac backlight: add minimal tool to save/restore screen brightness across reboots
As many laptops don't save/restore screen brightness across reboots,
let's do this in systemd with a minimal tool, that restores the
brightness as early as possible, and saves it as late as possible. This
will cover consoles and graphical logins, but graphical desktops should
do their own per-user stuff probably.

This only touches firmware brightness controls for now.
2013-08-14 01:57:02 +02:00