Commit Graph

45 Commits

Author SHA1 Message Date
Boian Bonev
247724da45
Merge suitable rules changes from systemd
Merge up to commit 5674b74c4f99e433fd8e7242e9f16f6ddfece94c

- change @bindir@ to {{ROOTBINDIR}} in templates (better future tracking)
- keep rules/50-udev-default.rules as plain instead of template
- add
  60-autosuspend.rules
  60-fido-id.rules
  70-camera.rules
  70-memory.rules
  81-net-dhcp.rules
2022-05-26 19:31:43 +03:00
Ethan Sommer
79f7650b59 switch make usage to be POSIX compatible
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2020-04-22 18:04:20 -04:00
Marius Bakke
941d20bce3
rules/64-btrfs.rules: Expand @bindir@ to the absolute directory name.
This fixes #182 by ensuring @bindir@ is fully expanded at installation
time.  See "Installation Directory Variables" in the GNU Autoconf
manual, in particular the note about AC_CONFIG_FILES.

Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2020-04-10 09:26:02 -04:00
Anthony G. Basile
96c5552c52 rules/64-btrfs.rules: substitue @bindir@
See https://bugs.gentoo.org/666892

Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2018-09-23 21:03:33 -04:00
Anthony G. Basile
9727d157d0 rules/Makefile.am: install 60-input-id.rules and 70-joystick.rules
Commit bb070c1 forgot to include the installation of 60-input-id.rules
and 70-joystick.rules via the Makefile.  Without this, commits dba4728
and 5df0137 leave the system without any useable input devices.
2018-02-18 04:13:42 -05:00
Ioan-Adrian Ratiu
2edc3cf879 configure.ac: add option to disable mtd_probe
FTL is not necessarily present on all kernels so it's useful to
have an option to disable this.

Signed-off-by: Ioan-Adrian Ratiu <adrian.ratiu@ni.com>
2016-12-21 16:30:44 +02:00
Bastien Nocera
c61e6c912b udev: Add rules for accelerometer orientation quirks
This commit adds a rules file to extract the properties from hwdb
to set on i2c IIO devices. This is used to set the ACCEL_MOUNT_MATRIX
property on IIO devices, to be consumed by iio-sensor-proxy or
equivalent daemon.

The hwdb file contains documentation on how to write quirks. Note
however that mount information is usually exported in:
- the device-tree for ARM devices
- the ACPI DSDT for Intel-compatible devices
but currently not extracted by the kernel.

