Commit graph

48108 commits

Author SHA1 Message Date
Lennart Poettering 5abede3247 seccomp: move brk+mmap+mmap2 into @default syscall filter set
These three syscalls are internally used by libc's memory allocation
logic, i.e. ultimately back malloc(). Allocating a bit of memory is so
basic, it should just be in the default set.

This fixes a couple of issues with asan/msan and the seccomp tests: when
asan/msan is used some additional, large memory allocations take place
in the background, and unless mmap/mmap2/brk are allowlisted these will
fail, aborting the test prematurely.
2020-11-19 16:44:50 +01:00
Zbigniew Jędrzejewski-Szmek bca0618705
Merge pull request #17667 from fbuihuu/fix-module-loading-from-udev-rule
Fix module loading from udev rule
2020-11-19 16:35:32 +01:00
Lennart Poettering bb4cbb25d4 man: suffix settings name with = and enclose in <varname> 2020-11-19 16:16:17 +01:00
Franck Bui 42cc2855ba units: wait until some fs modules are entirely loaded before mounting their corresponding filesystem
udev requests to start the fs mount units when their respective module is
loaded. For that it monitors uevents of type "ADD" for the relevant fs modules.

However the uevent is sent by the kernel too early, ie before the init() of the
module is called hence before directories in /sys/fs/ are created.

This patch workarounds adds "Requires/After=modprobe@<fs-module>.service" to
the mount unit, which means that modprobe(8) will be called once the fs module
is announced to be loaded. This sounds pointless, but given that modprobe only
returns after the initialization of the module is complete, it should
workaround the issue.

As a side effect, the module will be automatically loaded if the mount unit is
started manually.

Fixes #17586.
2020-11-19 11:50:52 +01:00
Franck Bui b3e32582f6 Revert "units: skip modprobe@.service if the unit appears to be already loaded"
This reverts commit 9cbf1e58f9.

The presence of /sys/module/%I directory can't be used to assert that the load
of a given module is complete and therefore the call to modprobe(8) can be
skipped. Indeed this directory is created before the init() function of the
module is called.

Users of modprobe@.service needs to be sure that once this service returns the
module is fully operational.
2020-11-19 09:49:42 +01:00
Hans de Goede 86de5e4239 hwdb: Add accel orientation quirk for Acer Aspire Switch 10 SW3-016 2-in-1
Add a quirk to fix the accelerometer orientation on the
Acer Aspire Switch 10 SW3-016 2-in-1.
2020-11-18 21:23:35 +01:00
Hans de Goede 565849429d hwdb: Add accel orientation quirk for Voyo Winpad A15 tablet
Add a quirk to fix the accelerometer orientation on the
Voyo Winpad A15 tablet.
2020-11-18 21:23:35 +01:00
Hans de Goede 169cd66baa hwdb: Add accel orientation quirk for Lenovo ThinkPad Yoga 11e 4th gen
Add a quirk to fix the accelerometer orientation on the Lenovo
ThinkPad Yoga 11e 4th gen 360 degree hinges 2-in-1.
2020-11-18 21:23:35 +01:00
Hans de Goede 21b58655f3 hwdb: Fix accel orientation quirk Z-axis for Lenovo ThinkPad Yoga 11e 3th gen
The Lenovo ThinkPad Yoga 11e 360 degree hinges style 2-in-1s use 2
accelerometers, 1 in the display and 1 in the base.

Kernel work is under way to also export the second accelerometer in
the base as an iio-device; and userspace work is underway to use
both accelerometers on 360 degree hinges style 2-in-1s (with 2 accels)
to figure out the angle between the 2 halves.

So far most orientation-matrix quirks have not cared much about the
Z-axis being correct, but in these 2 accelerometer setups getting
the Z-axis correct is important too.
2020-11-18 21:23:35 +01:00
Hans de Goede 276ede0740 hwdb: Add base accelerometer orientation quirk for base sensor of Medion Akoya E* series
The KIOX010A and KIOX02A ACPI hw-ids (HIDs) are used in 360 degree hinges
style 2-in-1s which have 2 accelerometers, 1 in the display (as usual) and
a second accelerometer in the base.

