1
1
mirror of https://github.com/systemd/systemd-stable.git synced 2025-01-05 09:17:44 +03:00
Commit Graph

55420 Commits

Author SHA1 Message Date
Zbigniew Jędrzejewski-Szmek
c01543fdd5 meson: drop three more single-use convenience libraries
The way that the cryptsetup plugins were built was unnecessarilly complicated.
We would build three static libraries that would then be linked into dynamic
libraries. No need to do this.

While at it, let's use a convenience library to avoid compiling the shared code
more than once.

We want the output .so files to be located in the main build directory,
like with all consumable build artifacts, so we need to maintain the split
between src/cryptsetup/cryptsetup-token/meson.build and the main meson.build
file.

AFAICT, the build artifacts are the same: exported and undefined symbols are
identical. There is a tiny difference in size, but I think it might be caused
by a different build directory name.
2021-12-16 11:51:40 +01:00
Zbigniew Jędrzejewski-Szmek
3a4524116a meson: drop convenience library that was only used in one place
It doesn't make much sense to do this, the result is very similar to including
to objects directly in the output binary without going through an intermediate
target.

The linkage of test-libudev was rather strange too: udev_link_with is used to
allow udev to be linked to a static version of libshared, so that udev is not
linked to libshared.so. But here we were using both, defeating the purpose of
udev_link_with. I don't think it matters what the test is linked to, so let's
use the non-static linkage to save space.
2021-12-16 11:09:51 +01:00
Zbigniew Jędrzejewski-Szmek
03f7ddf0bf meson: stop building out convenience libraries by default
The meson default for static_library() are:
build_by_default=true, install=false. We never interact with the
static libraries, and we only care about them as a stepping-stone towards
the installable executables or libraries. Thus let's only build them if
they are a dependency of something else we are building.

While at it, let's drop install:false, since this appears to be the default.

This change would have fixed the issue with lib_import_common failing
to build too: we wouldn't attempt to build it.

In practice this changes very little, because we generally only declare static
libraries where there's something in the default target that will make use of
them. But it seems to be a better pattern to set build_by_default to false.
2021-12-16 11:01:08 +01:00
Zbigniew Jędrzejewski-Szmek
b93f018f57 meson: don't compile import sources four times
Use a 'convenience library' to do the compilation once and then link the
objects into all the files that need it. Those files are small, so this probably
doesn't matter too much for speed, but has the advantage that we don't get the
same error four times if something goes wrong.