Also note that some devices have the framebuffer rotation that changes
between the bootloader and the main system, which might mean that the
accelerometer is then wrongly oriented. This is a missing feature in the
i915 kernel driver: https://bugs.freedesktop.org/show_bug.cgi?id=94894
which needs to be fixed, and won't require quirks.

Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2016-12-11 10:55:12 -05:00
Anthony G. Basile
b226ddfc1b rules: update
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2016-11-23 20:00:48 -05:00
Ian Stakenvicius
305f0eef4d Forward-ported network rule-generator code from eudev-1.10 2015-09-25 12:38:07 -04:00
Bastien Nocera
e172381913 It's moved to the iio-sensor-proxy D-Bus service.
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2015-07-20 07:45:23 -04:00
Peter Hutterer
a5cb5f0b4c 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 001a247324b44c0e0b8fdba41a6fc66e7465b8b6.

Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2015-07-20 07:28:05 -04:00
Kay Sievers
b5ac92fb85 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

Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2015-07-20 07:20:01 -04:00
Anthony G. Basile
2eba1b8055 80-net-name-slot.rules: restored for issue #117.
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2015-06-02 10:10:45 -04:00
Anthony G. Basile
c5bf58cafc 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.

Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2015-04-12 13:09:45 -04:00
Anthony G. Basile
73c6fdf901 rules: remove unsed net rules
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2015-03-18 17:05:36 -04:00
Kay Sievers
b45bb6733b rules: merge tty and serial rules file
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2015-03-18 15:55:48 -04:00
Kay Sievers
51ed849fb0 rules: merge udev-late.rules files
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2015-03-18 15:44:36 -04:00
Kay Sievers
586a3da832 rules: move block device rules to its own rules file
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2015-03-18 15:13:47 -04:00
Anthony G. Basile
298f6c8128 src/udev/udev-builtin.c: remove legacy optional keymap
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2015-02-11 18:40:16 -05:00
Anthony G. Basile
79bf63bcff src/udev/udev-builtin-kmod.c: remove the modprobe alt to kmod code 2015-02-11 18:06:47 -05:00
Anthony G. Basile
691df3c5c3 rule_generator: remove legacy code 2015-02-11 15:44:15 -05:00
Peter Hutterer
b51ba787a3 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.

Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2015-02-08 08:21:43 -05:00
Peter Hutterer
3481b5b976 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/)

Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2014-11-28 08:12:30 -05:00
Kay Sievers
3b71759460 udev: remove userspace firmware loading support
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2014-09-13 08:27:22 -04:00
Anthony G. Basile
28b8a50320 rules: retain, but do not install 80-net-setup-link.rules
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2014-03-02 09:42:54 -05:00
Anthony G. Basile
c51c39f7a9 Enable some missed udev rules
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2014-02-28 17:14:31 -05:00
Ian Stakenvicius
e2f82dc60f fix build system error introduced in c8cbcb8899
Signed-off-by: Ian Stakenvicius <axs@gentoo.org>
2013-08-01 16:20:30 -04:00
Ian Stakenvicius
c8cbcb8899 provide alternative 80-drivers.rules for --disable-kmod
Signed-off-by: Ian Stakenvicius <axs@gentoo.org>
2013-08-01 15:57:04 -04:00
Ian Stakenvicius
35876baf30 Switch from external keymaps to internal (hwdb) keymaps
This commit imports the new internal keyboard handling from upstream.
This is a combination of many upstream commits, including those
that added code, removed old code, and updated the hwdb.
Some commits (hwdb ones specifically) were unrelated but brought
in anyways to keep the whole hwdb consistent.  Each upstream
commit included is as follows:

9d7d42bc406a2ac04639674281ce3ff6beeda790 - internal keymap support
0c959b39175b126fdb70ae00de37ca6d9c8ca3a1 - hwdb: keyboard -- add file
e8193554925a22b63bef0e77b8397b56d63a91ff - hwdb: keyboard -- update comments
c79d894d590fc9df4861738555cc43c477e33376 - hwdb: import data
aedc2eddd16e48d468e6ad0aea2caf00c7d37365 - hwdb: keyboard update
97a9313cafccf772ce03f5ebd36fe4d9d8412583 - hwdb: drop non-existant Samsung 900XC3 from keymap
ddc77f62244bb41d5c8261517e2e1ff1b763fc94 - switch from udev keymaps to hwdb
0c3815773331b263713f4f7b9d80bc1ca159338e - also remove keymaps-force-release directory
1b6bce89b3383904d0dab619dd38bff673f7286e - keymap: re-add Logitech USB corded/cordless models
bf89b99c5a39115112c2eda4c2103e2db54988d2 - 60-keyboard.hwdb: Fix syntax error
ce39bb6909578017aa10031638e724e038f0b859 - hwdb: data update, upstream
884c86812c51479496edd50b278383d7bb67baf0 - rules: keyboard - use builtin command

All code from each of the above commits is attributed to the original
authors.

There were some adjustments made in order to support the code differences
between upstream and eudev, which was done by myself.

Also of note is that the code can still be disabled via the --disable-keymaps
configure option, which was removed from upstream.

Signed-off-by: Ian Stakenvicius <axs@gentoo.org>
2013-07-24 16:27:01 -04:00
Ian Stakenvicius
3909dfd26c create /etc/udev/rules.d target on install
Signed-off-by: Ian Stakenvicius <axs@gentoo.org>
2013-07-03 14:14:29 -04:00
Anthony G. Basile
ab0a37ddcf rules/Makefile.am: conditionally install 80-net-name-slot.rules
We do not want to install 80-net-name-slot.rules if we
--enable-rule-generator.  In fact doing so will switch to
the predictable network interface names.

Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2013-04-09 12:22:42 -04:00
Anthony G. Basile
215c4a0faa rules/40-mem-null.rules: coalesce with rules/50-udev-default.rules
There is no reason to keep this rule separate and it works fine
when incuded in 50-udev-default.rules.

Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2013-04-07 22:52:39 -04:00
Ian Stakenvicius
9e98de5d50 Remove 75-persistent-net-generator.rules reintroduced in commit ef0ac643
75-persistent-net-generator.rules is in the rule_generator subdir, do
not try and install from here.

Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2013-04-04 10:28:34 -04:00
Anthony G. Basile
18cafe9973 Correct permissions on /dev/null and friends for 2.6.32
This sets the permissions on null, zero, full, random and urandom
to 666 which is needed for older kernels.  This is part of Gentoo's
40-gentoo.rules which can now be dropped from Gentoo's ebuild.

