summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--NEWS14
-rw-r--r--TODO2
-rw-r--r--docs/CGROUP_DELEGATION.md66
-rw-r--r--hwdb/60-sensor.hwdb4
-rw-r--r--man/journalctl.xml4
-rw-r--r--meson.build20
-rw-r--r--meson_options.txt3
-rw-r--r--po/it.po22
-rw-r--r--shell-completion/zsh/_coredumpctl6
-rw-r--r--src/analyze/analyze.c3
-rw-r--r--src/basic/build.h2
-rw-r--r--src/basic/cgroup-util.c12
-rw-r--r--src/basic/cgroup-util.h6
-rw-r--r--src/basic/meson.build5
-rw-r--r--src/basic/util.c2
-rw-r--r--src/basic/version.h.in1
-rw-r--r--src/boot/efi/boot.c8
-rw-r--r--src/boot/efi/meson.build4
-rw-r--r--src/boot/efi/stub.c4
-rw-r--r--src/cgtop/cgtop.c2
-rw-r--r--src/core/cgroup.c53
-rw-r--r--src/core/dbus-manager.c2
-rw-r--r--src/core/execute.c4
-rw-r--r--src/core/main.c4
-rw-r--r--src/core/meson.build21
-rw-r--r--src/core/systemd.pc.in4
-rw-r--r--src/core/unit.h4
-rw-r--r--src/import/curl-util.c3
-rw-r--r--src/journal-remote/journal-upload.c3
-rw-r--r--src/journal/journald-context.c2
-rw-r--r--src/libsystemd-network/sd-dhcp-client.c35
-rw-r--r--src/libsystemd/libsystemd.pc.in4
-rw-r--r--src/libsystemd/meson.build7
-rw-r--r--src/libsystemd/sd-device/device-private.c9
-rw-r--r--src/libsystemd/sd-device/sd-device.c3
-rw-r--r--src/libsystemd/sd-device/test-sd-device-monitor.c81
-rw-r--r--src/libsystemd/sd-hwdb/hwdb-util.c2
-rw-r--r--src/libudev/libudev-util.c13
-rw-r--r--src/libudev/libudev.pc.in2
-rw-r--r--src/libudev/meson.build7
-rw-r--r--src/network/networkd-dhcp4.c2
-rw-r--r--src/network/networkd-link.c27
-rw-r--r--src/sleep/sleep.conf25
-rw-r--r--src/test/test-json.c16
-rw-r--r--src/test/test-libudev.c30
-rw-r--r--src/test/test-path-util.c2
-rw-r--r--src/test/test-udev.c3
-rw-r--r--src/udev/meson.build7
-rw-r--r--src/udev/scsi_id/scsi_id.c3
-rw-r--r--src/udev/udev-ctrl.c50
-rw-r--r--src/udev/udev.pc.in2
-rw-r--r--src/udev/udevadm.h6
-rw-r--r--src/udev/udevd.c7
-rwxr-xr-xtest/TEST-19-DELEGATE/testsuite.sh2
-rwxr-xr-xtest/test-network/systemd-networkd-tests.py5
-rwxr-xr-xtools/meson-vcs-tag.sh18
56 files changed, 384 insertions, 274 deletions
diff --git a/NEWS b/NEWS
index c67b5b068a..e04a797c28 100644
--- a/NEWS
+++ b/NEWS
@@ -133,13 +133,13 @@ CHANGES WITH 240:
* The new "MemoryMin=" unit file property may now be used to set the
memory usage protection limit of processes invoked by the unit. This
- controls the cgroupsv2 memory.min attribute. Similarly, the new
+ controls the cgroup v2 memory.min attribute. Similarly, the new
"IODeviceLatencyTargetSec=" property has been added, wrapping the new
- cgroupsv2 io.latency cgroup property for configuring per-service I/O
+ cgroup v2 io.latency cgroup property for configuring per-service I/O
latency.
- * systemd now supports the cgroupsv2 devices BPF logic, as counterpart
- to the cgroupsv1 "devices" cgroup controller.
+ * systemd now supports the cgroup v2 devices BPF logic, as counterpart
+ to the cgroup v1 "devices" cgroup controller.
* systemd-escape now is able to combine --unescape with --template. It
also learnt a new option --instance for extracting and unescaping the
@@ -355,7 +355,7 @@ CHANGES WITH 240:
* The JoinControllers= option in system.conf is no longer supported, as
it didn't work correctly, is hard to support properly, is legacy (as
- the concept only exists on cgroupsv1) and apparently wasn't used.
+ the concept only exists on cgroup v1) and apparently wasn't used.
* Journal messages that are generated whenever a unit enters the failed
state are now tagged with a unique MESSAGE_ID. Similarly, messages
@@ -992,7 +992,7 @@ CHANGES WITH 238:
instance to migrate processes if it itself gets the request to
migrate processes and the kernel refuses this due to access
restrictions. Thanks to this "systemd-run --scope --user …" works
- again in pure cgroups v2 environments when invoked from the user
+ again in pure cgroup v2 environments when invoked from the user
session scope.
* A new TemporaryFileSystem= setting can be used to mask out part of
@@ -2708,7 +2708,7 @@ CHANGES WITH 231:
desired options.
* systemd now supports the "memory" cgroup controller also on
- cgroupsv2.
+ cgroup v2.
* The systemd-cgtop tool now optionally takes a control group path as
command line argument. If specified, the control group list shown is
diff --git a/TODO b/TODO
index 24ec98416a..77a8447233 100644
--- a/TODO
+++ b/TODO
@@ -58,7 +58,7 @@ Features:
* when a socket unit is spawned with an AF_UNIX path in /var/run, complain and
patch it to use /run instead
-* set memory.oom.group in cgroupsv2 for all leaf cgroups (kernel v4.19+)
+* set memory.oom.group in cgroup v2 for all leaf cgroups (kernel v4.19+)
* add a new syscall group "@esoteric" for more esoteric stuff such as bpf() and
usefaultd() and make systemd-analyze check for it.
diff --git a/docs/CGROUP_DELEGATION.md b/docs/CGROUP_DELEGATION.md
index 7cd27a44b2..8bf1b698fc 100644
--- a/docs/CGROUP_DELEGATION.md
+++ b/docs/CGROUP_DELEGATION.md
@@ -21,7 +21,7 @@ container managers.
Before you read on, please make sure you read the low-level [kernel
documentation about
-cgroupsv2](https://www.kernel.org/doc/Documentation/cgroup-v2.txt). This
+cgroup v2](https://www.kernel.org/doc/Documentation/cgroup-v2.txt). This
documentation then adds in the higher-level view from systemd.
This document augments the existing documentation we already have:
@@ -38,8 +38,8 @@ wiki documentation into this very document, too.)
## Two Key Design Rules
Much of the philosophy behind these concepts is based on a couple of basic
-design ideas of cgroupsv2 (which we however try to adapt as far as we can to
-cgroupsv1 too). Specifically two cgroupsv2 rules are the most relevant:
+design ideas of cgroup v2 (which we however try to adapt as far as we can to
+cgroup v1 too). Specifically two cgroup v2 rules are the most relevant:
1. The **no-processes-in-inner-nodes** rule: this means that it's not permitted
to have processes directly attached to a cgroup that also has child cgroups and
@@ -62,45 +62,45 @@ your container manager creates and manages cgroups in the system's root cgroup
you violate rule #2, as the root cgroup is managed by systemd and hence off
limits to everybody else.
-Note that rule #1 is generally enforced by the kernel if cgroupsv2 is used: as
+Note that rule #1 is generally enforced by the kernel if cgroup v2 is used: as
soon as you add a process to a cgroup it is ensured the rule is not
-violated. On cgroupsv1 this rule didn't exist, and hence isn't enforced, even
+violated. On cgroup v1 this rule didn't exist, and hence isn't enforced, even
though it's a good thing to follow it then too. Rule #2 is not enforced on
-either cgroupsv1 nor cgroupsv2 (this is UNIX after all, in the general case
+either cgroup v1 nor cgroup v2 (this is UNIX after all, in the general case
root can do anything, modulo SELinux and friends), but if you ignore it you'll
be in constant pain as various pieces of software will fight over cgroup
ownership.
-Note that cgroupsv1 is currently the most deployed implementation, even though
+Note that cgroup v1 is currently the most deployed implementation, even though
it's semantically broken in many ways, and in many cases doesn't actually do
-what people think it does. cgroupsv2 is where things are going, and most new
-kernel features in this area are only added to cgroupsv2, and not cgroupsv1
-anymore. For example cgroupsv2 provides proper cgroup-empty notifications, has
+what people think it does. cgroup v2 is where things are going, and most new
+kernel features in this area are only added to cgroup v2, and not cgroup v1
+anymore. For example cgroup v2 provides proper cgroup-empty notifications, has
support for all kinds of per-cgroup BPF magic, supports secure delegation of
cgroup trees to less privileged processes and so on, which all are not
-available on cgroupsv1.
+available on cgroup v1.
## Three Different Tree Setups 🌳
systemd supports three different modes how cgroups are set up. Specifically:
-1. **Unified** — this is the simplest mode, and exposes a pure cgroupsv2
+1. **Unified** — this is the simplest mode, and exposes a pure cgroup v2
logic. In this mode `/sys/fs/cgroup` is the only mounted cgroup API file system
and all available controllers are exclusively exposed through it.
-2. **Legacy** — this is the traditional cgroupsv1 mode. In this mode the
+2. **Legacy** — this is the traditional cgroup v1 mode. In this mode the
various controllers each get their own cgroup file system mounted to
`/sys/fs/cgroup/<controller>/`. On top of that systemd manages its own cgroup
hierarchy for managing purposes as `/sys/fs/cgroup/systemd/`.
3. **Hybrid** — this is a hybrid between the unified and legacy mode. It's set
up mostly like legacy, except that there's also an additional hierarchy
-`/sys/fs/cgroup/unified/` that contains the cgroupsv2 hierarchy. (Note that in
+`/sys/fs/cgroup/unified/` that contains the cgroup v2 hierarchy. (Note that in
this mode the unified hierarchy won't have controllers attached, the
controllers are all mounted as separate hierarchies as in legacy mode,
-i.e. `/sys/fs/cgroup/unified/` is purely and exclusively about core cgroupsv2
+i.e. `/sys/fs/cgroup/unified/` is purely and exclusively about core cgroup v2
functionality and not about resource management.) In this mode compatibility
-with cgroupsv1 is retained while some cgroupsv2 features are available
+with cgroup v1 is retained while some cgroup v2 features are available
too. This mode is a stopgap. Don't bother with this too much unless you have
too much free time.
@@ -120,7 +120,7 @@ to talk of one specific cgroup and actually mean the same cgroup in all
available controller hierarchies. E.g. if we talk about the cgroup `/foo/bar/`
then we actually mean `/sys/fs/cgroup/cpu/foo/bar/` as well as
`/sys/fs/cgroup/memory/foo/bar/`, `/sys/fs/cgroup/pids/foo/bar/`, and so on.
-Note that in cgroupsv2 the controller hierarchies aren't orthogonal, hence
+Note that in cgroup v2 the controller hierarchies aren't orthogonal, hence
thinking about them as orthogonal won't help you in the long run anyway.
If you wonder how to detect which of these three modes is currently used, use
@@ -172,7 +172,7 @@ cgroup `/foo.slice/foo-bar.slice/foo-bar-baz.slice/quux.service/`.
By default systemd sets up four slice units:
1. `-.slice` is the root slice. i.e. the parent of everything else. On the host
- system it maps directly to the top-level directory of cgroupsv2.
+ system it maps directly to the top-level directory of cgroup v2.
2. `system.slice` is where system services are by default placed, unless
configured otherwise.
@@ -191,8 +191,8 @@ above are just the defaults.
Container managers and suchlike often want to control cgroups directly using
the raw kernel APIs. That's entirely fine and supported, as long as proper
-*delegation* is followed. Delegation is a concept we inherited from cgroupsv2,
-but we expose it on cgroupsv1 too. Delegation means that some parts of the
+*delegation* is followed. Delegation is a concept we inherited from cgroup v2,
+but we expose it on cgroup v1 too. Delegation means that some parts of the
cgroup tree may be managed by different managers than others. As long as it is
clear which manager manages which part of the tree each one can do within its
sub-graph of the tree whatever it wants.
@@ -221,7 +221,7 @@ guarantees:
hierarchy (in unified and hybrid mode) as well as on systemd's own private
hierarchy (in legacy and hybrid mode). It won't pass ownership of the legacy
controller hierarchies. Delegation to less privileges processes is not safe
- in cgroupsv1 (as a limitation of the kernel), hence systemd won't facilitate
+ in cgroup v1 (as a limitation of the kernel), hence systemd won't facilitate
access to it.
3. Any BPF IP filter programs systemd installs will be installed with
@@ -326,19 +326,19 @@ to work on that, and widen your horizon a bit. You are welcome.
systemd supports a number of controllers (but not all). Specifically, supported
are:
-* on cgroupsv1: `cpu`, `cpuacct`, `blkio`, `memory`, `devices`, `pids`
-* on cgroupsv2: `cpu`, `io`, `memory`, `pids`
+* on cgroup v1: `cpu`, `cpuacct`, `blkio`, `memory`, `devices`, `pids`
+* on cgroup v2: `cpu`, `io`, `memory`, `pids`
-It is our intention to natively support all cgroupsv2 controllers as they are
-added to the kernel. However, regarding cgroupsv1: at this point we will not
+It is our intention to natively support all cgroup v2 controllers as they are
+added to the kernel. However, regarding cgroup v1: at this point we will not
add support for any other controllers anymore. This means systemd currently
-does not and will never manage the following controllers on cgroupsv1:
+does not and will never manage the following controllers on cgroup v1:
`freezer`, `cpuset`, `net_cls`, `perf_event`, `net_prio`, `hugetlb`. Why not?
Depending on the case, either their API semantics or implementations aren't
-really usable, or it's very clear they have no future on cgroupsv2, and we
+really usable, or it's very clear they have no future on cgroup v2, and we
won't add new code for stuff that clearly has no future.
-Effectively this means that all those mentioned cgroupsv1 controllers are up
+Effectively this means that all those mentioned cgroup v1 controllers are up
for grabs: systemd won't manage them, and hence won't delegate them to your
code (however, systemd will still mount their hierarchies, simply because it
mounts all controller hierarchies it finds available in the kernel). If you
@@ -359,9 +359,9 @@ cgroups in them — from previous runs, and be extra careful with them as they
might still carry settings that might not be valid anymore.
Note a particular asymmetry here: if your systemd version doesn't support a
-specific controller on cgroupsv1 you can still make use of it for delegation,
+specific controller on cgroup v1 you can still make use of it for delegation,
by directly fiddling with its hierarchy and replicating the cgroup tree there
-as necessary (as suggested above). However, on cgroupsv2 this is different:
+as necessary (as suggested above). However, on cgroup v2 this is different:
separately mounted hierarchies are not available, and delegation has always to
happen through systemd itself. This means: when you update your kernel and it
adds a new, so far unseen controller, and you want to use it for delegation,
@@ -421,7 +421,7 @@ unified you (of course, I guess) need to provide only `/sys/fs/cgroup/` itself.
arbitrary naming, you might need to escape some of the names (for example,
you really don't want to create a cgroup named `tasks`, just because the
user created a container by that name, because `tasks` after all is a magic
- attribute in cgroupsv1, and your `mkdir()` will hence fail with `EEXIST`. In
+ attribute in cgroup v1, and your `mkdir()` will hence fail with `EEXIST`. In
systemd we do escaping by prefixing names that might collide with a kernel
attribute name with an underscore. You might want to do the same, but this
is really up to you how you do it. Just do it, and be careful.
@@ -466,9 +466,9 @@ unified you (of course, I guess) need to provide only `/sys/fs/cgroup/` itself.
to get the cgroup for a unit. The method `GetUnitByControlGroup()` may be
used to get the unit for a cgroup.)
-6. ⚡ Think twice before delegating cgroupsv1 controllers to less privileged
+6. ⚡ Think twice before delegating cgroup v1 controllers to less privileged
containers. It's not safe, you basically allow your containers to freeze the
- system with that and worse. Delegation is a strongpoint of cgroupsv2 though,
+ system with that and worse. Delegation is a strongpoint of cgroup v2 though,
and there it's safe to treat delegation boundaries as privilege boundaries.
And that's it for now. If you have further questions, refer to the systemd
diff --git a/hwdb/60-sensor.hwdb b/hwdb/60-sensor.hwdb
index 5bce467a24..c7c1ccabc7 100644
--- a/hwdb/60-sensor.hwdb
+++ b/hwdb/60-sensor.hwdb
@@ -314,6 +314,10 @@ sensor:modalias:acpi:BMA250E*:dmi:bvnLENOVO:*:pvrLenovoMIIX3-1030:*
sensor:modalias:acpi:SMO8500*:dmi:bvnLENOVO:*:pvrLenovoMIIX3-830:*
ACCEL_MOUNT_MATRIX=-1, 0, 0; 0, 1, 0; 0, 0, 1
+# IdeaPad D330
+sensor:modalias:acpi:BOSC0200*:dmi:*:svnLENOVO:pn81H3:*
+ ACCEL_MOUNT_MATRIX=0, 1, 0; -1, 0, 0; 0, 0, 1
+
# IdeaPad Miix 310 note this only is for BIOS version (bvr) 1HCN4?WW and 1HCN2?WW, which has
# a portrait LCD panel, versions with bvr 1HCN3?WW have a landscape panel
sensor:modalias:acpi:KIOX000A*:dmi:bvnLENOVO:bvr1HCN4?WW:*:svnLENOVO:pn80SG:*
diff --git a/man/journalctl.xml b/man/journalctl.xml
index 58f3aa205a..7ff0a479e0 100644
--- a/man/journalctl.xml
+++ b/man/journalctl.xml
@@ -118,8 +118,8 @@
<para>When outputting to a tty, lines are colored according to
priority: lines of level ERROR and higher are colored red; lines
- of level NOTICE and higher are highlighted; other lines are
- displayed normally.</para>
+ of level NOTICE and higher are highlighted; lines of level DEBUG
+ are colored lighter grey; other lines are displayed normally.</para>
</refsect1>
<refsect1>
diff --git a/meson.build b/meson.build
index b4af6a790c..5dd105f097 100644
--- a/meson.build
+++ b/meson.build
@@ -20,12 +20,11 @@ libudev_version = '1.6.12'
# names, sometimes. Not all variables are included in every
# set. Ugh, ugh, ugh!
conf = configuration_data()
-conf.set_quoted('PACKAGE_STRING', meson.project_name() + ' ' + meson.project_version())
-conf.set_quoted('PACKAGE_VERSION', meson.project_version())
+conf.set('PROJECT_VERSION', meson.project_version())
substs = configuration_data()
-substs.set('PACKAGE_URL', 'https://www.freedesktop.org/wiki/Software/systemd')
-substs.set('PACKAGE_VERSION', meson.project_version())
+substs.set('PROJECT_URL', 'https://www.freedesktop.org/wiki/Software/systemd')
+substs.set('PROJECT_VERSION', meson.project_version())
want_ossfuzz = get_option('oss-fuzz')
want_libfuzzer = get_option('llvm-fuzz')
@@ -582,6 +581,11 @@ endif
#####################################################################
+vcs_tagger = [meson.source_root() + '/tools/meson-vcs-tag.sh',
+ meson.source_root(),
+ get_option('version-tag'),
+ meson.project_version()]
+
sed = find_program('sed')
awk = find_program('awk')
m4 = find_program('m4')
@@ -2392,6 +2396,9 @@ executable('systemd-sleep',
install : true,
install_dir : rootlibexecdir)
+install_data('src/sleep/sleep.conf',
+ install_dir : pkgsysconfdir)
+
exe = executable('systemd-sysctl',
'src/sysctl/sysctl.c',
include_directories : includes,
@@ -2892,8 +2899,9 @@ foreach tuple : fuzzers
endforeach
endif
-run_target('fuzzers',
- depends : fuzzer_exes,
+run_target(
+ 'fuzzers',
+ depends : [fuzzer_exes, version_h],
command : ['true'])
############################################################
diff --git a/meson_options.txt b/meson_options.txt
index 3474265bd3..044bb792b5 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -1,6 +1,9 @@
# -*- mode: meson -*-
# SPDX-License-Identifier: LGPL-2.1+
+option('version-tag', type : 'string',
+ description : 'override the git version string')
+
option('split-usr', type : 'combo', choices : ['auto', 'true', 'false'],
description : '''/bin, /sbin aren't symlinks into /usr''')
option('split-bin', type : 'combo', choices : ['auto', 'true', 'false'],
diff --git a/po/it.po b/po/it.po
index 40f87d6880..3c1213d8f7 100644
--- a/po/it.po
+++ b/po/it.po
@@ -2,14 +2,14 @@
#
# Italian translation for systemd package
# Traduzione in italiano per il pacchetto systemd
-# Daniele Medri <dmedri@gmail.com>, 2013-2018.
+# Daniele Medri <dmedri@gmail.com>, 2013-2019.
#
msgid ""
msgstr ""
"Project-Id-Version: systemd\n"
-"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2018-08-30 13:50+0200\n"
-"PO-Revision-Date: 2018-08-30 14:15+0200\n"
+"Report-Msgid-Bugs-To: https://github.com/systemd/systemd/issues\n"
+"POT-Creation-Date: 2019-01-02 13:27+0100\n"
+"PO-Revision-Date: 2019-01-02 13:35+0100\n"
"Last-Translator: Daniele Medri <dmedri@gmail.com>\n"
"Language-Team: Italian\n"
"Language: it\n"
@@ -17,7 +17,7 @@ msgstr ""
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
-"X-Generator: Poedit 2.0.9\n"
+"X-Generator: Poedit 2.2\n"
#: src/core/org.freedesktop.systemd1.policy.in:22
msgid "Send passphrase back to system"
@@ -491,11 +491,11 @@ msgstr ""
"Autenticazione richiesta per indicare al firmware di avviare l'interfaccia "
"di configurazione."
-#: src/login/org.freedesktop.login1.policy:351
+#: src/login/org.freedesktop.login1.policy:352
msgid "Set a wall message"
msgstr "Configura un messaggio per gli utenti"
-#: src/login/org.freedesktop.login1.policy:352
+#: src/login/org.freedesktop.login1.policy:353
msgid "Authentication is required to set a wall message"
msgstr "Autenticazione richiesta per configurare un messaggio per gli utenti"
@@ -678,8 +678,12 @@ msgid "Authentication is required to restart '$(unit)'."
msgstr "Autenticazione richiesta per riavviare '$(unit)'."
#: src/core/dbus-unit.c:437
-msgid "Authentication is required to kill '$(unit)'."
-msgstr "Autenticazione richiesta per terminare '$(unit)'."
+msgid ""
+"Authentication is required to send a UNIX signal to the processes of "
+"'$(unit)'."
+msgstr ""
+"Autenticazione richiesta per inviare un segnale UNIX ai processi di "
+"'$(unit)'."
#: src/core/dbus-unit.c:468
msgid "Authentication is required to reset the \"failed\" state of '$(unit)'."
diff --git a/shell-completion/zsh/_coredumpctl b/shell-completion/zsh/_coredumpctl
index cf24f5b361..720d02a3ef 100644
--- a/shell-completion/zsh/_coredumpctl
+++ b/shell-completion/zsh/_coredumpctl
@@ -16,7 +16,7 @@ _coredumpctl_command(){
local -a _dumps
cmd="${${_coredumpctl_cmds[(r)$words[1]:*]%%:*}}"
if (( $#cmd )); then
- _dumps=( "${(f)$(coredumpctl list --no-legend | awk 'BEGIN{OFS=":"} {sub(/[[ \t]+/, ""); print $4,$0}' 2>/dev/null)}" )
+ _dumps=( "${(f)$(coredumpctl list -q --no-legend | awk 'BEGIN{OFS=":"} {sub(/[[ \t]+/, ""); print $4,$0}' 2>/dev/null)}" )
if [[ -n "$_dumps" ]]; then
_describe -V -t pids 'coredumps' _dumps
else
@@ -39,5 +39,7 @@ _arguments \
'--no-legend[Do not print the column headers]' \
{-h,--help}'[Show this help]' \
'--version[Show package version]' \
- '--debugger=[Use the given debugger]' \
+ '--debugger=[Use the given debugger]:debugger: _command_names -e' \
+ {-D,--directory=}'[Use the journal files in the specified dir]:directory: _directories' \
+ {-q,--quiet}'[Do not show info messages and privilege warning]' \
'*::coredumpctl commands:_coredumpctl_command'
diff --git a/src/analyze/analyze.c b/src/analyze/analyze.c
index 1f69b9fda1..3915b66739 100644
--- a/src/analyze/analyze.c
+++ b/src/analyze/analyze.c
@@ -14,6 +14,7 @@
#include "alloc-util.h"
#include "analyze-security.h"
#include "analyze-verify.h"
+#include "build.h"
#include "bus-error.h"
#include "bus-unit-util.h"
#include "bus-util.h"
@@ -696,7 +697,7 @@ static int analyze_plot(int argc, char *argv[], void *userdata) {
"<!-- that render these files properly but much slower are ImageMagick, -->\n"
"<!-- gimp, inkscape, etc. To display the files on your system, just -->\n"
"<!-- point your browser to this file. -->\n\n"
- "<!-- This plot was generated by systemd-analyze version %-16.16s -->\n\n", PACKAGE_VERSION);
+ "<!-- This plot was generated by systemd-analyze version %-16.16s -->\n\n", GIT_VERSION);
/* style sheet */
svg("<defs>\n <style type=\"text/css\">\n <![CDATA[\n"
diff --git a/src/basic/build.h b/src/basic/build.h
index 2c46550300..7a59059080 100644
--- a/src/basic/build.h
+++ b/src/basic/build.h
@@ -1,6 +1,8 @@
/* SPDX-License-Identifier: LGPL-2.1+ */
#pragma once
+#include "version.h"
+
#if HAVE_PAM
#define _PAM_FEATURE_ "+PAM"
#else
diff --git a/src/basic/cgroup-util.c b/src/basic/cgroup-util.c
index 830a63c185..8ce7ccb960 100644
--- a/src/basic/cgroup-util.c
+++ b/src/basic/cgroup-util.c
@@ -872,7 +872,7 @@ int cg_set_access(
bool fatal;
};
- /* cgroupsv1, aka legacy/non-unified */
+ /* cgroup v1, aka legacy/non-unified */
static const struct Attribute legacy_attributes[] = {
{ "cgroup.procs", true },
{ "tasks", false },
@@ -880,7 +880,7 @@ int cg_set_access(
{},
};
- /* cgroupsv2, aka unified */
+ /* cgroup v2, aka unified */
static const struct Attribute unified_attributes[] = {
{ "cgroup.procs", true },
{ "cgroup.subtree_control", true },
@@ -2039,7 +2039,7 @@ int cg_get_keyed_attribute(
char **v;
int r;
- /* Reads one or more fields of a cgroupsv2 keyed attribute file. The 'keys' parameter should be an strv with
+ /* Reads one or more fields of a cgroup v2 keyed attribute file. The 'keys' parameter should be an strv with
* all keys to retrieve. The 'ret_values' parameter should be passed as string size with the same number of
* entries as 'keys'. On success each entry will be set to the value of the matching key.
*
@@ -2491,7 +2491,7 @@ int cg_kernel_controllers(Set **ret) {
static thread_local CGroupUnified unified_cache = CGROUP_UNIFIED_UNKNOWN;
-/* The hybrid mode was initially implemented in v232 and simply mounted cgroup v2 on /sys/fs/cgroup/systemd. This
+/* The hybrid mode was initially implemented in v232 and simply mounted cgroup2 on /sys/fs/cgroup/systemd. This
* unfortunately broke other tools (such as docker) which expected the v1 "name=systemd" hierarchy on
* /sys/fs/cgroup/systemd. From v233 and on, the hybrid mode mountnbs v2 on /sys/fs/cgroup/unified and maintains
* "name=systemd" hierarchy on /sys/fs/cgroup/systemd for compatibility with other tools.
@@ -2739,13 +2739,13 @@ bool cg_is_legacy_wanted(void) {
if (wanted >= 0)
return wanted;
- /* Check if we have cgroups2 already mounted. */
+ /* Check if we have cgroup v2 already mounted. */
if (cg_unified_flush() >= 0 &&
unified_cache == CGROUP_UNIFIED_ALL)
return (wanted = false);
/* Otherwise, assume that at least partial legacy is wanted,
- * since cgroups2 should already be mounted at this point. */
+ * since cgroup v2 should already be mounted at this point. */
return (wanted = true);
}
diff --git a/src/basic/cgroup-util.h b/src/basic/cgroup-util.h
index ea9a333290..220c8d381f 100644
--- a/src/basic/cgroup-util.h
+++ b/src/basic/cgroup-util.h
@@ -48,13 +48,13 @@ typedef enum CGroupMask {
CGROUP_MASK_BPF_FIREWALL = CGROUP_CONTROLLER_TO_MASK(CGROUP_CONTROLLER_BPF_FIREWALL),
CGROUP_MASK_BPF_DEVICES = CGROUP_CONTROLLER_TO_MASK(CGROUP_CONTROLLER_BPF_DEVICES),
- /* All real cgroupv1 controllers */
+ /* All real cgroup v1 controllers */
CGROUP_MASK_V1 = CGROUP_MASK_CPU|CGROUP_MASK_CPUACCT|CGROUP_MASK_BLKIO|CGROUP_MASK_MEMORY|CGROUP_MASK_DEVICES|CGROUP_MASK_PIDS,
- /* All real cgroupv2 controllers */
+ /* All real cgroup v2 controllers */
CGROUP_MASK_V2 = CGROUP_MASK_CPU|CGROUP_MASK_IO|CGROUP_MASK_MEMORY|CGROUP_MASK_PIDS,
- /* All cgroupv2 BPF pseudo-controllers */
+ /* All cgroup v2 BPF pseudo-controllers */
CGROUP_MASK_BPF = CGROUP_MASK_BPF_FIREWALL|CGROUP_MASK_BPF_DEVICES,
_CGROUP_MASK_ALL = CGROUP_CONTROLLER_TO_MASK(_CGROUP_CONTROLLER_MAX) - 1
diff --git a/src/basic/meson.build b/src/basic/meson.build
index 23b5e75bd8..95a0d45450 100644
--- a/src/basic/meson.build
+++ b/src/basic/meson.build
@@ -1,5 +1,10 @@
# SPDX-License-Identifier: LGPL-2.1+
+version_h = vcs_tag(
+ command: vcs_tagger,
+ input : 'version.h.in',
+ output : 'version.h')
+
basic_sources = files('''
MurmurHash2.c
MurmurHash2.h
diff --git a/src/basic/util.c b/src/basic/util.c
index c4f12a6daa..96c314e895 100644
--- a/src/basic/util.c
+++ b/src/basic/util.c
@@ -557,7 +557,7 @@ uint64_t system_tasks_max_scale(uint64_t v, uint64_t max) {
}
int version(void) {
- puts(PACKAGE_STRING "\n"
+ puts("systemd " GIT_VERSION "\n"
SYSTEMD_FEATURES);
return 0;
}
diff --git a/src/basic/version.h.in b/src/basic/version.h.in
new file mode 100644
index 0000000000..9f82d905a7
--- /dev/null
+++ b/src/basic/version.h.in
@@ -0,0 +1 @@
+#define GIT_VERSION "@VCS_TAG@"
diff --git a/src/boot/efi/boot.c b/src/boot/efi/boot.c
index 4719eeaf4b..5aae7e7c06 100644
--- a/src/boot/efi/boot.c
+++ b/src/boot/efi/boot.c
@@ -17,7 +17,7 @@
#endif
/* magic string to find in the binary image */
-static const char __attribute__((used)) magic[] = "#### LoaderInfo: systemd-boot " PACKAGE_VERSION " ####";
+static const char __attribute__((used)) magic[] = "#### LoaderInfo: systemd-boot " GIT_VERSION " ####";
static const EFI_GUID global_guid = EFI_GLOBAL_VARIABLE;
@@ -361,7 +361,7 @@ static VOID print_status(Config *config, CHAR16 *loaded_image_path) {
uefi_call_wrapper(ST->ConOut->SetAttribute, 2, ST->ConOut, EFI_LIGHTGRAY|EFI_BACKGROUND_BLACK);
uefi_call_wrapper(ST->ConOut->ClearScreen, 1, ST->ConOut);
- Print(L"systemd-boot version: " PACKAGE_VERSION "\n");
+ Print(L"systemd-boot version: " GIT_VERSION "\n");
Print(L"architecture: " EFI_MACHINE_TYPE_NAME "\n");
Print(L"loaded image: %s\n", loaded_image_path);
Print(L"UEFI specification: %d.%02d\n", ST->Hdr.Revision >> 16, ST->Hdr.Revision & 0xffff);
@@ -804,7 +804,7 @@ static BOOLEAN menu_run(
break;
case KEYPRESS(0, 0, 'v'):
- status = PoolPrint(L"systemd-boot " PACKAGE_VERSION " (" EFI_MACHINE_TYPE_NAME "), UEFI Specification %d.%02d, Vendor %s %d.%02d",
+ status = PoolPrint(L"systemd-boot " GIT_VERSION " (" EFI_MACHINE_TYPE_NAME "), UEFI Specification %d.%02d, Vendor %s %d.%02d",
ST->Hdr.Revision >> 16, ST->Hdr.Revision & 0xffff,
ST->FirmwareVendor, ST->FirmwareRevision >> 16, ST->FirmwareRevision & 0xffff);
break;
@@ -2097,7 +2097,7 @@ EFI_STATUS efi_main(EFI_HANDLE image, EFI_SYSTEM_TABLE *sys_table) {
InitializeLib(image, sys_table);
init_usec = time_usec();
efivar_set_time_usec(L"LoaderTimeInitUSec", init_usec);
- efivar_set(L"LoaderInfo", L"systemd-boot " PACKAGE_VERSION, FALSE);
+ efivar_set(L"LoaderInfo", L"systemd-boot " GIT_VERSION, FALSE);
infostr = PoolPrint(L"%s %d.%02d", ST->FirmwareVendor, ST->FirmwareRevision >> 16, ST->FirmwareRevision & 0xffff);
efivar_set(L"LoaderFirmwareInfo", infostr, FALSE);
diff --git a/src/boot/efi/meson.build b/src/boot/efi/meson.build
index aa897c62a1..9c0ae5ace1 100644
--- a/src/boot/efi/meson.build
+++ b/src/boot/efi/meson.build
@@ -78,7 +78,6 @@ endif
if have_gnu_efi
efi_conf = configuration_data()
- efi_conf.set_quoted('PACKAGE_VERSION', meson.project_version())
efi_conf.set_quoted('EFI_MACHINE_TYPE_NAME', EFI_MACHINE_TYPE_NAME)
efi_conf.set10('ENABLE_TPM', get_option('tpm'))
efi_conf.set('SD_TPM_PCR', get_option('tpm-pcrindex'))
@@ -117,7 +116,8 @@ if have_gnu_efi
'-Wno-missing-field-initializers',
'-isystem', efi_incdir,
'-isystem', join_paths(efi_incdir, gnu_efi_path_arch),
- '-include', efi_config_h]
+ '-include', efi_config_h,
+ '-include', version_h]
if efi_arch == 'x86_64'
compile_args += ['-mno-red-zone',
'-mno-sse',
diff --git a/src/boot/efi/stub.c b/src/boot/efi/stub.c
index d11e555748..6b07879971 100644
--- a/src/boot/efi/stub.c
+++ b/src/boot/efi/stub.c
@@ -12,7 +12,7 @@
#include "util.h"
/* magic string to find in the binary image */
-static const char __attribute__((used)) magic[] = "#### LoaderInfo: systemd-stub " PACKAGE_VERSION " ####";
+static const char __attribute__((used)) magic[] = "#### LoaderInfo: systemd-stub " GIT_VERSION " ####";
static const EFI_GUID global_guid = EFI_GLOBAL_VARIABLE;
@@ -117,7 +117,7 @@ EFI_STATUS efi_main(EFI_HANDLE image, EFI_SYSTEM_TABLE *sys_table) {
/* add StubInfo */
if (efivar_get_raw(&global_guid, L"StubInfo", &b, &size) != EFI_SUCCESS)
- efivar_set(L"StubInfo", L"systemd-stub " PACKAGE_VERSION, FALSE);
+ efivar_set(L"StubInfo", L"systemd-stub " GIT_VERSION, FALSE);
if (szs[3] > 0)
graphics_splash((UINT8 *)((UINTN)loaded_image->ImageBase + addrs[3]), szs[3], NULL);
diff --git a/src/cgtop/cgtop.c b/src/cgtop/cgtop.c
index 5abfab03de..11cc5fa2e9 100644
--- a/src/cgtop/cgtop.c
+++ b/src/cgtop/cgtop.c
@@ -104,7 +104,7 @@ static const char *maybe_format_bytes(char *buf, size_t l, bool is_valid, uint64
static bool is_root_cgroup(const char *path) {
- /* Returns true if the specified path belongs to the root cgroup. The root cgroup is special on cgroupsv2 as it
+ /* Returns true if the specified path belongs to the root cgroup. The root cgroup is special on cgroup v2 as it
* carries only very few attributes in order not to export multiple truth about system state as most
* information is available elsewhere in /proc anyway. We need to be able to deal with that, and need to get
* our data from different sources in that case.
diff --git a/src/core/cgroup.c b/src/core/cgroup.c
index a7ce3fceaa..ed2f331b33 100644
--- a/src/core/cgroup.c
+++ b/src/core/cgroup.c
@@ -396,26 +396,31 @@ static void cgroup_xattr_apply(Unit *u) {
}
static int lookup_block_device(const char *p, dev_t *ret) {
- struct stat st = {};
+ dev_t rdev, dev = 0;
+ mode_t mode;
int r;
assert(p);
assert(ret);
- r = device_path_parse_major_minor(p, &st.st_mode, &st.st_rdev);
+ r = device_path_parse_major_minor(p, &mode, &rdev);
if (r == -ENODEV) { /* not a parsable device node, need to go to disk */
+ struct stat st;
if (stat(p, &st) < 0)
return log_warning_errno(errno, "Couldn't stat device '%s': %m", p);
+ rdev = (dev_t)st.st_rdev;
+ dev = (dev_t)st.st_dev;
+ mode = st.st_mode;
} else if (r < 0)
return log_warning_errno(r, "Failed to parse major/minor from path '%s': %m", p);
- if (S_ISCHR(st.st_mode)) {
+ if (S_ISCHR(mode)) {
log_warning("Device node '%s' is a character device, but block device needed.", p);
return -ENOTBLK;
- } else if (S_ISBLK(st.st_mode))
- *ret = st.st_rdev;
- else if (major(st.st_dev) != 0)
- *ret = st.st_dev; /* If this is not a device node then use the block device this file is stored on */
+ } else if (S_ISBLK(mode))
+ *ret = rdev;
+ else if (major(dev) != 0)
+ *ret = dev; /* If this is not a device node then use the block device this file is stored on */
else {
/* If this is btrfs, getting the backing block device is a bit harder */
r = btrfs_get_block_device(p, ret);
@@ -436,7 +441,8 @@ static int lookup_block_device(const char *p, dev_t *ret) {
}
static int whitelist_device(BPFProgram *prog, const char *path, const char *node, const char *acc) {
- struct stat st = {};
+ dev_t rdev;
+ mode_t mode;
int r;
assert(path);
@@ -445,11 +451,12 @@ static int whitelist_device(BPFProgram *prog, const char *path, const char *node
/* Some special handling for /dev/block/%u:%u, /dev/char/%u:%u, /run/systemd/inaccessible/chr and
* /run/systemd/inaccessible/blk paths. Instead of stat()ing these we parse out the major/minor directly. This
* means clients can use these path without the device node actually around */
- r = device_path_parse_major_minor(node, &st.st_mode, &st.st_rdev);
+ r = device_path_parse_major_minor(node, &mode, &rdev);
if (r < 0) {
if (r != -ENODEV)
return log_warning_errno(r, "Couldn't parse major/minor from device path '%s': %m", node);
+ struct stat st;
if (stat(node, &st) < 0)
return log_warning_errno(errno, "Couldn't stat device %s: %m", node);
@@ -457,22 +464,24 @@ static int whitelist_device(BPFProgram *prog, const char *path, const char *node
log_warning("%s is not a device.", node);
return -ENODEV;
}
+ rdev = (dev_t) st.st_rdev;
+ mode = st.st_mode;
}
if (cg_all_unified() > 0) {
if (!prog)
return 0;
- return cgroup_bpf_whitelist_device(prog, S_ISCHR(st.st_mode) ? BPF_DEVCG_DEV_CHAR : BPF_DEVCG_DEV_BLOCK,
- major(st.st_rdev), minor(st.st_rdev), acc);
+ return cgroup_bpf_whitelist_device(prog, S_ISCHR(mode) ? BPF_DEVCG_DEV_CHAR : BPF_DEVCG_DEV_BLOCK,
+ major(rdev), minor(rdev), acc);
} else {
char buf[2+DECIMAL_STR_MAX(dev_t)*2+2+4];
sprintf(buf,
"%c %u:%u %s",
- S_ISCHR(st.st_mode) ? 'c' : 'b',
- major(st.st_rdev), minor(st.st_rdev),
+ S_ISCHR(mode) ? 'c' : 'b',
+ major(rdev), minor(rdev),
acc);
/* Changing the devices list of a populated cgroup might result in EINVAL, hence ignore EINVAL here. */
@@ -881,7 +890,7 @@ static void cgroup_context_apply(
/* In fully unified mode these attributes don't exist on the host cgroup root. On legacy the weights exist, but
* setting the weight makes very little sense on the host root cgroup, as there are no other cgroups at this
* level. The quota exists there too, but any attempt to write to it is refused with EINVAL. Inside of
- * containers we want to leave control of these to the container manager (and if cgroupsv2 delegation is used
+ * containers we want to leave control of these to the container manager (and if cgroup v2 delegation is used
* we couldn't even write to them if we wanted to). */
if ((apply_mask & CGROUP_MASK_CPU) && !is_local_root) {
@@ -925,7 +934,7 @@ static void cgroup_context_apply(
}
}
- /* The 'io' controller attributes are not exported on the host's root cgroup (being a pure cgroupsv2
+ /* The 'io' controller attributes are not exported on the host's root cgroup (being a pure cgroup v2
* controller), and in case of containers we want to leave control of these attributes to the container manager
* (and we couldn't access that stuff anyway, even if we tried if proper delegation is used). */
if ((apply_mask & CGROUP_MASK_IO) && !is_local_root) {
@@ -1067,7 +1076,7 @@ static void cgroup_context_apply(
/* In unified mode 'memory' attributes do not exist on the root cgroup. In legacy mode 'memory.limit_in_bytes'
* exists on the root cgroup, but any writes to it are refused with EINVAL. And if we run in a container we
- * want to leave control to the container manager (and if proper cgroupsv2 delegation is used we couldn't even
+ * want to leave control to the container manager (and if proper cgroup v2 delegation is used we couldn't even
* write to this if we wanted to.) */
if ((apply_mask & CGROUP_MASK_MEMORY) && !is_local_root) {
@@ -1109,7 +1118,7 @@ static void cgroup_context_apply(
}
}
- /* On cgroupsv2 we can apply BPF everywhere. On cgroupsv1 we apply it everywhere except for the root of
+ /* On cgroup v2 we can apply BPF everywhere. On cgroup v1 we apply it everywhere except for the root of
* containers, where we leave this to the manager */
if ((apply_mask & (CGROUP_MASK_DEVICES | CGROUP_MASK_BPF_DEVICES)) &&
(is_host_root || cg_all_unified() > 0 || !is_local_root)) {
@@ -1841,14 +1850,14 @@ static bool unit_has_mask_realized(
/* Returns true if this unit is fully realized. We check four things:
*
* 1. Whether the cgroup was created at all
- * 2. Whether the cgroup was created in all the hierarchies we need it to be created in (in case of cgroupsv1)
- * 3. Whether the cgroup has all the right controllers enabled (in case of cgroupsv2)
+ * 2. Whether the cgroup was created in all the hierarchies we need it to be created in (in case of cgroup v1)
+ * 3. Whether the cgroup has all the right controllers enabled (in case of cgroup v2)
* 4. Whether the invalidation mask is currently zero
*
* If you wonder why we mask the target realization and enable mask with CGROUP_MASK_V1/CGROUP_MASK_V2: note
- * that there are three sets of bitmasks: CGROUP_MASK_V1 (for real cgroupv1 controllers), CGROUP_MASK_V2 (for
- * real cgroupv2 controllers) and CGROUP_MASK_BPF (for BPF-based pseudo-controllers). Now, cgroup_realized_mask
- * is only matters for cgroupsv1 controllers, and cgroup_enabled_mask only used for cgroupsv2, and if they
+ * that there are three sets of bitmasks: CGROUP_MASK_V1 (for real cgroup v1 controllers), CGROUP_MASK_V2 (for
+ * real cgroup v2 controllers) and CGROUP_MASK_BPF (for BPF-based pseudo-controllers). Now, cgroup_realized_mask
+ * is only matters for cgroup v1 controllers, and cgroup_enabled_mask only used for cgroup v2, and if they
* differ in the others, we don't really care. (After all, the cgroup_enabled_mask tracks with controllers are
* enabled through cgroup.subtree_control, and since the BPF pseudo-controllers don't show up there, they
* simply don't matter. */
diff --git a/src/core/dbus-manager.c b/src/core/dbus-manager.c
index 8da07adfe7..88e4c6bb95 100644
--- a/src/core/dbus-manager.c
+++ b/src/core/dbus-manager.c
@@ -43,7 +43,7 @@ static UnitFileFlags unit_file_bools_to_flags(bool runtime, bool force) {
(force ? UNIT_FILE_FORCE : 0);
}
-static BUS_DEFINE_PROPERTY_GET_GLOBAL(property_get_version, "s", PACKAGE_VERSION);
+static BUS_DEFINE_PROPERTY_GET_GLOBAL(property_get_version, "s", GIT_VERSION);
static BUS_DEFINE_PROPERTY_GET_GLOBAL(property_get_features, "s", SYSTEMD_FEATURES);
static BUS_DEFINE_PROPERTY_GET_GLOBAL(property_get_architecture, "s", architecture_to_string(uname_architecture()));
static BUS_DEFINE_PROPERTY_GET_GLOBAL(property_get_log_target, "s", log_target_to_string(log_get_target()));
diff --git a/src/core/execute.c b/src/core/execute.c
index 595a3c6eca..976f081e1f 100644
--- a/src/core/execute.c
+++ b/src/core/execute.c
@@ -3137,9 +3137,9 @@ static int exec_child(
}
}
- /* If delegation is enabled we'll pass ownership of the cgroup to the user of the new process. On cgroupsv1
+ /* If delegation is enabled we'll pass ownership of the cgroup to the user of the new process. On cgroup v1
* this is only about systemd's own hierarchy, i.e. not the controller hierarchies, simply because that's not
- * safe. On cgroupsv2 there's only one hierarchy anyway, and delegation is safe there, hence in that case only
+ * safe. On cgroup v2 there's only one hierarchy anyway, and delegation is safe there, hence in that case only
* touch a single hierarchy too. */
if (params->cgroup_path && context->user && (params->flags & EXEC_CGROUP_DELEGATE)) {
r = cg_set_access(SYSTEMD_CGROUP_CONTROLLER, params->cgroup_path, uid, gid);
diff --git a/src/core/main.c b/src/core/main.c
index 839dc062ff..bb86280c2d 100644
--- a/src/core/main.c
+++ b/src/core/main.c
@@ -1914,7 +1914,7 @@ static void log_execution_mode(bool *ret_first_boot) {
if (arg_system) {
int v;
- log_info(PACKAGE_STRING " running in %ssystem mode. (" SYSTEMD_FEATURES ")",
+ log_info("systemd " GIT_VERSION " running in %ssystem mode. (" SYSTEMD_FEATURES ")",
arg_action == ACTION_TEST ? "test " : "" );
v = detect_virtualization();
@@ -1942,7 +1942,7 @@ static void log_execution_mode(bool *ret_first_boot) {
_cleanup_free_ char *t;
t = uid_to_name(getuid());
- log_debug(PACKAGE_STRING " running in %suser mode for user " UID_FMT "/%s. (" SYSTEMD_FEATURES ")",
+ log_debug("systemd " GIT_VERSION " running in %suser mode for user " UID_FMT "/%s. (" SYSTEMD_FEATURES ")",
arg_action == ACTION_TEST ? " test" : "", getuid(), strna(t));
}
diff --git a/src/core/meson.build b/src/core/meson.build
index 450d6f72a9..85021bdc01 100644
--- a/src/core/meson.build
+++ b/src/core/meson.build
@@ -173,26 +173,19 @@ systemd_shutdown_sources = files('''
'''.split())
in_files = [['macros.systemd', rpmmacrosdir],
- ['triggers.systemd', ''],
+ ['system.conf', pkgsysconfdir],
['systemd.pc', pkgconfigdatadir],
- ['system.conf', pkgsysconfdir]]
+ ['triggers.systemd', '']]
foreach item : in_files
file = item[0]
dir = item[1]
- # If 'no', disable generation completely.
- # If '', generate, but do not install.
- if dir != 'no'
- gen = configure_file(
- input : file + '.in',
- output : file,
- configuration : substs)
- if dir != ''
- install_data(gen,
- install_dir : dir)
- endif
- endif
+ configure_file(
+ input : file + '.in',
+ output : file,
+ configuration : substs,
+ install_dir : dir == 'no' ? '' : dir)
endforeach
install_data('org.freedesktop.systemd1.conf',
diff --git a/src/core/systemd.pc.in b/src/core/systemd.pc.in
index 655773ea8a..0dae950473 100644
--- a/src/core/systemd.pc.in
+++ b/src/core/systemd.pc.in
@@ -36,5 +36,5 @@ containeruidbasemax=@containeruidbasemax@
Name: systemd
Description: systemd System and Service Manager
-URL: @PACKAGE_URL@
-Version: @PACKAGE_VERSION@
+URL: @PROJECT_URL@
+Version: @PROJECT_VERSION@
diff --git a/src/core/unit.h b/src/core/unit.h
index 6fd39eaca3..43cf15715a 100644
--- a/src/core/unit.h
+++ b/src/core/unit.h
@@ -248,8 +248,8 @@ typedef struct Unit {
/* Counterparts in the cgroup filesystem */
char *cgroup_path;
- CGroupMask cgroup_realized_mask; /* In which hierarchies does this unit's cgroup exist? (only relevant on cgroupsv1) */
- CGroupMask cgroup_enabled_mask; /* Which controllers are enabled (or more correctly: enabled for the children) for this unit's cgroup? (only relevant on cgroupsv2) */
+ CGroupMask cgroup_realized_mask; /* In which hierarchies does this unit's cgroup exist? (only relevant on cgroup v1) */
+ CGroupMask cgroup_enabled_mask; /* Which controllers are enabled (or more correctly: enabled for the children) for this unit's cgroup? (only relevant on cgroup v2) */
CGroupMask cgroup_invalidated_mask; /* A mask specifiying controllers which shall be considered invalidated, and require re-realization */
CGroupMask cgroup_members_mask; /* A cache for the controllers required by all children of this cgroup (only relevant for slice units) */
int cgroup_inotify_wd;
diff --git a/src/import/curl-util.c b/src/import/curl-util.c
index 05b17c3c78..360628fe44 100644
--- a/src/import/curl-util.c
+++ b/src/import/curl-util.c
@@ -1,6 +1,7 @@
/* SPDX-License-Identifier: LGPL-2.1+ */
#include "alloc-util.h"
+#include "build.h"
#include "curl-util.h"
#include "fd-util.h"
#include "locale-util.h"
@@ -283,7 +284,7 @@ int curl_glue_make(CURL **ret, const char *url, void *userdata) {
if (curl_easy_setopt(c, CURLOPT_PRIVATE, userdata) != CURLE_OK)
return -EIO;
- useragent = strjoina(program_invocation_short_name, "/" PACKAGE_VERSION);
+ useragent = strjoina(program_invocation_short_name, "/" GIT_VERSION);
if (curl_easy_setopt(c, CURLOPT_USERAGENT, useragent) != CURLE_OK)
return -EIO;
diff --git a/src/journal-remote/journal-upload.c b/src/journal-remote/journal-upload.c
index 1e08fcc554..ef3556f825 100644
--- a/src/journal-remote/journal-upload.c
+++ b/src/journal-remote/journal-upload.c
@@ -9,6 +9,7 @@
#include "sd-daemon.h"
#include "alloc-util.h"
+#include "build.h"
#include "conf-parser.h"
#include "daemon-util.h"
#include "def.h"
@@ -236,7 +237,7 @@ int start_upload(Uploader *u,
easy_setopt(curl, CURLOPT_VERBOSE, 1L, LOG_WARNING, );
easy_setopt(curl, CURLOPT_USERAGENT,
- "systemd-journal-upload " PACKAGE_STRING,
+ "systemd-journal-upload " GIT_VERSION,
LOG_WARNING, );
if (arg_key || startswith(u->url, "https://")) {
diff --git a/src/journal/journald-context.c b/src/journal/journald-context.c
index 8253a45128..e84e5117b8 100644
--- a/src/journal/journald-context.c
+++ b/src/journal/journald-context.c
@@ -257,7 +257,7 @@ static int client_context_read_cgroup(Server *s, ClientContext *c, const char *u
/* We use the unit ID passed in as fallback if we have nothing cached yet and cg_pid_get_path_shifted()
* failed or process is running in a root cgroup. Zombie processes are automatically migrated to root cgroup
- * on cgroupsv1 and we want to be able to map log messages from them too. */
+ * on cgroup v1 and we want to be able to map log messages from them too. */
if (unit_id && !c->unit) {
c->unit = strdup(unit_id);
if (c->unit)
diff --git a/src/libsystemd-network/sd-dhcp-client.c b/src/libsystemd-network/sd-dhcp-client.c
index 2d7ffd22ca..35fc88ef91 100644
--- a/src/libsystemd-network/sd-dhcp-client.c
+++ b/src/libsystemd-network/sd-dhcp-client.c
@@ -118,19 +118,19 @@ static const uint8_t default_req_opts[] = {
*/
/* NOTE: using PRL options that Windows 10 RFC7844 implementation uses */
static const uint8_t default_req_opts_anonymize[] = {
- SD_DHCP_OPTION_SUBNET_MASK, /* 1 */
- SD_DHCP_OPTION_ROUTER, /* 3 */
- SD_DHCP_OPTION_DOMAIN_NAME_SERVER, /* 6 */
- SD_DHCP_OPTION_DOMAIN_NAME, /* 15 */
- SD_DHCP_OPTION_ROUTER_DISCOVER, /* 31 */
- SD_DHCP_OPTION_STATIC_ROUTE, /* 33 */
- SD_DHCP_OPTION_VENDOR_SPECIFIC, /* 43 */
- SD_DHCP_OPTION_NETBIOS_NAMESERVER, /* 44 */
- SD_DHCP_OPTION_NETBIOS_NODETYPE, /* 46 */
- SD_DHCP_OPTION_NETBIOS_SCOPE, /* 47 */
- SD_DHCP_OPTION_CLASSLESS_STATIC_ROUTE, /* 121 */
- SD_DHCP_OPTION_PRIVATE_CLASSLESS_STATIC_ROUTE, /* 249 */
- SD_DHCP_OPTION_PRIVATE_PROXY_AUTODISCOVERY, /* 252 */
+ SD_DHCP_OPTION_SUBNET_MASK, /* 1 */
+ SD_DHCP_OPTION_ROUTER, /* 3 */
+ SD_DHCP_OPTION_DOMAIN_NAME_SERVER, /* 6 */
+ SD_DHCP_OPTION_DOMAIN_NAME, /* 15 */
+ SD_DHCP_OPTION_ROUTER_DISCOVER, /* 31 */
+ SD_DHCP_OPTION_STATIC_ROUTE, /* 33 */
+ SD_DHCP_OPTION_VENDOR_SPECIFIC, /* 43 */
+ SD_DHCP_OPTION_NETBIOS_NAMESERVER, /* 44 */
+ SD_DHCP_OPTION_NETBIOS_NODETYPE, /* 46 */
+ SD_DHCP_OPTION_NETBIOS_SCOPE, /* 47 */
+ SD_DHCP_OPTION_CLASSLESS_STATIC_ROUTE, /* 121 */
+ SD_DHCP_OPTION_PRIVATE_CLASSLESS_STATIC_ROUTE, /* 249 */
+ SD_DHCP_OPTION_PRIVATE_PROXY_AUTODISCOVERY, /* 252 */
};
static int client_receive_message_raw(
@@ -353,9 +353,9 @@ static int dhcp_client_set_iaid_duid_internal(
size_t len;
assert_return(client, -EINVAL);
- assert_return(duid_len == 0 || duid != NULL, -EINVAL);
+ assert_return(duid_len == 0 || duid, -EINVAL);
- if (duid != NULL) {
+ if (duid) {
r = dhcp_validate_duid_len(duid_type, duid_len, true);
if (r < 0)
return r;
@@ -377,7 +377,7 @@ static int dhcp_client_set_iaid_duid_internal(
}
}
- if (duid != NULL) {
+ if (duid) {
client->client_id.ns.duid.type = htobe16(duid_type);
memcpy(&client->client_id.ns.duid.raw.data, duid, duid_len);
len = sizeof(client->client_id.ns.duid.type) + duid_len;
@@ -1795,7 +1795,7 @@ static int client_receive_message_raw(
} else if ((size_t)len < sizeof(DHCPPacket))
return 0;
- CMSG_FOREACH(cmsg, &msg) {
+ CMSG_FOREACH(cmsg, &msg)
if (cmsg->cmsg_level == SOL_PACKET &&
cmsg->cmsg_type == PACKET_AUXDATA &&
cmsg->cmsg_len == CMSG_LEN(sizeof(struct tpacket_auxdata))) {
@@ -1804,7 +1804,6 @@ static int client_receive_message_raw(
checksum = !(aux->tp_status & TP_STATUS_CSUMNOTREADY);
break;
}
- }
r = dhcp_packet_verify_headers(packet, len, checksum, client->port);
if (r < 0)
diff --git a/src/libsystemd/libsystemd.pc.in b/src/libsystemd/libsystemd.pc.in
index c861905b67..a010dea2e9 100644
--- a/src/libsystemd/libsystemd.pc.in
+++ b/src/libsystemd/libsystemd.pc.in
@@ -14,7 +14,7 @@ includedir=@includedir@
Name: systemd
Description: systemd Library
-URL: @PACKAGE_URL@
-Version: @PACKAGE_VERSION@
+URL: @PROJECT_URL@
+Version: @PROJECT_VERSION@
Libs: -L${libdir} -lsystemd
Cflags: -I${includedir}
diff --git a/src/libsystemd/meson.build b/src/libsystemd/meson.build
index 05d4ea0e7f..67add387e6 100644
--- a/src/libsystemd/meson.build
+++ b/src/libsystemd/meson.build
@@ -109,9 +109,8 @@ libsystemd_static = static_library(
libsystemd_sym = 'src/libsystemd/libsystemd.sym'
-libsystemd_pc = configure_file(
+configure_file(
input : 'libsystemd.pc.in',
output : 'libsystemd.pc',
- configuration : substs)
-install_data(libsystemd_pc,
- install_dir : pkgconfiglibdir)
+ configuration : substs,
+ install_dir : pkgconfiglibdir == 'no' ? '' : pkgconfiglibdir)
diff --git a/src/libsystemd/sd-device/device-private.c b/src/libsystemd/sd-device/device-private.c
index 01a5aa3d3f..36beb3e7df 100644
--- a/src/libsystemd/sd-device/device-private.c
+++ b/src/libsystemd/sd-device/device-private.c
@@ -326,15 +326,6 @@ static int device_append(sd_device *device, char *key, const char **_major, cons
action = device_action_from_string(value);
if (action == _DEVICE_ACTION_INVALID)
return -EINVAL;
- /* FIXME: remove once we no longer flush previuos state for each action */
- if (action == DEVICE_ACTION_BIND || action == DEVICE_ACTION_UNBIND) {
- static bool warned;
- if (!warned) {
- log_device_debug(device, "sd-device: ignoring actions 'bind' and 'unbind'");
- warned = true;
- }
- return -EINVAL;
- }
} else if (streq(key, "SEQNUM")) {
r = safe_atou64(value, &seqnum);
if (r < 0)
diff --git a/src/libsystemd/sd-device/sd-device.c b/src/libsystemd/sd-device/sd-device.c
index db58615df5..9b1ef44480 100644
--- a/src/libsystemd/sd-device/sd-device.c
+++ b/src/libsystemd/sd-device/sd-device.c
@@ -1002,6 +1002,9 @@ static int device_set_sysname(sd_device *device) {
const char *pos;
size_t len = 0;
+ if (!device->devpath)
+ return -EINVAL;
+
pos = strrchr(device->devpath, '/');
if (!pos)
return -EINVAL;
diff --git a/src/libsystemd/sd-device/test-sd-device-monitor.c b/src/libsystemd/sd-device/test-sd-device-monitor.c
index 9e5ca11fe9..48b49fb783 100644
--- a/src/libsystemd/sd-device/test-sd-device-monitor.c
+++ b/src/libsystemd/sd-device/test-sd-device-monitor.c
@@ -24,11 +24,43 @@ static int monitor_handler(sd_device_monitor *m, sd_device *d, void *userdata) {
return sd_event_exit(sd_device_monitor_get_event(m), 0);
}
-static int test_send_receive_one(sd_device *device, bool subsystem_filter, bool tag_filter, bool use_bpf) {
+static int test_receive_device_fail(void) {
_cleanup_(sd_device_monitor_unrefp) sd_device_monitor *monitor_server = NULL, *monitor_client = NULL;
- const char *syspath, *subsystem, *tag, *devtype = NULL;
+ _cleanup_(sd_device_unrefp) sd_device *loopback = NULL;
+ const char *syspath;
int r;
+ log_info("/* %s */", __func__);
+
+ /* Try to send device with invalid action and without seqnum. */
+ assert_se(sd_device_new_from_syspath(&loopback, "/sys/class/net/lo") >= 0);
+ assert_se(device_add_property(loopback, "ACTION", "hoge") >= 0);
+
+ assert_se(sd_device_get_syspath(loopback, &syspath) >= 0);
+
+ assert_se(device_monitor_new_full(&monitor_server, MONITOR_GROUP_NONE, -1) >= 0);
+ assert_se(sd_device_monitor_start(monitor_server, NULL, NULL) >= 0);
+ assert_se(sd_event_source_set_description(sd_device_monitor_get_event_source(monitor_server), "sender") >= 0);
+
+ assert_se(device_monitor_new_full(&monitor_client, MONITOR_GROUP_NONE, -1) >= 0);
+ assert_se(device_monitor_allow_unicast_sender(monitor_client, monitor_server) >= 0);
+ assert_se(sd_device_monitor_start(monitor_client, monitor_handler, (void *) syspath) >= 0);
+ assert_se(sd_event_source_set_description(sd_device_monitor_get_event_source(monitor_client), "receiver") >= 0);
+
+ /* Do not use assert_se() here. */
+ r = device_monitor_send_device(monitor_server, monitor_client, loopback);
+ if (r < 0)
+ return log_error_errno(r, "Failed to send loopback device: %m");
+
+ assert_se(sd_event_run(sd_device_monitor_get_event(monitor_client), 0) >= 0);
+
+ return 0;
+}
+
+static void test_send_receive_one(sd_device *device, bool subsystem_filter, bool tag_filter, bool use_bpf) {
+ _cleanup_(sd_device_monitor_unrefp) sd_device_monitor *monitor_server = NULL, *monitor_client = NULL;
+ const char *syspath, *subsystem, *tag, *devtype = NULL;
+
log_device_info(device, "/* %s(subsystem_filter=%s, tag_filter=%s, use_bpf=%s) */", __func__,
true_false(subsystem_filter), true_false(tag_filter), true_false(use_bpf));
@@ -56,14 +88,8 @@ static int test_send_receive_one(sd_device *device, bool subsystem_filter, bool
if ((subsystem_filter || tag_filter) && use_bpf)
assert_se(sd_device_monitor_filter_update(monitor_client) >= 0);
- /* Do not use assert_se() here. */
- r = device_monitor_send_device(monitor_server, monitor_client, device);
- if (r < 0)
- return log_error_errno(r, "Failed to send loopback device: %m");
-
+ assert_se(device_monitor_send_device(monitor_server, monitor_client, device) >= 0);
assert_se(sd_event_loop(sd_device_monitor_get_event(monitor_client)) == 0);
-
- return 0;
}
static void test_subsystem_filter(sd_device *device) {
@@ -111,22 +137,23 @@ int main(int argc, char *argv[]) {
if (getuid() != 0)
return log_tests_skipped("not root");
- assert_se(sd_device_new_from_syspath(&loopback, "/sys/class/net/lo") >= 0);
- assert_se(device_add_property(loopback, "ACTION", "add") >= 0);
- assert_se(device_add_property(loopback, "SEQNUM", "10") >= 0);
-
- r = test_send_receive_one(loopback, false, false, false);
+ r = test_receive_device_fail();
if (r < 0) {
assert_se(r == -EPERM && detect_container() > 0);
return log_tests_skipped("Running in container? Skipping remaining tests");
}
- assert_se(test_send_receive_one(loopback, true, false, false) >= 0);
- assert_se(test_send_receive_one(loopback, false, true, false) >= 0);
- assert_se(test_send_receive_one(loopback, true, true, false) >= 0);
- assert_se(test_send_receive_one(loopback, true, false, true) >= 0);
- assert_se(test_send_receive_one(loopback, false, true, true) >= 0);
- assert_se(test_send_receive_one(loopback, true, true, true) >= 0);
+ assert_se(sd_device_new_from_syspath(&loopback, "/sys/class/net/lo") >= 0);
+ assert_se(device_add_property(loopback, "ACTION", "add") >= 0);
+ assert_se(device_add_property(loopback, "SEQNUM", "10") >= 0);
+
+ test_send_receive_one(loopback, false, false, false);
+ test_send_receive_one(loopback, true, false, false);
+ test_send_receive_one(loopback, false, true, false);
+ test_send_receive_one(loopback, true, true, false);
+ test_send_receive_one(loopback, true, false, true);
+ test_send_receive_one(loopback, false, true, true);
+ test_send_receive_one(loopback, true, true, true);
test_subsystem_filter(loopback);
@@ -139,13 +166,13 @@ int main(int argc, char *argv[]) {
assert_se(device_add_property(sda, "ACTION", "change") >= 0);
assert_se(device_add_property(sda, "SEQNUM", "11") >= 0);
- assert_se(test_send_receive_one(sda, false, false, false) >= 0);
- assert_se(test_send_receive_one(sda, true, false, false) >= 0);
- assert_se(test_send_receive_one(sda, false, true, false) >= 0);
- assert_se(test_send_receive_one(sda, true, true, false) >= 0);
- assert_se(test_send_receive_one(sda, true, false, true) >= 0);
- assert_se(test_send_receive_one(sda, false, true, true) >= 0);
- assert_se(test_send_receive_one(sda, true, true, true) >= 0);
+ test_send_receive_one(sda, false, false, false);
+ test_send_receive_one(sda, true, false, false);
+ test_send_receive_one(sda, false, true, false);
+ test_send_receive_one(sda, true, true, false);
+ test_send_receive_one(sda, true, false, true);
+ test_send_receive_one(sda, false, true, true);
+ test_send_receive_one(sda, true, true, true);
return 0;
}
diff --git a/src/libsystemd/sd-hwdb/hwdb-util.c b/src/libsystemd/sd-hwdb/hwdb-util.c
index c5c329f2ac..f8529670b3 100644
--- a/src/libsystemd/sd-hwdb/hwdb-util.c
+++ b/src/libsystemd/sd-hwdb/hwdb-util.c
@@ -367,7 +367,7 @@ static int trie_store(struct trie *trie, const char *filename, bool compat) {
int64_t size;
struct trie_header_f h = {
.signature = HWDB_SIG,
- .tool_version = htole64(atoi(PACKAGE_VERSION)),
+ .tool_version = htole64(PROJECT_VERSION),
.header_size = htole64(sizeof(struct trie_header_f)),
.node_size = htole64(sizeof(struct trie_node_f)),
.child_entry_size = htole64(sizeof(struct trie_child_entry_f)),
diff --git a/src/libudev/libudev-util.c b/src/libudev/libudev-util.c
index f67ab40354..7e21719fbf 100644
--- a/src/libudev/libudev-util.c
+++ b/src/libudev/libudev-util.c
@@ -122,19 +122,20 @@ size_t util_path_encode(const char *src, char *dest, size_t size) {
*
* Note this may be called with 'str' == 'to', i.e. to replace whitespace
* in-place in a buffer. This function can handle that situation.
+ *
+ * Note that only 'len' characters are read from 'str'.
*/
size_t util_replace_whitespace(const char *str, char *to, size_t len) {
bool is_space = false;
- const char *p = str;
- size_t j;
+ size_t i, j;
assert(str);
assert(to);
- p += strspn(p, WHITESPACE);
+ i = strspn(str, WHITESPACE);
- for (j = 0; j < len && *p != '\0'; p++) {
- if (isspace(*p)) {
+ for (j = 0; j < len && i < len && str[i] != '\0'; i++) {
+ if (isspace(str[i])) {
is_space = true;
continue;
}
@@ -146,7 +147,7 @@ size_t util_replace_whitespace(const char *str, char *to, size_t len) {
to[j++] = '_';
is_space = false;
}
- to[j++] = *p;
+ to[j++] = str[i];
}
to[j] = '\0';
diff --git a/src/libudev/libudev.pc.in b/src/libudev/libudev.pc.in
index 69f5c6463e..40b340362e 100644
--- a/src/libudev/libudev.pc.in
+++ b/src/libudev/libudev.pc.in
@@ -14,6 +14,6 @@ includedir=@includedir@
Name: libudev
Description: Library to access udev device information
-Version: @PACKAGE_VERSION@
+Version: @PROJECT_VERSION@
Libs: -L${libdir} -ludev
Cflags: -I${includedir}
diff --git a/src/libudev/meson.build b/src/libudev/meson.build
index 8d86c34189..88189748d3 100644
--- a/src/libudev/meson.build
+++ b/src/libudev/meson.build
@@ -22,9 +22,8 @@ libudev_sym_path = meson.current_source_dir() + '/libudev.sym'
install_headers('libudev.h')
libudev_h_path = '@0@/libudev.h'.format(meson.current_source_dir())
-libudev_pc = configure_file(
+configure_file(
input : 'libudev.pc.in',
output : 'libudev.pc',
- configuration : substs)
-install_data(libudev_pc,
- install_dir : pkgconfiglibdir)
+ configuration : substs,
+ install_dir : pkgconfiglibdir == 'no' ? '' : pkgconfiglibdir)
diff --git a/src/network/networkd-dhcp4.c b/src/network/networkd-dhcp4.c
index 980d49e4ff..d8ac4552f4 100644
--- a/src/network/networkd-dhcp4.c
+++ b/src/network/networkd-dhcp4.c
@@ -690,7 +690,7 @@ int dhcp4_set_client_identifier(Link *link) {
if (duid->type == DUID_TYPE_LLT && duid->raw_data_len == 0)
r = sd_dhcp_client_set_duid_llt(link->dhcp_client,
- duid->llt_time);
+ duid->llt_time);
else
r = sd_dhcp_client_set_duid(link->dhcp_client,
duid->type,
diff --git a/src/network/networkd-link.c b/src/network/networkd-link.c
index cadf7f8b0b..5353b9daaf 100644
--- a/src/network/networkd-link.c
+++ b/src/network/networkd-link.c
@@ -787,13 +787,16 @@ void link_check_ready(Link *link) {
return;
}
-static int link_set_routing_policy_rule(Link *link) {
+static int link_request_set_routing_policy_rule(Link *link) {
RoutingPolicyRule *rule, *rrule = NULL;
int r;
assert(link);
assert(link->network);
+ link_set_state(link, LINK_STATE_CONFIGURING);
+ link->routing_policy_rules_configured = false;
+
LIST_FOREACH(rules, rule, link->network->rules) {
r = routing_policy_rule_get(link->manager, rule->family, &rule->from, rule->from_prefixlen, &rule->to,
rule->to_prefixlen, rule->tos, rule->fwmark, rule->table, rule->iif, rule->oif,
@@ -865,8 +868,11 @@ static int link_request_set_routes(Link *link) {
assert(link->state != _LINK_STATE_INVALID);
link_set_state(link, LINK_STATE_CONFIGURING);
+ link->static_routes_configured = false;
- (void) link_set_routing_policy_rule(link);
+ r = link_request_set_routing_policy_rule(link);
+ if (r < 0)
+ return r;
/* First add the routes that enable us to talk to gateways, then add in the others that need a gateway. */
for (phase = 0; phase < _PHASE_MAX; phase++)
@@ -903,6 +909,7 @@ static int link_request_set_neighbors(Link *link) {
assert(link->state != _LINK_STATE_INVALID);
link_set_state(link, LINK_STATE_CONFIGURING);
+ link->neighbors_configured = false;
LIST_FOREACH(neighbors, neighbor, link->network->neighbors) {
r = neighbor_configure(neighbor, link, NULL);
@@ -1073,13 +1080,21 @@ static int link_request_set_addresses(Link *link) {
assert(link->network);
assert(link->state != _LINK_STATE_INVALID);
+ link_set_state(link, LINK_STATE_CONFIGURING);
+
+ /* Reset all *_configured flags we are configuring. */
+ link->addresses_configured = false;
+ link->neighbors_configured = false;
+ link->static_routes_configured = false;
+ link->routing_policy_rules_configured = false;
+
r = link_set_bridge_fdb(link);
if (r < 0)
return r;
- link_set_state(link, LINK_STATE_CONFIGURING);
-
- link_request_set_neighbors(link);
+ r = link_request_set_neighbors(link);
+ if (r < 0)
+ return r;
LIST_FOREACH(addresses, ad, link->network->static_addresses) {
r = address_configure(ad, link, address_handler, false);
@@ -1216,7 +1231,7 @@ static int link_request_set_addresses(Link *link) {
return 0;
}
- }
+ }
log_link_debug(link, "Offering DHCPv4 leases");
}
diff --git a/src/sleep/sleep.conf b/src/sleep/sleep.conf
new file mode 100644
index 0000000000..dc2ed37f70
--- /dev/null
+++ b/src/sleep/sleep.conf
@@ -0,0 +1,25 @@
+# This file is part of systemd.
+#
+# systemd is free software; you can redistribute it and/or modify it
+# under the terms of the GNU Lesser General Public License as published by
+# the Free Software Foundation; either version 2.1 of the License, or
+# (at your option) any later version.
+#
+# Entries in this file show the compile time defaults.
+# You can change settings by editing this file.
+# Defaults can be restored by simply deleting this file.
+#
+# See systemd-sleep.conf(5) for details
+
+[Sleep]
+#AllowSuspend=yes
+#AllowHibernation=yes
+#AllowSuspendThenHibernate=yes
+#AllowHybridSleep=yes
+#SuspendMode=
+#SuspendState=mem standby freeze
+#HibernateMode=platform shutdown
+#HibernateState=disk
+#HybridSleepMode=suspend platform shutdown
+#HybridSleepState=disk
+#HibernateDelaySec=180min
diff --git a/src/test/test-json.c b/src/test/test-json.c
index 5aa4d19dbe..cd6269f798 100644
--- a/src/test/test-json.c
+++ b/src/test/test-json.c
@@ -1,9 +1,6 @@
/* SPDX-License-Identifier: LGPL-2.1+ */
#include <math.h>
-#if HAVE_VALGRIND_VALGRIND_H
-#include <valgrind/valgrind.h>
-#endif
#include "alloc-util.h"
#include "fd-util.h"
@@ -45,12 +42,13 @@ static void test_tokenizer(const char *data, ...) {
d = va_arg(ap, long double);
-#if HAVE_VALGRIND_VALGRIND_H
- if (!RUNNING_ON_VALGRIND)
-#endif
- /* Valgrind doesn't support long double calculations and automatically downgrades to 80bit:
- * http://www.valgrind.org/docs/manual/manual-core.html#manual-core.limits */
- assert_se(fabsl(d - v.real) < 0.001L);
+ /* Valgrind doesn't support long double calculations and automatically downgrades to 80bit:
+ * http://www.valgrind.org/docs/manual/manual-core.html#manual-core.limits.
+ * Some architectures might not support long double either.
+ */
+
+ assert_se(fabsl(d - v.real) < 1e-10 ||
+ fabsl((d - v.real) / v.real) < 1e-10);
} else if (t == JSON_TOKEN_INTEGER) {
intmax_t i;
diff --git a/src/test/test-libudev.c b/src/test/test-libudev.c
index 10bf365035..15c0f8853d 100644
--- a/src/test/test-libudev.c
+++ b/src/test/test-libudev.c
@@ -7,6 +7,7 @@
#include <unistd.h>
#include "alloc-util.h"
+#include "build.h"
#include "fd-util.h"
#include "libudev-list-internal.h"
#include "libudev-util.h"
@@ -364,16 +365,23 @@ static void test_util_replace_whitespace(void) {
test_util_replace_whitespace_one_len("hoge hoge ", 1, "h");
test_util_replace_whitespace_one_len("hoge hoge ", 0, "");
- test_util_replace_whitespace_one_len(" hoge hoge ", 9, "hoge_hoge");
- test_util_replace_whitespace_one_len(" hoge hoge ", 8, "hoge_hog");
- test_util_replace_whitespace_one_len(" hoge hoge ", 7, "hoge_ho");
- test_util_replace_whitespace_one_len(" hoge hoge ", 6, "hoge_h");
- test_util_replace_whitespace_one_len(" hoge hoge ", 5, "hoge");
- test_util_replace_whitespace_one_len(" hoge hoge ", 4, "hoge");
- test_util_replace_whitespace_one_len(" hoge hoge ", 3, "hog");
- test_util_replace_whitespace_one_len(" hoge hoge ", 2, "ho");
- test_util_replace_whitespace_one_len(" hoge hoge ", 1, "h");
- test_util_replace_whitespace_one_len(" hoge hoge ", 0, "");
+ test_util_replace_whitespace_one_len(" hoge hoge ", 16, "hoge_hoge");
+ test_util_replace_whitespace_one_len(" hoge hoge ", 15, "hoge_hoge");
+ test_util_replace_whitespace_one_len(" hoge hoge ", 14, "hoge_hog");
+ test_util_replace_whitespace_one_len(" hoge hoge ", 13, "hoge_ho");
+ test_util_replace_whitespace_one_len(" hoge hoge ", 12, "hoge_h");
+ test_util_replace_whitespace_one_len(" hoge hoge ", 11, "hoge");
+ test_util_replace_whitespace_one_len(" hoge hoge ", 10, "hoge");
+ test_util_replace_whitespace_one_len(" hoge hoge ", 9, "hoge");
+ test_util_replace_whitespace_one_len(" hoge hoge ", 8, "hoge");
+ test_util_replace_whitespace_one_len(" hoge hoge ", 7, "hog");
+ test_util_replace_whitespace_one_len(" hoge hoge ", 6, "ho");
+ test_util_replace_whitespace_one_len(" hoge hoge ", 5, "h");
+ test_util_replace_whitespace_one_len(" hoge hoge ", 4, "");
+ test_util_replace_whitespace_one_len(" hoge hoge ", 3, "");
+ test_util_replace_whitespace_one_len(" hoge hoge ", 2, "");
+ test_util_replace_whitespace_one_len(" hoge hoge ", 1, "");
+ test_util_replace_whitespace_one_len(" hoge hoge ", 0, "");
}
static void test_util_resolve_subsys_kernel_one(const char *str, bool read_value, int retval, const char *expected) {
@@ -507,7 +515,7 @@ int main(int argc, char *argv[]) {
return EXIT_SUCCESS;
case 'V':
- printf("%s\n", PACKAGE_VERSION);
+ printf("%s\n", GIT_VERSION);
return EXIT_SUCCESS;
case 'm':
diff --git a/src/test/test-path-util.c b/src/test/test-path-util.c
index 8854a94f6c..c64ca7b016 100644
--- a/src/test/test-path-util.c
+++ b/src/test/test-path-util.c
@@ -531,7 +531,7 @@ static void test_hidden_or_backup_file(void) {
static void test_systemd_installation_has_version(const char *path) {
int r;
- const unsigned versions[] = {0, 231, atoi(PACKAGE_VERSION), 999};
+ const unsigned versions[] = {0, 231, PROJECT_VERSION, 999};
unsigned i;
for (i = 0; i < ELEMENTSOF(versions); i++) {
diff --git a/src/test/test-udev.c b/src/test/test-udev.c
index 7a4622b875..ab31f5a2f1 100644
--- a/src/test/test-udev.c
+++ b/src/test/test-udev.c
@@ -11,6 +11,7 @@
#include <sys/signalfd.h>
#include <unistd.h>
+#include "build.h"
#include "device-private.h"
#include "fs-util.h"
#include "log.h"
@@ -81,7 +82,7 @@ static int run(int argc, char *argv[]) {
return 0;
}
- log_debug("version %s", PACKAGE_VERSION);
+ log_debug("version %s", GIT_VERSION);
mac_selinux_init();
action = argv[1];
diff --git a/src/udev/meson.build b/src/udev/meson.build
index e378d9190c..a9d6c6363f 100644
--- a/src/udev/meson.build
+++ b/src/udev/meson.build
@@ -187,12 +187,11 @@ endforeach
install_data('udev.conf',
install_dir : join_paths(sysconfdir, 'udev'))
-udev_pc = configure_file(
+configure_file(
input : 'udev.pc.in',
output : 'udev.pc',
- configuration : substs)
-install_data(udev_pc,
- install_dir : pkgconfigdatadir)
+ configuration : substs,
+ install_dir : pkgconfigdatadir == 'no' ? '' : pkgconfigdatadir)
meson.add_install_script('sh', '-c',
mkdir_p.format(join_paths(sysconfdir, 'udev/rules.d')))
diff --git a/src/udev/scsi_id/scsi_id.c b/src/udev/scsi_id/scsi_id.c
index e94f2946f9..2698cdd82f 100644
--- a/src/udev/scsi_id/scsi_id.c
+++ b/src/udev/scsi_id/scsi_id.c
@@ -18,6 +18,7 @@
#include <unistd.h>
#include "alloc-util.h"
+#include "build.h"
#include "fd-util.h"
#include "libudev-util.h"
#include "scsi_id.h"
@@ -370,7 +371,7 @@ static int set_options(int argc, char **argv,
break;
case 'V':
- printf("%s\n", PACKAGE_VERSION);
+ printf("%s\n", GIT_VERSION);
exit(EXIT_SUCCESS);
case 'x':
diff --git a/src/udev/udev-ctrl.c b/src/udev/udev-ctrl.c
index d90ebb7259..cb36c7e537 100644
--- a/src/udev/udev-ctrl.c
+++ b/src/udev/udev-ctrl.c
@@ -214,13 +214,11 @@ static struct udev_ctrl_connection *udev_ctrl_connection_free(struct udev_ctrl_c
DEFINE_TRIVIAL_REF_UNREF_FUNC(struct udev_ctrl_connection, udev_ctrl_connection, udev_ctrl_connection_free);
static int ctrl_send(struct udev_ctrl *uctrl, enum udev_ctrl_msg_type type, int intval, const char *buf, int timeout) {
- struct udev_ctrl_msg_wire ctrl_msg_wire;
- int err = 0;
-
- memzero(&ctrl_msg_wire, sizeof(struct udev_ctrl_msg_wire));
- strcpy(ctrl_msg_wire.version, "udev-" PACKAGE_VERSION);
- ctrl_msg_wire.magic = UDEV_CTRL_MAGIC;
- ctrl_msg_wire.type = type;
+ struct udev_ctrl_msg_wire ctrl_msg_wire = {
+ .version = "udev-" STRINGIFY(PROJECT_VERSION),
+ .magic = UDEV_CTRL_MAGIC,
+ .type = type,
+ };
if (buf)
strscpy(ctrl_msg_wire.buf, sizeof(ctrl_msg_wire.buf), buf);
@@ -228,43 +226,33 @@ static int ctrl_send(struct udev_ctrl *uctrl, enum udev_ctrl_msg_type type, int
ctrl_msg_wire.intval = intval;
if (!uctrl->connected) {
- if (connect(uctrl->sock, &uctrl->saddr.sa, uctrl->addrlen) < 0) {
- err = -errno;
- goto out;
- }
+ if (connect(uctrl->sock, &uctrl->saddr.sa, uctrl->addrlen) < 0)
+ return -errno;
uctrl->connected = true;
}
- if (send(uctrl->sock, &ctrl_msg_wire, sizeof(ctrl_msg_wire), 0) < 0) {
- err = -errno;
- goto out;
- }
+ if (send(uctrl->sock, &ctrl_msg_wire, sizeof(ctrl_msg_wire), 0) < 0)
+ return -errno;
/* wait for peer message handling or disconnect */
for (;;) {
- struct pollfd pfd[1];
+ struct pollfd pfd = {
+ .fd = uctrl->sock,
+ .events = POLLIN,
+ };
int r;
- pfd[0].fd = uctrl->sock;
- pfd[0].events = POLLIN;
- r = poll(pfd, 1, timeout * MSEC_PER_SEC);
+ r = poll(&pfd, 1, timeout * MSEC_PER_SEC);
if (r < 0) {
if (errno == EINTR)
continue;
- err = -errno;
- break;
- }
-
- if (r > 0 && pfd[0].revents & POLLERR) {
- err = -EIO;
- break;
+ return -errno;
}
-
if (r == 0)
- err = -ETIMEDOUT;
- break;
+ return -ETIMEDOUT;
+ if (pfd.revents & POLLERR)
+ return -EIO;
+ return 0;
}
-out:
- return err;
}
int udev_ctrl_send_set_log_level(struct udev_ctrl *uctrl, int priority, int timeout) {
diff --git a/src/udev/udev.pc.in b/src/udev/udev.pc.in
index e384a6f7c9..5acbb2d01a 100644
--- a/src/udev/udev.pc.in
+++ b/src/udev/udev.pc.in
@@ -1,5 +1,5 @@
Name: udev
Description: udev
-Version: @PACKAGE_VERSION@
+Version: @PROJECT_VERSION@
udevdir=@udevlibexecdir@
diff --git a/src/udev/udevadm.h b/src/udev/udevadm.h
index 98f9019a48..86b24af086 100644
--- a/src/udev/udevadm.h
+++ b/src/udev/udevadm.h
@@ -3,6 +3,9 @@
#include <stdio.h>
+#include "build.h"
+#include "macro.h"
+
int info_main(int argc, char *argv[], void *userdata);
int trigger_main(int argc, char *argv[], void *userdata);
int settle_main(int argc, char *argv[], void *userdata);
@@ -13,6 +16,7 @@ int test_main(int argc, char *argv[], void *userdata);
int builtin_main(int argc, char *argv[], void *userdata);
static inline int print_version(void) {
- puts(PACKAGE_VERSION);
+ /* Dracut relies on the version being a single integer */
+ puts(STRINGIFY(PROJECT_VERSION));
return 0;
}
diff --git a/src/udev/udevd.c b/src/udev/udevd.c
index fb8724ea87..005ae0cd7f 100644
--- a/src/udev/udevd.c
+++ b/src/udev/udevd.c
@@ -31,6 +31,7 @@
#include "sd-event.h"
#include "alloc-util.h"
+#include "build.h"
#include "cgroup-util.h"
#include "cpu-set-util.h"
#include "dev-setup.h"
@@ -534,7 +535,7 @@ static int worker_spawn(Manager *manager, struct event *event) {
if (r < 0)
return log_error_errno(r, "Worker: Failed to enable receiving of device: %m");
- r = safe_fork("(worker)", FORK_DEATHSIG, &pid);
+ r = safe_fork(NULL, FORK_DEATHSIG, &pid);
if (r < 0) {
event->state = EVENT_QUEUED;
return log_error_errno(r, "Failed to fork() worker: %m");
@@ -1579,7 +1580,7 @@ static int parse_argv(int argc, char *argv[]) {
case 'h':
return help();
case 'V':
- printf("%s\n", PACKAGE_VERSION);
+ printf("%s\n", GIT_VERSION);
return 0;
case '?':
return -EINVAL;
@@ -1834,7 +1835,7 @@ static int run(int argc, char *argv[]) {
if (arg_daemonize) {
pid_t pid;
- log_info("starting version " PACKAGE_VERSION);
+ log_info("starting version " GIT_VERSION);
/* connect /dev/null to stdin, stdout, stderr */
if (log_get_max_level() < LOG_DEBUG) {
diff --git a/test/TEST-19-DELEGATE/testsuite.sh b/test/TEST-19-DELEGATE/testsuite.sh
index abfcee3cd2..fdfab950b1 100755
--- a/test/TEST-19-DELEGATE/testsuite.sh
+++ b/test/TEST-19-DELEGATE/testsuite.sh
@@ -33,7 +33,7 @@ if grep -q cgroup2 /proc/filesystems ; then
# And now check again, "io" should have vanished
grep -qv io /sys/fs/cgroup/system.slice/cgroup.controllers
else
- echo "Skipping TEST-19-DELEGATE, as the kernel doesn't actually support cgroupsv2" >&2
+ echo "Skipping TEST-19-DELEGATE, as the kernel doesn't actually support cgroup v2" >&2
fi
echo OK > /testok
diff --git a/test/test-network/systemd-networkd-tests.py b/test/test-network/systemd-networkd-tests.py
index 19572be151..5586767f46 100755
--- a/test/test-network/systemd-networkd-tests.py
+++ b/test/test-network/systemd-networkd-tests.py
@@ -20,7 +20,6 @@ networkd_ci_path='/run/networkd-ci'
network_sysctl_ipv6_path='/proc/sys/net/ipv6/conf'
network_sysctl_ipv4_path='/proc/sys/net/ipv4/conf'
-dnsmasq_config_file='/run/networkd-ci/test-dnsmasq.conf'
dnsmasq_pid_file='/run/networkd-ci/test-test-dnsmasq.pid'
dnsmasq_log_file='/run/networkd-ci/test-dnsmasq-log-file'
@@ -101,7 +100,7 @@ class Utilities():
shutil.rmtree(os.path.join(network_unit_file_path, unit + '.d'))
def start_dnsmasq(self):
- subprocess.check_call('dnsmasq -8 /var/run/networkd-ci/test-dnsmasq-log-file --log-queries=extra --log-dhcp --pid-file=/var/run/networkd-ci/test-test-dnsmasq.pid --conf-file=/dev/null --interface=veth-peer --enable-ra --dhcp-range=2600::10,2600::20 --dhcp-range=192.168.5.10,192.168.5.200 -R --dhcp-leasefile=/var/run/networkd-ci/lease --dhcp-option=26,1492 --dhcp-option=option:router,192.168.5.1 --dhcp-option=33,192.168.5.4,192.168.5.5', shell=True)
+ subprocess.check_call('dnsmasq -8 /var/run/networkd-ci/test-dnsmasq-log-file --log-queries=extra --log-dhcp --pid-file=/var/run/networkd-ci/test-test-dnsmasq.pid --conf-file=/dev/null --interface=veth-peer --enable-ra --dhcp-range=2600::10,2600::20 --dhcp-range=192.168.5.10,192.168.5.200 -R --dhcp-leasefile=/var/run/networkd-ci/lease --dhcp-option=26,1492 --dhcp-option=option:router,192.168.5.1 --dhcp-option=33,192.168.5.4,192.168.5.5 --port=0', shell=True)
time.sleep(10)
@@ -795,7 +794,7 @@ class NetworkdNetWorkTests(unittest.TestCase, Utilities):
output = subprocess.check_output(['ip', 'neigh', 'list']).rstrip().decode('utf-8')
print(output)
self.assertRegex(output, '192.168.10.1.*00:00:5e:00:02:65.*PERMANENT')
- self.assertRegex(output, '2004:da8:1:0::1.*00:00:5e:00:02:66.*PERMANENT')
+ self.assertRegex(output, '2004:da8:1::1.*00:00:5e:00:02:66.*PERMANENT')
def test_sysctl(self):
self.copy_unit_to_networkd_unit_path('25-sysctl.network', '12-dummy.netdev')
diff --git a/tools/meson-vcs-tag.sh b/tools/meson-vcs-tag.sh
new file mode 100755
index 0000000000..c8033d00a1
--- /dev/null
+++ b/tools/meson-vcs-tag.sh
@@ -0,0 +1,18 @@
+#!/bin/bash
+
+set -eu
+set -o pipefail
+
+dir="$1"
+tag="$2"
+fallback="$3"
+
+if [ -n "$tag" ]; then
+ echo "$tag"
+ exit 0
+fi
+
+# Apparently git describe has a bug where it always considers the work-tree
+# dirty when invoked with --git-dir (even though 'git status' is happy). Work
+# around this issue by cd-ing to the source directory.
+cd "$dir" && git describe --abbrev=7 --dirty=+ 2>/dev/null | sed 's/^v//' || echo "$fallback"