The library is conditionalized in the same way importd itself, because we
cannot build it without the deps.
2021-12-16 10:54:46 +01:00
Zbigniew Jędrzejewski-Szmek
66aaca688f man: split out a paragraph and shorten the text about sd-network-generator
The ordering of the service wrt. to udevd is enforced by unit configuration,
so no need to tell the user about this. From users' POV, the only thing that
counts is that the unit is enabled and then the right thing happens.
2021-12-16 09:56:13 +01:00
Zbigniew Jędrzejewski-Szmek
e053f49272 units: enable systemd-network-generator by default
It is used by udevd and networkd. Since udevd is enabled statically, let's also
change the preset to "on". networkd is opt-in, so let's pull in the generator
when enabling networkd too.
2021-12-16 09:49:39 +01:00
Zbigniew Jędrzejewski-Szmek
67cb0d4725
Merge pull request #21766 from yuwata/network-generator-name-policy
network-generator: support setting NamePolicy=
2021-12-16 09:34:01 +01:00
Luca Boccassi
58f62d7079
Merge pull request #21784 from DaanDeMeyer/issue-21675
journal: Hole punching improvements
2021-12-15 22:38:00 +00:00
Zbigniew Jędrzejewski-Szmek
af3b864d76 Define FOREACH_DIRENT through FOREACH_DIRENT_ALL
As in the previous commit, 'de' is used as the iterator variable name.
2021-12-15 22:50:00 +01:00
Yu Watanabe
2b3a8e2830 network: route: update comment 2021-12-15 20:07:17 +00:00
Daan De Meyer
24040269ee journal: Stop reading in increments of block size during hole punching
Let's not try to be overly clever here. This code path is not overly
performance sensitive and we should avoid trying to outsmart the kernel
without proper benchmarking.
2021-12-15 18:24:29 +01:00
Daan De Meyer
d951ac5578 journal: Use 16kb buffer during hole punching
Let's use the same buffer size as used in as copy.h.
2021-12-15 18:22:17 +01:00
Daan De Meyer
cdbba44878 journal: Correctly advance offset when iterating hash table entries
pread() is not guaranteed to completely fill up the given buffer with
data which we assumed until now. Instead, only increment the offset by
the number of bytes that were actually read.
2021-12-15 18:21:19 +01:00
Daan De Meyer
a2799cc556 journal: Add a minimum hole size for hole punching
Let's not bother punching extremely small holes to avoid unnecessary
file fragmentation.
2021-12-15 18:17:22 +01:00
Yu Watanabe
bd47f33f16 NEWS: update networkd related entries 2021-12-16 02:12:03 +09:00
Yu Watanabe
79463de533 test: add testcases for net.ifname-policy= kernel command line argument 2021-12-16 01:55:37 +09:00
Yu Watanabe
a4c9bf2e51 network-generator: support to set NamePolicy= through kernel command line argument
Closes #16296.
2021-12-16 01:55:37 +09:00
Yu Watanabe
ff516b4341 udev: move NamePolicy to netif-naming-scheme.[ch] 2021-12-16 01:55:37 +09:00
Yu Watanabe
eb3e86ae2c network-generator: support MAC address longer or shorter than ETH_ALEN 2021-12-16 01:55:37 +09:00
Yu Watanabe
987dd89c77 meson: build network-generator unconditionally
The service also generates .link files for udevd.
2021-12-16 01:55:20 +09:00
Yu Watanabe
85e8650827 unit: run network-generator before starting udevd
Otherwise, .link files generated by the service may not be loaded by
udevd.
2021-12-16 01:44:17 +09:00
Zbigniew Jędrzejewski-Szmek
c7f0d9e5ac tree-wide: make FOREACH_DIRENT_ALL define the iterator variable
The variable is not useful outside of the loop (it'll always be null
after the loop is finished), so we can declare it inline in the loop.
This saves one variable declaration and reduces the chances that somebody
tries to use the variable outside of the loop.

For consistency, 'de' is used everywhere for the var name.
2021-12-15 16:19:13 +01:00
Daan De Meyer
447a822f8e kernel-install: Remove "Default" from list of suffixes checked
This was an undocumented change in behavior introduced by
9e82a74cb0. Previously, we only
checked for "Default" if we didn't find a machine ID. Let's make
sure we keep the previous behavior intact.
2021-12-15 14:00:31 +01:00
Zbigniew Jędrzejewski-Szmek
05c1b1c95e
Merge pull request #21763 from yuwata/udevadm-write-only-attributes
udevadm: also show write-only attributes
2021-12-15 13:22:45 +01:00
Zbigniew Jędrzejewski-Szmek
0ad4efb14b resolved: filter out our own stub resolvers when parsing servers
We get "upstream" dns server config from ~three places: /etc/resolv.conf,
config files, and runtime config via dbus. With this commit, we'll filter out
our own stub listeners if they are configured in either of the first two
sources. For /etc/resolv.conf this is done quitely, and for our own config
files, a LOG_INFO message is emitted, since this is a small inconsistency in
the config.

Setting loops like this over dbus is still allowed. The reason is that in the
past we didn't treat this as an error, and if we were to start responding with
an error, we could break a scenario that worked previously. E.g. NM sends us a
list of servers, and one happens to be the our own. We would just not use that
stub server before, but it'd still be shown in the dbus properties and such.
We would have to return error for the whole message, also rejecting the other
valid servers. I think it's easier to just keep that part unchanged.