So far 60-sensor.hwdb has only defined a mount-matrix for the
sensor with the KIOX010A HID, which is the sensor in the display
half of the device. The reason for this is that sofar userspace has
only cared actually used the sensor in the display (for automatic
display rotation. Work is underway to make userspace use both sensors:
https://gitlab.freedesktop.org/hadess/iio-sensor-proxy/-/issues/216

Recently an entry was added for the Medion Akoya's E2221T base-sensor,
but that was added to mark it with ACCEL_LOCATION=base and the entry
simply used the identity-matrix for ACCEL_MOUNT_MATRIX since nothing
is using the mount-matrix info for the second accelerometer.
I believe that this entry was added because on some devices the second
accelerometer gets enumerated first and then iio-sensor-proxy will
wrongly use the second sensor for display-rotation, unless it is marked
with ACCEL_LOCATION=base.

Instead of adding info for the second accelerometer on a per device
basis use the same generic dmi matches as used for the first (KIOX010A)
sensor, replacing the special case added for the E2221T and also
update the ACCEL_MOUNT_MATRIX with the actual mount-matrix for the
KIOX020A sensor in the base of these devices.

This was tested on a Medion Akoya E2228T.
2020-11-18 21:23:34 +01:00
Hans de Goede b24e437ab0 hwdb: Document how to properly set the mount-matrix for the base-accelerometer in 360 degree hinges style 2-in-1s with 2 accelerometers
Document how the mount-matrix for the base-accelerometer must be set on
360 degree hinges style 2-in-1s with 2 sensors (one in the display and
1 in the base).

Note the choice to define the lid being fully closed as an angle of
0 degrees is based on the ACPI tables of devices with a BOSC0200
ACPI device-node describing both sensors. In this case the ACPI
tables contain mount-matrix info (and the kernel will soon support
reading this and exporting it to userspace) and the mount-matrices
defined in these ACPI tables are such that the angle of the G-force
vector measured by the sensors is identical for both sensors when
the laptop's lid is fully closed.

This also feels more natural then defining the laptop being fully
open (180 degrees open) as the home / 0 degree angle position.
2020-11-18 21:20:21 +01:00
Yu Watanabe f56a9cbf9c khash: fix structured initializer
Fixes #17646.
2020-11-18 11:15:05 +01:00
igo95862 0e577869f3 man: Fix sd_bus_message_append_array_space function signature 2020-11-18 18:26:14 +09:00
Zbigniew Jędrzejewski-Szmek e0300086ba
Merge pull request #17651 from yuwata/the-the
tree-wide: fix "the the" and "that that"
2020-11-18 09:32:09 +01:00
Vito Caputo e3500e9d21 JOURNAL_FILE_FORMAT: fixup typos and punctuation
No significant changes
2020-11-18 09:29:58 +01:00
Yu Watanabe 273d76f4f8 tree-wide: update "that that" 2020-11-18 17:23:00 +09:00
Yu Watanabe 10f3484950 man,NEWS: fix "the the" 2020-11-18 16:27:14 +09:00
Yu Watanabe b9cbb08e0a sd-device: drop unwanted newline in netlink message 2020-11-18 05:32:44 +09:00
Zbigniew Jędrzejewski-Szmek d407638382 test/udev-test: gracefully exit when imports fail
In Fedora rawhide various perl modules are now available as separate
packages that are not pulled in by dependencies. If we don't have some
package, skip the tests.

This ugly code is apparently the way to do conditional imports:
https://www.cs.ait.ac.th/~on/O/oreilly/perl/cookbook/ch12_03.htm.
2020-11-18 03:50:17 +09:00
Yu Watanabe dd2e9e1d0e resolve: ignore invalid service template name
Let's fiest test the template name, and then assign it.
2020-11-18 03:32:40 +09:00
Yu Watanabe 0c949643b8 resolve: make config_parse_dnssd_service_name() accepts an empty string 2020-11-18 03:23:32 +09:00
Yu Watanabe a37eb63ffa resolve: add a short comment about difference between dnssd_render_instance_name() and config_parse_dnssd_service_name() 2020-11-18 03:22:56 +09:00
Yu Watanabe d63542bc02 resolve: wrap long line 2020-11-18 03:20:30 +09:00
Roman Beranek 07e4a8dc23 Revert "resolve: check DNSSD service name template before assigning it"
This reverts commit 34136e1503.

Having the "%H" host name specifier in a DNSSD service name template
triggers a failed assertion during name template instantiation as
specifier_dnssd_host_name expects DnssdService in its userdata
pointer but finds NULL instead.
2020-11-18 03:16:57 +09:00
Zbigniew Jędrzejewski-Szmek 478f5aac07 hwdb/60-keyboard: untabify and move comments to the same column
Follow-up for b0a3a3ff5d.
2020-11-18 02:14:32 +09:00
Zbigniew Jędrzejewski-Szmek 1598b07da3
Merge pull request #17640 from keszybz/meson-test-c++20
Also test headers against c++20
2020-11-17 17:14:49 +01:00
Zbigniew Jędrzejewski-Szmek 485a9202ba
Merge pull request #17643 from keszybz/man-news-independent
NEWS and man page tweaks
2020-11-17 17:14:14 +01:00
Zbigniew Jędrzejewski-Szmek 905a03e71d NEWS,man: improve descriptions of Independent=
In NEWS, the new option was described twice, most likely because the first
description was tucked away in a paragraph about some other subject.

While at it, improve the descriptions in the man page to make it easier to grok
what that option really does.
2020-11-17 12:37:44 +01:00
Zbigniew Jędrzejewski-Szmek de70ff66dc man: drop misplaced phrase
I think it was added in 6c2b9c8da1 as c&p.
2020-11-17 11:46:50 +01:00
igo95862 e6ce785d61 man: Add a paragraph to sd_bus_call explaning callback message lifetime 2020-11-17 11:13:10 +01:00
Zbigniew Jędrzejewski-Szmek 8dc299a0da
Merge pull request #17584 from yuwata/news-networkd
NEWS: several entries for networkd
2020-11-17 10:59:20 +01:00
Zbigniew Jędrzejewski-Szmek dbc29e9175 network: use the common "cannot" form
Just for consistency.
2020-11-17 10:55:36 +01:00
Zbigniew Jędrzejewski-Szmek 7ad41997d1 man/systemd.netdev: remove bogus markup
There is no "Multicast" constant, and NULL doesn't make sense in the
context of addresses.
2020-11-17 10:55:12 +01:00
Zbigniew Jędrzejewski-Szmek e375ceb640 man/systemd.netdev: don't say "ranges" 2020-11-17 10:43:13 +01:00
Yu Watanabe 042b028ae9 NEWS: slightly fix explanation about oomd 2020-11-17 10:27:00 +01:00
Yu Watanabe 9f2c260ef9 man: DHCPv6PrefixDelegation= is disabled by dafault 2020-11-17 10:27:00 +01:00
Yu Watanabe 70a51d7e08 NEWS: add several entries for networkd 2020-11-17 10:27:00 +01:00
Zbigniew Jędrzejewski-Szmek ffe3533eb7
Merge pull request #17599 from yuwata/meson-fuzz-tests
meson: do not build fuzzers when -Dfuzz-tests=false
2020-11-17 10:16:47 +01:00
Anita Zhang 6ace20b971 test-oomd-util: remove memory_pressure == 0 checks
test_oomd_cgroup_context_acquire_and_insert reads the live cgroup data used
by the unit test. Under certain conditions, the memory pressure for the cgroup
can be non-zero (although most of the time it is 0 since these tests don't
generate much pressure).

Since these values are too dependent on the state of the system, remove the
checks. The type used is always >= 0 and test-psi-util already unit tests that
PSI values are parsed correctly from files so this test is redundant anyways.
2020-11-17 10:08:32 +01:00
Yu Watanabe cbdc906288 man: mention that FirewallMark= optionally takes firewall mask
Closes #17587.
2020-11-17 10:08:06 +01:00
Zbigniew Jędrzejewski-Szmek 40ebe49259
Merge pull request #17597 from yuwata/fix-typo
tree-wide: Fix typo
2020-11-17 10:06:58 +01:00
Zbigniew Jędrzejewski-Szmek 2e5811521d test: let's start getting ready for 2020
It'll be a wonderful year, I'm sure.
2020-11-17 10:03:15 +01:00
Zbigniew Jędrzejewski-Szmek e318c2a444 meson: use proper variable for libudev.h path 2020-11-17 10:01:05 +01:00
Yu Watanabe a614a6e2f8 meson: fix build tests for c++14 and c++17 2020-11-17 09:55:08 +01:00
Zbigniew Jędrzejewski-Szmek 88e574e7c1
Merge pull request #17603 from yuwata/systemctl-fix-underline
systemctl: always show underline even if unit has no job ID
2020-11-17 09:49:05 +01:00
Yu Watanabe 5b90b906c7 udev: use FOREACH_DEVICE_TAG() macro at one more place 2020-11-17 09:47:14 +01:00
Zbigniew Jędrzejewski-Szmek 91ed0c8e32
Merge pull request #17612 from yuwata/fix-man-pages
man: fix two issues
2020-11-17 09:45:50 +01:00
Zbigniew Jędrzejewski-Szmek 44c6c5df2b
Merge pull request #17614 from jwrdegoede/hwdb-logitech-kbd-fixes
hwdb Logitech keyboard fixes
2020-11-17 09:33:58 +01:00
igo95862 2e4238a6d1 man: Separated paragraph about making sd_bus object reply async 2020-11-17 09:05:18 +01:00
Lennart Poettering 7d7c75f149 update TODO 2020-11-16 21:08:38 +01:00