Commit graph

84 commits

Author SHA1 Message Date
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
Harald Hoyer 58a6e9039a 80-net-name-slot.rules: only rename network interfaces on ACTION=="add"
Otherwise systemd-udevd will rename on "change" and "move" events,
resulting in weird renames in combination with biosdevname

systemd-udevd[355]: renamed network interface eth0 to em1
systemd-udevd[355]: renamed network interface eth1 to p3p2
systemd-udevd[357]: renamed network interface eth0 to p3p1
systemd-udevd[429]: renamed network interface p3p2 to ens3f1
systemd-udevd[428]: renamed network interface p3p1 to ens3f0
systemd-udevd[426]: renamed network interface em1 to enp63s0

or

systemd-udevd[356]: renamed network interface eth0 to em1
systemd-udevd[356]: renamed network interface eth0 to p3p1
systemd-udevd[420]: renamed network interface p3p1 to ens3f0
systemd-udevd[418]: renamed network interface em1 to enp63s0
systemd-udevd[421]: renamed network interface eth1 to p3p1
2013-08-01 12:32:23 +02:00
Kay Sievers 44affdc5fd rules: net, tty description - ask hwdb explicitly for pci data 2013-07-21 16:33:27 +02:00
Kay Sievers bf7f800f2b rules: drivers - always call kmod, even when a driver is bound to the device
On Sat, Jul 20, 2013 at 12:56 PM, Rafael J. Wysocki <rjw@sisk.pl> wrote:
> After a recent change present in 3.11-rc1 there is a driver, called processor,
> that can be bound to the CPU devices whose sysfs directories are located under
> /sys/devices/system/cpu/.  A side effect of this is that, after the driver has
> been bound to those devices, the kernel adds DRIVER=processor to ENV for CPU
> uevents and they don't match the default rule for autoloading modules matching
> MODALIAS:
>
> DRIVER!="?*", ENV{MODALIAS}=="?*", IMPORT{builtin}="kmod load $env{MODALIAS}"
>
> any more.  However, there are some modules whose module aliases match specific
> CPU features through the modalias string and those modules should be loaded
> automatically if a compatible CPU is present.  Yet, with the processor driver
> bound to the CPU devices the above rule is not sufficient for that, so we need
> a new default udev rule allowing those modules to be autoloaded even if the
> CPU devices have drivers.
2013-07-20 14:31:53 +02:00
Kay Sievers 884c86812c rules: keyboard - use builtin command 2013-07-18 14:41:11 +02:00
Kay Sievers 9d7d42bc40 udev: add builtin 'keyboard' to manage key mappings 2013-07-10 22:52:55 +02:00
Ross Lagerwall c647f10918 rules: only run systemd-sysctl when a network device is added
Otherwise, when a network device is renamed, systemd-sysctl is run twice
with the same network device name: once for ACTION="add" and once for
ACTION="move".
2013-06-17 21:17:59 +02:00
Kay Sievers 67fb4482ac always unconditionally create /dev/rtc and use it internally
Partially revert 2b3c81b02f, which
tried to avoid inconsistent rules about when and how to create the
/dev/rtc symlink.

Instead of conditionally or not creating the /dev/rtc link at all,
now always create it with additional and more reliable udev rules.

First try to find the "system rtc" with the hctosys flag, if this
is not found, fall back to create the link for /dev/rtc0.

Our code now never actively searches for the "system rtc" it can
always use /dev/rtc.
2013-04-26 01:11:52 +02:00
Kay Sievers 2b3c81b02f do not create /dev/rtc symlink, let systemd search for it if needed
The export of the RTCs hctosys flag is uneccesary, the kernel takes care
of the persistemt clock management itself, without any need for:
  CONFIG_RTC_HCTOSYS=y
  CONFIG_RTC_HCTOSYS_DEVICE="rtc0"

"Chaotic hardware platforms" without native kernel persistent clock
support will find the proper RTC with the logic rtc_open() without
the need for a custom symlink.
2013-04-24 19:20:51 +02:00
Tollef Fog Heen 6af274272a Drop trailing whitespace 2013-03-22 22:51:52 +01:00