X-gentoo-Bug: 457868
X-gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=457868
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
Signed-off-by: Ian Stakenvicius <axs@gentoo.org>
2013-04-02 15:02:35 -04:00
Tom Gundersen
f3ea87f611 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.

Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
Signed-off-by: Ian Stakenvicius <axs@gentoo.org>
2013-04-02 13:54:36 -04:00
Anthony G. Basile
ef0ac643c8 rules: updates from upstream
Authors include:

	Tollef Fog Heen
	Kay Sievers
	Tom Gundersen
	Tony Camuso
	Lennart Poettering
	Martin Pitt
	Harald Hoyer
	Michal Schmidt
	Matthew Garrett

See http://cgit.freedesktop.org/systemd/systemd/log/rules

Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
Signed-off-by: Ian Stakenvicius <axs@gentoo.org>
2013-04-02 13:54:21 -04:00
Ian Stakenvicius
a9ef3ca764 Make blkid optional
Embedded systems may not want to include util-linux when they do
not intend to use blkid functionality

Modified from original author's commit to not install
60-persistent-storage.rules if blkid is disabled

systemd commit f553b3b1074151200187df916427a1468186435e
Original author: Anders Olofsson <Anders.Olofsson@axis.com>

Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2013-01-28 17:42:47 -05:00
Ian Stakenvicius
e34b05dc4c Port new net_id capabilities from systemd-udev-197
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2013-01-28 17:42:47 -05:00
Anthony G. Basile
73e31d7ae7 Fix paths: test/udev-test.pl now works under sudo make distcheck
We move the test-udev.c and test-libudev.c from src/test to test.
This corrects the a problem with hard coded relative paths finding
the test/test/sys directory created by test/udev-test.pl.

This commit draws heavily from nvinson patch in

 https://github.com/gentoo/eudev/pull/20

Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2012-11-24 23:47:06 -05:00
Anthony G. Basile
e5cc2b881f Consolidate configuration of all installation paths into configure.ac
The configuration of the installation paths for various components
was scattered between the main configure.ac file and the various
Makefile.am's.  These components are: udev config file, hwdb, keymaps
and force-release keymaps and the rules.  This commit consolidates
them all into one point in configure.ac and anticipates the inclusion
of new AM_CPPFLAGS of the form -DHWDB_BIN=@udevhwdbdir@ as upstream
has done, so it is easier to address issues like:

  https://github.com/gentoo/eudev/issues/17

Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2012-11-23 13:48:49 -05:00
Richard Yao
3bb4e05ce4 Permit users to disable module loading support
Inspired by e30431623a7d871da123cc37055ac49abf2c20ea from systemd.

Signed-off-by: Richard Yao <ryao@gentoo.org>
2012-11-23 01:55:28 -05:00
Ian Stakenvicius
76e47c384f Make udevlibexecdir be substituted out of configure and assigned ${rootlibdir}/udev instead of ${root}/lib/udev 2012-11-22 09:45:09 -05:00
Ian Stakenvicius
d9d70c20a5 Fixed a syntax error 2012-11-21 15:55:58 -05:00
Anthony G. Basile
eb203b01c9 Final step of revamping the build system
The structure of the source tree is basically correct and this is
about as far as we can go without hacking at the C code.
2012-11-15 21:47:20 -05:00
Anthony G. Basile
c47f33a498 Second step of revamping the build system
The original Makefile.am was drawn to the top level.  This commit
breaks it out into the various directories with SUBDIRS connecting
them.  This makes each directory easier to maintain.
2012-11-15 20:18:22 -05:00