Test case:
$ ls -l /etc/resolv.conf
-rw-r--r-- 1 root root 57 Dec 15 10:26 /etc/resolv.conf
$ cat /etc/resolv.conf
nameserver 192.168.150.1
options edns0 trust-ad
search .
$ cat /etc/systemd/resolved.conf.d/stub.conf
[Resolve]
DNSStubListenerExtra=192.168.150.1

$ resolvectl
...
Global
    resolv.conf mode: foreign
         DNS Servers: 192.168.150.1
Fallback DNS Servers: ...
(with the patch):
Global
    resolv.conf mode: foreign
Fallback DNS Servers: ...
2021-12-15 11:47:06 +01:00
Zbigniew Jędrzejewski-Szmek
9d84fdec28 resolved: return immediately if we already know what to return 2021-12-15 11:47:05 +01:00
Jayce Fayne
d4453d5ee8 hwdb: Add accel orientation quirk for the Chuwi Hi10 Go tablet 2021-12-14 23:29:31 +00:00
Yu Watanabe
18f0eaafd7 fstab-generator: do not remount /sys when running in a container
Closes #21744.
2021-12-15 06:30:42 +09:00
Zbigniew Jędrzejewski-Szmek
a2d7654f99
journactl: show info about journal range only at debug level (#21775)
The message that the "journal begins … ends …" has been always confusing to
users. (Before b91ae210e6 it was "logs begin … end …" which was arguably even
more confusing, but really the change in b91ae210e6 didn't substantially change
this.)

When the range shown is limited (by -e, -f, --since, or other options), it
doesn't really matter to the user what the oldest entries are, since they are
purposefully limiting the range. In fact, if we are showing the last few
entries with -e or -f, knowing that many months the oldest entries have is
completely useless.

And when such options are *not* used, the first entry generally corresponds to
the beginning of the range shown, and the last entry corresponds to the end of
that range. So again, it's not particularly useful, except when debugging
journalctl or such. Let's just treat it as a debug message.

Fixes #21491.
2021-12-15 06:30:15 +09:00
Zbigniew Jędrzejewski-Szmek
285a6908eb hostnamectl: add a chassis symbol in status output
The idea is to be able to distinguish whether we're in a VM/container or something
more substantial at a glance.
         Chassis: laptop 💻
         Chassis: tablet 具
         Chassis: vm 🖴
         Chassis: server 🖳
         Chassis: handset 🕻
         Chassis: watch 
         Chassis: desktop 🖥
         Chassis: container ☐
2021-12-14 16:49:26 +00:00
Luca Boccassi
020d41ce4f
Merge pull request #21769 from yuwata/home-fix-heap-use-after-free
home: fix heap-use-after-free
2021-12-14 15:54:00 +00:00
Yu Watanabe
3a90bef55a udevadm: also show write-only attributes 2021-12-14 21:50:02 +09:00
Yu Watanabe
ab218d0bdb sd-device: make FOREACH_DEVICE_SYSATTR() also list write-only attributes
Closes #10102.
2021-12-14 21:49:56 +09:00
Yu Watanabe
2ff457720b home: fix heap-use-after-free
`bus_home_emit_remove()` may be called from manager_free() -> home_free().
In that case, manager->bus is already unref()ed.

Fixes #21767.
2021-12-14 20:00:56 +09:00
Yu Watanabe
76fc157702 home: clear Manager::bus, ::event, ::homes_by_xxx and so on
`home_free()` may try to call some dbus or event related functions.
To prevent that, set those variables NULL.
2021-12-14 20:00:24 +09:00
Yu Watanabe
3c2f847227 polkit: make bus_verify_polkit_async_registry_free() return Hashmap* with NULL 2021-12-14 19:39:39 +09:00
Yu Watanabe
372e8592c6 wait-online: also use address state even when operational state is below degraded
Closes #21706.
2021-12-14 10:32:56 +01:00
Nishal Kulkarni
b4bb96f3f2 shell-completion: Add completion for systemd-analyze critical-chain
systemd-analyze critical-chain accepts an optional unit argument,
however currently there's no shell-completion for it
This change provides unit name completion for both bash and zsh.

Closes: #20927
2021-12-14 10:27:49 +01:00
acsfer
265f76be72 Fix loading of graphs 2021-12-14 15:27:25 +09:00
Robert Scheck
7964702007 boot, meson: allow statically linked build
Build option "link-boot-shared" to build a statically linked bootctl and
systemd-bless-boot by using

  -Dlink-boot-shared=false

on systems with full systemd stack except bootctl and systemd-bless-boot,
such as CentOS/RHEL 9.
2021-12-14 09:58:27 +09:00
Davide Cavalca
ba38a24de3 man: do not install sd-boot man pages when -Dgnu-efi=false is set 2021-12-14 00:08:55 +00:00
Sho Iizuka
17cfd6f96f man: how to unset CPUQuota=
This description will help users who are trying to reset the already configured
CPUQuota= by trying incorrect ways such as CPUQuota=0 or CPUQUota=infinity.
2021-12-13 19:43:56 +00:00
Luca Boccassi
720db03495
Merge pull request #21752 from keszybz/man-creds
Small improvements to systemd-creds output and man page
2021-12-13 19:43:37 +00:00
Tom Yan
af45251e4c resolved: filter stub listeners in manager_get_dns_server()
Commit 49ef064c8d attempts to handle
"stub loop" by switching to the next server *after the query has
been made*.

The approach may be good enough for link scopes. However, for the
manager / global scope, it is not. First of all, there are more than
one types (SYSTEM and FALLBACK) of servers it can use. Also, whether
those of type FALLBACK should be used depends.

Besides, dns_scope_good_domain() determines whether things should
be routed to a scope by checking whether the scope has a server.
The decision made would be incorrect if stubs were not filtered
beforehand.

Therefore, to avoid failing query unnecessarily, and to make sure
that extra stub listeners will not trigger unexpected and/or
inconsistent behavior, make manager_get_dns_server() do what it
should have done.
2021-12-13 23:08:40 +08:00
Zbigniew Jędrzejewski-Szmek
ecc5d0c008 man: make systemd-creds man page a bit easier to read 2021-12-13 15:01:44 +01:00
Zbigniew Jędrzejewski-Szmek
ff43ae228b shared/creds: print debugging information when something goes wrong 2021-12-13 15:01:44 +01:00
dependabot[bot]
fdae4504c7 build(deps): bump actions/upload-artifact from 2.2.4 to 2.3.0
Bumps [actions/upload-artifact](https://github.com/actions/upload-artifact) from 2.2.4 to 2.3.0.
- [Release notes](https://github.com/actions/upload-artifact/releases)
- [Commits](27121b0bdf...da838ae959)

---
updated-dependencies:
- dependency-name: actions/upload-artifact
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-12-13 14:45:19 +03:00
Luca Boccassi
a0630d46a5
Merge pull request #21749 from nabijaczleweli/bashpsko
Shebang bash via env
2021-12-13 11:11:39 +00:00
dependabot[bot]
1805759ea0 build(deps): bump github/codeql-action from 1.0.25 to 1.0.26
Bumps [github/codeql-action](https://github.com/github/codeql-action) from 1.0.25 to 1.0.26.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](546b30f35a...5f53256358)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-12-13 13:18:55 +03:00
Luca Boccassi
109a157cea test: bump timeout for TEST-50-DISSECT and TEST-67-INTEGRITY
TEST-67-INTEGRITY times out quite often, and when it passes
it does so a few seconds short of the timeout. It's a slow
qemu test, so bump the timeout.
TEST-50-DISSECT has been reported to fail in the same way
on Debian's infrastructure, again narrowly failing or passing
just short of the timeout.
2021-12-13 09:29:47 +01:00