]> git.ipfire.org Git - thirdparty/systemd.git/log
thirdparty/systemd.git
5 years agoloop-util: LOOP_CONFIGURE ignores lo_sizelimit 16676/head
Lennart Poettering [Mon, 24 Aug 2020 16:11:06 +0000 (18:11 +0200)] 
loop-util: LOOP_CONFIGURE ignores lo_sizelimit

It appears LOOP_CONFIGURE in 5.8 is even more broken than initially
thought: it doesn't properly propgate lo_sizelimit to the block device
layer. :-(

Let's hence check the block device size immediately after issuing
LOOP_CONFIGURE, and if it doesn't match what we just set let's fallback
to the old ioctls.

This means LOOP_CONFIGURE currently works correctly only for the most
simply case: no partition table logic and no size limit. Sad!

(Kernel people should really be told about the concepts of tests and
even CI, one day!)

5 years agoupdate TODO
Lennart Poettering [Tue, 4 Aug 2020 06:56:54 +0000 (08:56 +0200)] 
update TODO

5 years agoman: document new repart features
Lennart Poettering [Wed, 5 Aug 2020 15:53:39 +0000 (17:53 +0200)] 
man: document new repart features

5 years agotest: add test for new repart features
Lennart Poettering [Wed, 5 Aug 2020 16:52:12 +0000 (18:52 +0200)] 
test: add test for new repart features

5 years agorepart: if --size= is specified as "auto" determine minimal size for disk image
Lennart Poettering [Wed, 5 Aug 2020 14:59:27 +0000 (16:59 +0200)] 
repart: if --size= is specified as "auto" determine minimal size for disk image

When assembling a disk image locally, using --size=auto can be used to
generate the minimal image based on the provided definitions. THis is
useful to prepare images that are grown on first boot.

5 years agorepart: add support for optionally encrypting partitions we create
Lennart Poettering [Tue, 4 Aug 2020 06:57:29 +0000 (08:57 +0200)] 
repart: add support for optionally encrypting partitions we create

5 years agorepart: add new CopyFiles= setting, for copying files into freshly made file systems
Lennart Poettering [Mon, 3 Aug 2020 10:34:40 +0000 (12:34 +0200)] 
repart: add new CopyFiles= setting, for copying files into freshly made file systems

This makes the tool a lot more useful for streaming OS images onto
disks.

5 years agodissect: create directories we want to mount on
Lennart Poettering [Mon, 3 Aug 2020 10:30:42 +0000 (12:30 +0200)] 
dissect: create directories we want to mount on

This matches how we handle things everywhere else, i.e. in .mount units,
and similar: when a mount point dir is missing, we create it, let's do
so too when dealing with disk images.

This makes things a lot simpler, more robust, and systematic.

5 years agorepart: wipe partition first, then discard
Lennart Poettering [Thu, 30 Jul 2020 20:22:21 +0000 (22:22 +0200)] 
repart: wipe partition first, then discard

Wiping means writing zero sectors to disk. Hence it's better to do this
before we discard, so that the zeroes we use to overwrite are properly
discarded. If we'd do it the other way round we'd discard the data and
then reallocte it just to write zeroes.

5 years agorepart: talk about future partitions
Lennart Poettering [Thu, 30 Jul 2020 16:47:04 +0000 (18:47 +0200)] 
repart: talk about future partitions

We initialize the partition contents before the partitions actually
exist, hence to reduce confusion let's talk about "future partitions" up
to the point where they are actually realized.

5 years agorepart: let's wipe the partition table ourselves
Lennart Poettering [Thu, 30 Jul 2020 16:46:42 +0000 (18:46 +0200)] 
repart: let's wipe the partition table ourselves

Let's issue the wiping ourselves, so that we know it's done before we
write partition data onto the disk, and before the disk label
is written. Before this commit the writing of the disk label would imply
the wiping step, potentially overriding again what we just wrote into
the disk data section.

(Normally this shouldn't matter, since the partition table metadata
that the wiping process deletes is at the start and end of the disk
while we write our data to the middle, but you never know what kind of
weird signatures might exist that depart from that.)

(And effectively this ends up using the same wiping code, since that's
implemented in libblkkid, and libfdisk just acts as frontend to that
anyway. We now simply call it directly.)

5 years agorepart: split out code that mangles part table entries into function of its own
Lennart Poettering [Thu, 30 Jul 2020 14:35:15 +0000 (16:35 +0200)] 
repart: split out code that mangles part table entries into function of its own

Just some refactoring, no actual code change.

5 years agomkfs-util: add support for making vfat partitions
Lennart Poettering [Thu, 30 Jul 2020 20:29:48 +0000 (22:29 +0200)] 
mkfs-util: add support for making vfat partitions

fat is a bit more limited in volume name length and UUID support. Let's
add some special support for it.

This is particularly useful to generate EFI system partitions.

5 years agorepart: add support for formatting newly created partitions
Lennart Poettering [Thu, 30 Jul 2020 08:09:57 +0000 (10:09 +0200)] 
repart: add support for formatting newly created partitions

5 years agorepart: make error code when operating on non-existing file a bit more useful
Lennart Poettering [Tue, 4 Aug 2020 13:54:25 +0000 (15:54 +0200)] 
repart: make error code when operating on non-existing file a bit more useful

5 years agomakefs: port to generic make_filesystem() call
Lennart Poettering [Wed, 29 Jul 2020 17:10:33 +0000 (19:10 +0200)] 
makefs: port to generic make_filesystem() call

5 years agoshared: introduce mkfs-util.c/.h
Lennart Poettering [Wed, 29 Jul 2020 16:36:26 +0000 (18:36 +0200)] 
shared: introduce mkfs-util.c/.h

Let's move the "mkfs" code from homed there, plus other related code.

This way we can easily reuse it from other places.

5 years agoloop-util: define API for syncing loopback device
Lennart Poettering [Thu, 30 Jul 2020 16:48:52 +0000 (18:48 +0200)] 
loop-util: define API for syncing loopback device

5 years agomkdir: add new mkdir_p_root() helper
Lennart Poettering [Mon, 3 Aug 2020 10:05:37 +0000 (12:05 +0200)] 
mkdir: add new mkdir_p_root() helper

5 years agorepart: don't unload data we configured explicitly, and fully free all data we match...
Lennart Poettering [Tue, 11 Aug 2020 12:50:36 +0000 (14:50 +0200)] 
repart: don't unload data we configured explicitly, and fully free all data we match to disk

The context_unload_partition_table() call is supposed to remove all
data from the loaded partitions about how we mapped it to existing
partitions on disk, but it should leave everything we parsed from the
definition files in place.

We mostly got this right, except for two cases:

1. new_uuid is parsed from the definition files and should stay

2. current_label is read from the existing partition table and should be
   freed

5 years agoman: drop reference to long gone .busname unit type
Lennart Poettering [Mon, 24 Aug 2020 17:41:09 +0000 (19:41 +0200)] 
man: drop reference to long gone .busname unit type

Seems we missed one occurence.

5 years agoman: fix a fix of a typo in systemd.service example
Jan Chren [Mon, 24 Aug 2020 14:40:11 +0000 (16:40 +0200)] 
man: fix a fix of a typo in systemd.service example

The fix from cb263973acf83de22a86f08fe502a9cbd6c01d2b was made the other way around,
i.e. `SIGKILL` was changed to `SIGUSR1`, but the sentence is about a "termination signal", i.e. `SIGKILL`, not `SIGUSR1`.

5 years agoMerge pull request #16815 from weblate/weblate-systemd-master
Zbigniew Jędrzejewski-Szmek [Mon, 24 Aug 2020 14:21:12 +0000 (16:21 +0200)] 
Merge pull request #16815 from weblate/weblate-systemd-master

Translations update from Weblate

5 years agonetwork: can: Fix CAN initialization
Clemens Gruber [Fri, 21 Aug 2020 14:03:23 +0000 (16:03 +0200)] 
network: can: Fix CAN initialization

When introducing CAN-FD support, the .can_fd_mode was not initalized
with -1 and due to cm.mask containing the CAN_CTRLMODE_FD bit, it was
not ignored when FDMode was not configured but instead disabled.
The same thing happened when listen-only mode support was introduced.

On chips that do not support these features, this lead to an error:
can0: Failed to configure CAN link: Operation not supported

Fix it by intializing all the CAN related tristate variables
(.can_listen_only, .can_fd_mode and .can_non_iso) to -1.

5 years agoMerge pull request #16817 from keszybz/update-bus-api-docs
Zbigniew Jędrzejewski-Szmek [Mon, 24 Aug 2020 07:31:31 +0000 (09:31 +0200)] 
Merge pull request #16817 from keszybz/update-bus-api-docs

Update bus api docs

5 years agoTranslated using Weblate (Turkish) 16815/head
Oğuz Ersen [Mon, 24 Aug 2020 07:29:20 +0000 (09:29 +0200)] 
Translated using Weblate (Turkish)

Currently translated at 100.0% (133 of 133 strings)

Co-authored-by: Oğuz Ersen <oguzersen@protonmail.com>
Translate-URL: https://translate.fedoraproject.org/projects/systemd/master/tr/
Translation: systemd/master

5 years agoTranslated using Weblate (Spanish)
Adolfo Jayme Barrientos [Mon, 24 Aug 2020 07:29:19 +0000 (09:29 +0200)] 
Translated using Weblate (Spanish)

Currently translated at 100.0% (113 of 113 strings)

Co-authored-by: Adolfo Jayme Barrientos <fitoschido@gmail.com>
Translate-URL: https://translate.fedoraproject.org/projects/systemd/master/es/
Translation: systemd/master

5 years agoUpdate translation files
Weblate [Mon, 24 Aug 2020 07:29:19 +0000 (09:29 +0200)] 
Update translation files

Updated by "Update PO files to match POT (msgmerge)" hook in Weblate.

Co-authored-by: Weblate <noreply@weblate.org>
Translate-URL: https://translate.fedoraproject.org/projects/systemd/master/
Translation: systemd/master

5 years agodocs: add man/update-dbus-docs step to release instructions 16817/head
Zbigniew Jędrzejewski-Szmek [Sat, 22 Aug 2020 10:28:15 +0000 (12:28 +0200)] 
docs: add man/update-dbus-docs step to release instructions

5 years agoman: add RootImageOptions and associated bits to dbus api docs
Zbigniew Jędrzejewski-Szmek [Sat, 22 Aug 2020 10:39:01 +0000 (12:39 +0200)] 
man: add RootImageOptions and associated bits to dbus api docs

Relevant commits:
b3d133148ea802e44ec913b2766c811ac2316f9a,
18d73705874f9bf0643485714e9dc069a2e9b599.

5 years agoman: update autogenerated dbus api lists
Zbigniew Jędrzejewski-Szmek [Sat, 22 Aug 2020 10:25:44 +0000 (12:25 +0200)] 
man: update autogenerated dbus api lists

We forgot to do this before the release :(
Relavant commits are:
4e11ddfdd3c1f93721b8ca534e33e16ced32ff06,
0bb007f7a23c41e23481373ded47ee3ddcf8f26b,
a3d19f5d99c44940831a33df8b5bece4aaf749f7,
bf760801804e55b045aed54bf9b1d0b0131be3f2,
4793c31083031e729e6eb17b87b540a3944bba3b.

Suitable for backporting.

5 years agoman: import lxml formatting changes
Zbigniew Jędrzejewski-Szmek [Sat, 22 Aug 2020 10:24:32 +0000 (12:24 +0200)] 
man: import lxml formatting changes

lxml insists on this, see 4fb222c4b29ec2a1a451a1e0e99c5d3c520395ab.

5 years agodocs: fix gpt-auto-generator manpage link
Ronan Pigott [Fri, 21 Aug 2020 19:12:33 +0000 (12:12 -0700)] 
docs: fix gpt-auto-generator manpage link

5 years agoMerge pull request #16808 from yuwata/test-network-reconfigure-routing-policy-rules
Zbigniew Jędrzejewski-Szmek [Fri, 21 Aug 2020 12:20:52 +0000 (14:20 +0200)] 
Merge pull request #16808 from yuwata/test-network-reconfigure-routing-policy-rules

add a test case for [RoutingPolicyRule] and fix minor issue in man page

5 years agoMerge pull request #16789 from keszybz/weblate
Zbigniew Jędrzejewski-Szmek [Fri, 21 Aug 2020 12:18:31 +0000 (14:18 +0200)] 
Merge pull request #16789 from keszybz/weblate

Import the .pot file into version control for weblate

5 years agoMerge pull request #16804 from keszybz/conditionals-and-spelling-fixes
Lennart Poettering [Fri, 21 Aug 2020 11:36:30 +0000 (13:36 +0200)] 
Merge pull request #16804 from keszybz/conditionals-and-spelling-fixes

Conditionals and spelling fixes

5 years agoRequest seccomp logging if SYSTEMD_LOG_SECCOMP environment variable is set.
Steve Dodd [Sun, 16 Aug 2020 20:57:41 +0000 (21:57 +0100)] 
Request seccomp logging if SYSTEMD_LOG_SECCOMP environment variable is set.

5 years agoMerge pull request #16686 from bluca/mount_images_opts
Zbigniew Jędrzejewski-Szmek [Fri, 21 Aug 2020 08:11:08 +0000 (10:11 +0200)] 
Merge pull request #16686 from bluca/mount_images_opts

core: add mount options support for MountImages

5 years agoseccomp: add support for riscv64
Aurelien Jarno [Wed, 19 Aug 2020 20:44:15 +0000 (22:44 +0200)] 
seccomp: add support for riscv64

This patch adds seccomp support to the riscv64 architecture. seccomp
support is available in the riscv64 kernel since version 5.5, and it
has just been added to the libseccomp library.

riscv64 uses generic syscalls like aarch64, so I used that architecture
as a reference to find which code has to be modified.

With this patch, the testsuite passes successfully, including the
test-seccomp test. The system boots and works fine with kernel 5.4 (i.e.
without seccomp support) and kernel 5.5 (i.e. with seccomp support). I
have also verified that the "SystemCallFilter=~socket" option prevents a
service to use the ping utility when running on kernel 5.5.

5 years agoman: fix invalid tag place 16808/head
Yu Watanabe [Fri, 21 Aug 2020 06:30:05 +0000 (15:30 +0900)] 
man: fix invalid tag place

5 years agotest-network: add a test case for reconfiguring routing policy rules
Yu Watanabe [Fri, 21 Aug 2020 06:27:35 +0000 (15:27 +0900)] 
test-network: add a test case for reconfiguring routing policy rules

C.f. #16784.

5 years agoMerge pull request #16803 from poettering/analyze-condition-rework
Zbigniew Jędrzejewski-Szmek [Thu, 20 Aug 2020 16:18:13 +0000 (18:18 +0200)] 
Merge pull request #16803 from poettering/analyze-condition-rework

support missing conditions/asserts everywhere

5 years agomount-util: tweak how we find inaccessible device nodes
Lennart Poettering [Wed, 19 Aug 2020 15:25:33 +0000 (17:25 +0200)] 
mount-util: tweak how we find inaccessible device nodes

On new kernels (>= 5.8) unprivileged users may create the 0:0 character
device node. Which is great, as we can use that as inaccessible device
nodes if we run unprivileged. Hence, change how we find the right
inaccessible device inodes: when the user asks for a block device node,
but we have none, try the char device node first. If that doesn't exist,
fall back to the socket node as before.

This means that:

1. in the best case we'll return a node if the right device node type
2. otherwise we hopefully at least can return a device node if one asked
   for even if the type doesn't match (i.e. we return char instead of
   the requested block device node)
3. in the worst case (old kernels…) we'll return a socket node

5 years agotree-wide: fix spelling of "fallback" 16804/head
Zbigniew Jędrzejewski-Szmek [Thu, 20 Aug 2020 09:23:26 +0000 (11:23 +0200)] 
tree-wide: fix spelling of "fallback"

Similarly to "setup" vs. "set up", "fallback" is a noun, and "fall back"
is the verb. (This is pretty clear when we construct a sentence in the
present continous: "we are falling back" not "we are fallbacking").

5 years agoman: add conditionals to more man pages
Zbigniew Jędrzejewski-Szmek [Thu, 20 Aug 2020 15:41:19 +0000 (17:41 +0200)] 
man: add conditionals to more man pages

Fixes #16701.

5 years agomeson: add ENABLE_ANALYZE conditional
Zbigniew Jędrzejewski-Szmek [Thu, 20 Aug 2020 15:35:50 +0000 (17:35 +0200)] 
meson: add ENABLE_ANALYZE conditional

5 years agomeson: fix build/man/{man,html} to support page redirects
Zbigniew Jędrzejewski-Szmek [Fri, 7 Aug 2020 16:42:22 +0000 (18:42 +0200)] 
meson: fix build/man/{man,html} to support page redirects

Commands like build/man/man journald.conf.d would show the installed
man page (or an error if the page cannot be found in the global search
path), and not the one in the build directory. If the man page is
a redirect, or the .html is a symlink, resolve it, build the target,
and show that.

5 years agotest-string-util: add a test for strjoin()
Zbigniew Jędrzejewski-Szmek [Thu, 20 Aug 2020 11:37:31 +0000 (13:37 +0200)] 
test-string-util: add a test for strjoin()

Strangely, we didn't have one so far. I mostly wanted to verify
that NULL can be used in any spot at behaves the same as "".

5 years agotest-acl-util: output more debug info
Zbigniew Jędrzejewski-Szmek [Fri, 7 Aug 2020 16:54:37 +0000 (18:54 +0200)] 
test-acl-util: output more debug info

For some reason this failed in koji build on s390x:
--- command ---
16:12:46 PATH='/builddir/build/BUILD/systemd-stable-246.1/s390x-redhat-linux-gnu:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/sbin' SYSTEMD_LANGUAGE_FALLBACK_MAP='/builddir/build/BUILD/systemd-stable-246.1/src/locale/language-fallback-map' SYSTEMD_KBD_MODEL_MAP='/builddir/build/BUILD/systemd-stable-246.1/src/locale/kbd-model-map' /builddir/build/BUILD/systemd-stable-246.1/s390x-redhat-linux-gnu/test-acl-util
--- stdout ---
-rw-r-----. 1 mockbuild mock 0 Aug  7 16:12 /tmp/test-empty.7RzmEc
other::---
--- stderr ---
Assertion 'r >= 0' failed at src/test/test-acl-util.c:42, function test_add_acls_for_user(). Aborting.

5 years agoMerge pull request #16543 from poettering/nspawn-run-host
Lennart Poettering [Thu, 20 Aug 2020 14:20:05 +0000 (16:20 +0200)] 
Merge pull request #16543 from poettering/nspawn-run-host

nspawn: /run/host/ tweaks

5 years agocore: add mount options support for MountImages 16686/head
Luca Boccassi [Fri, 31 Jul 2020 14:06:15 +0000 (15:06 +0100)] 
core: add mount options support for MountImages

Follow the same model established for RootImage and RootImageOptions,
and allow to either append a single list of options or tuples of
partition_number:options.

5 years agocore: change RootImageOptions to use names instead of partition numbers
Luca Boccassi [Fri, 14 Aug 2020 17:50:46 +0000 (18:50 +0100)] 
core: change RootImageOptions to use names instead of partition numbers

Follow the designations from the Discoverable Partitions Specification

5 years agocore: use strv_split_colon_pairs when parsing RootImageOptions
Luca Boccassi [Thu, 6 Aug 2020 18:43:22 +0000 (19:43 +0100)] 
core: use strv_split_colon_pairs when parsing RootImageOptions

5 years agocore: cleanup unused variables
Luca Boccassi [Thu, 6 Aug 2020 18:06:22 +0000 (19:06 +0100)] 
core: cleanup unused variables

Leftovers from previous implementation of MountImages feature, unused now

5 years agosd-bus: fix error handling on readv()
Lennart Poettering [Thu, 20 Aug 2020 10:59:23 +0000 (12:59 +0200)] 
sd-bus: fix error handling on readv()

let's make sure we collect the right error code from errno, otherwise
we'll see EPERM (i.e. error 1) for all errors readv() returns (since it
returns -1 on error), including EAGAIN.

This is definitely backport material.

A fix-up for 3691bcf3c5eebdcca5b4f1c51c745441c57a6cd1.

Fixes: #16699
5 years agocore: remove support for ConditionNull= 16803/head
Lennart Poettering [Thu, 20 Aug 2020 12:01:25 +0000 (14:01 +0200)] 
core: remove support for ConditionNull=

The concept is flawed, and mostly useless. Let's finally remove it.

It has been deprecated since 90a2ec10f2d43a8530aae856013518eb567c4039 (6
years ago) and we started to warn since
55dadc5c57ef1379dbc984938d124508a454be55 (1.5 years ago).

Let's get rid of it altogether.

5 years agocore: add missing conditions/asserts to unit file parsing
Lennart Poettering [Thu, 20 Aug 2020 11:44:12 +0000 (13:44 +0200)] 
core: add missing conditions/asserts to unit file parsing

5 years agoanalyze: rework condition testing
Lennart Poettering [Thu, 20 Aug 2020 11:43:00 +0000 (13:43 +0200)] 
analyze: rework condition testing

Let's drop the private table and just use the generic concepts we have
in place already that make the same information available.

Fixes: #16781
5 years agocoding style: document how to break a function declaration
Luca Boccassi [Thu, 20 Aug 2020 11:11:26 +0000 (12:11 +0100)] 
coding style: document how to break a function declaration

5 years agoman: fix xml tags
Lennart Poettering [Thu, 20 Aug 2020 11:11:20 +0000 (13:11 +0200)] 
man: fix xml tags

5 years agoMerge pull request #16221 from bluca/show_microsec
Lennart Poettering [Thu, 20 Aug 2020 11:15:04 +0000 (13:15 +0200)] 
Merge pull request #16221 from bluca/show_microsec

systemctl: add --timestamp to change timestamp print format

5 years agouser-runtime-dir: deal gracefully with missing logind properties
Lennart Poettering [Wed, 19 Aug 2020 15:05:44 +0000 (17:05 +0200)] 
user-runtime-dir: deal gracefully with missing logind properties

Fixes: #16685
5 years agoMerge pull request #16559 from benzea/benzea/memory-recursiveprot
Zbigniew Jędrzejewski-Szmek [Thu, 20 Aug 2020 11:05:07 +0000 (13:05 +0200)] 
Merge pull request #16559 from benzea/benzea/memory-recursiveprot

mount-setup: Enable memory_recursiveprot for cgroup2

5 years agoMerge pull request #16677 from poettering/statx-mntid
Zbigniew Jędrzejewski-Szmek [Thu, 20 Aug 2020 08:58:14 +0000 (10:58 +0200)] 
Merge pull request #16677 from poettering/statx-mntid

make use of new kernel 5.8 statx() mount id/mountpoint APIs

5 years agoMerge pull request #16782 from keszybz/seccomp-use-cleanup
Zbigniew Jędrzejewski-Szmek [Thu, 20 Aug 2020 08:27:55 +0000 (10:27 +0200)] 
Merge pull request #16782 from keszybz/seccomp-use-cleanup

Use less iffedeffery around syscall names and _cleanup_ in one more place

5 years agohwdb: ACCEL_MOUNT_MATRIX for Irbis TW118 (#16786)
brainrom [Thu, 20 Aug 2020 08:23:35 +0000 (13:23 +0500)] 
hwdb: ACCEL_MOUNT_MATRIX for Irbis TW118 (#16786)

This was required to get orientation sensor work properly in my tablet.

5 years agocore: create per-user inaccessible node from the service manager 16543/head
Lennart Poettering [Wed, 19 Aug 2020 15:42:33 +0000 (17:42 +0200)] 
core: create per-user inaccessible node from the service manager

Previously, we'd create them from user-runtime-dir@.service. That has
one benefit: since this service runs privileged, we can create the full
set of device nodes. It has one major drawback though: it security-wise
problematic to create files/directories in directories as privileged
user in directories owned by unprivileged users, since they can use
symlinks to redirect what we want to do. As a general rule we hence
avoid this logic: only unpriv code should populate unpriv directories.

Hence, let's move this code to an appropriate place in the service
manager. This means we lose the inaccessible block device node, but
since there's already a fallback in place, this shouldn't be too bad.

5 years agodoc: document what we now place in /run/host
Lennart Poettering [Fri, 14 Aug 2020 17:49:29 +0000 (19:49 +0200)] 
doc: document what we now place in /run/host

5 years agonspawn: provide $container and $container_uuid in /run/host too
Lennart Poettering [Fri, 14 Aug 2020 17:58:37 +0000 (19:58 +0200)] 
nspawn: provide $container and $container_uuid in /run/host too

This has the major benefit that the entire payload of the container can
access these files there. Previously, we'd set them only as env vars,
but that meant only PID 1 could read them directly or other privileged
payload code with access to /run/1/environ.

5 years agonspawn,pid1: pass "inaccessible" nodes from cntr mgr to pid1 payload via /run/host
Lennart Poettering [Fri, 14 Aug 2020 16:56:54 +0000 (18:56 +0200)] 
nspawn,pid1: pass "inaccessible" nodes from cntr mgr to pid1 payload via /run/host

Let's make /run/host the sole place we pass stuff from host to container
in and place the "inaccessible" nodes in /run/host too.

In contrast to the previous two commits this is a minor compat break, but
not a relevant one I think. Previously the container manager would place
these nodes in /run/systemd/inaccessible/ and that's where PID 1 in the
container would try to add them too when missing. Container manager and
PID 1 in the container would thus manage the same dir together.

With this change the container manager now passes an immutable directory
to the container and leaves /run/systemd entirely untouched, and managed
exclusively by PID 1 inside the container, which is nice to have clear
separation on who manages what.

In order to make sure systemd then usses the /run/host/inaccesible/
nodes this commit changes PID 1 to look for that dir and if it exists
will symlink it to /run/systemd/inaccessible.

Now, this will work fine if new nspawn and new pid 1 in the container
work together. as then the symlink is created and the difference between
the two dirs won't matter.

For the case where an old nspawn invokes a new PID 1: in this case
things work as they always worked: the dir is managed together.

For the case where different container manager invokes a new PID 1: in
this case the nodes aren't typically passed in, and PID 1 in the
container will try to create them and will likely fail partially (though
gracefully) when trying to create char/block device nodes. THis is fine
though as there are fallbacks in place for that case.

For the case where a new nspawn invokes an old PID1: this is were the
(minor) incompatibily happens: in this case new nspawn will place the
nodes in the /run/host/inaccessible/ subdir, but the PID 1 in the
container won't look for them there. Since the nodes are also not
pre-created in /run/systed/inaccessible/ PID 1 will try to create them
there as if a different container manager sets them up. This is of
course not sexy, but is not a total loss, since as mentioned fallbacks
are in place anyway. Hence I think it's OK to accept this minor
incompatibility.

5 years agonspawn: move $NOTIFY_SOCKET into /run/host/ too
Lennart Poettering [Wed, 22 Jul 2020 16:00:18 +0000 (18:00 +0200)] 
nspawn: move $NOTIFY_SOCKET into /run/host/ too

The sd_notify() socket that nspawn binds that the payload can use to
talk to it was previously stored in /run/systemd/nspawn/notify, which is
weird (as in the previous commit) since this makes /run/systemd
something that is cooperatively maintained by systemd inside the
container and nspawn outside of it.

We now have a better place where container managers can put the stuff
they want to pass to the payload: /run/host/, hence let's make use of
that.

This is not a compat breakage, since the sd_notify() protocol is based
on the $NOTIFY_SOCKET env var, where we place the new socket path.

5 years agonspawn/machine: move mount propagation dir to /run/host/incoming
Lennart Poettering [Wed, 22 Jul 2020 15:57:29 +0000 (17:57 +0200)] 
nspawn/machine: move mount propagation dir to /run/host/incoming

Previously we'd use a directory /run/systemd/nspawn/incoming for
accepting mounts to propagate from the host. This is a bit weird, since
we have a shared namespace: /run/systemd/ contains both stuff managed by
the surround nspawn as well as from the systemd inside.

We now have the /run/host/ hierarchy that has special stuff we want to
pass from host to container. Let's make use of that here, and move this
directory here too.

This is not a compat breakage, since the payload never interfaces with
that directory natively: it's only nspawn and machined that need to
agree on it.

5 years agoMerge pull request #16790 from poettering/core-if-block-merge
Zbigniew Jędrzejewski-Szmek [Thu, 20 Aug 2020 08:15:01 +0000 (10:15 +0200)] 
Merge pull request #16790 from poettering/core-if-block-merge

core: merge a few if blocks

5 years agobasic/virt: treat "pouch" as a container type (id: pouch)
Wen Yang [Wed, 19 Aug 2020 11:47:03 +0000 (19:47 +0800)] 
basic/virt: treat "pouch" as a container type (id: pouch)

5 years agoMerge pull request #16792 from poettering/machine-id-chroot
Anita Zhang [Thu, 20 Aug 2020 06:21:56 +0000 (23:21 -0700)] 
Merge pull request #16792 from poettering/machine-id-chroot

machine-id-setup: don't use KVM or container manager supplied uuid if…

5 years agoMerge pull request #16793 from poettering/path-join-more
Anita Zhang [Thu, 20 Aug 2020 06:12:50 +0000 (23:12 -0700)] 
Merge pull request #16793 from poettering/path-join-more

path-lookup: path_join() all the things!

5 years agoman: Fix typo in systemd-tmpfiles
Phaedrus Leeds [Wed, 19 Aug 2020 16:36:32 +0000 (09:36 -0700)] 
man: Fix typo in systemd-tmpfiles

5 years agopath-lookup: path_join() all the things! 16793/head
Lennart Poettering [Wed, 19 Aug 2020 16:27:52 +0000 (18:27 +0200)] 
path-lookup: path_join() all the things!

When we talk about paths, better use path_join(), who knows what callers
pass to us, i.e. prefixed with "/" or not.

5 years agomachine-id-setup: don't use KVM or container manager supplied uuid if in chroot env 16792/head
Lennart Poettering [Wed, 19 Aug 2020 15:07:41 +0000 (17:07 +0200)] 
machine-id-setup: don't use KVM or container manager supplied uuid if in chroot env

Fixes: #16758
5 years agomount-setup: drop pointless zero initialization 16790/head
Lennart Poettering [Wed, 19 Aug 2020 15:47:32 +0000 (17:47 +0200)] 
mount-setup: drop pointless zero initialization

5 years agocore: merge a few if blocks
Lennart Poettering [Wed, 19 Aug 2020 15:45:33 +0000 (17:45 +0200)] 
core: merge a few if blocks

arg_system == true and getpid() == 1 hold under the very same condition
this early in the main() function (this only changes later when we start
parsing command lines, where arg_system = true is set if users invoke us
in test mode even when getpid() != 1.

Hence, let's simplify things, and merge a couple of if branches and not
pretend they were orthogonal.

5 years agopo: import the .pot file into version control 16789/head
Zbigniew Jędrzejewski-Szmek [Wed, 19 Aug 2020 16:02:22 +0000 (18:02 +0200)] 
po: import the .pot file into version control

Fixes #14531.

5 years agoRevert "gitignore .pot file"
Zbigniew Jędrzejewski-Szmek [Wed, 19 Aug 2020 16:01:07 +0000 (18:01 +0200)] 
Revert "gitignore .pot file"

This reverts commit ee4e9a1090941797d7ed64e23a49ceeba762577c.

It seems we need the .pot file in the repo to allow weblate to import it.

5 years agosystemctl: add --timestamp to change timestamp print format 16221/head
Luca Boccassi [Fri, 19 Jun 2020 10:26:22 +0000 (11:26 +0100)] 
systemctl: add --timestamp to change timestamp print format

Timestamps for unit start/stop are recorded with microsecond granularity,
but status and show truncate to second granularity by default.
Add a --timestamp=pretty|us|utc option to allow including the microseconds
or to use the UTC TZ to all timestamps printed by systemctl.

5 years agobasic/time-util: add function to format timestamps with different styles
Luca Boccassi [Fri, 19 Jun 2020 10:24:09 +0000 (11:24 +0100)] 
basic/time-util: add function to format timestamps with different styles

Instead of a multiple fixed format helper functions, add an enum and
a single helper, so that it's easier to extend in the future.

5 years agohomed: default to "btrfs" as fs type in the LUKS backend
Lennart Poettering [Tue, 18 Aug 2020 13:11:06 +0000 (15:11 +0200)] 
homed: default to "btrfs" as fs type in the LUKS backend

Apparently both Fedora and suse default to btrfs now, it should hence be
good enough for us too.

This enables a bunch of really nice things for us, most importanly we
can resize home directories freely (i.e. both grow *and* shrink) while
online. It also allows us to add nice subvolume based home directory
snapshotting later on.

Also, whenever we mention the three supported types, alaways mention
them in alphabetical order, which is also our new order of preference.

5 years agoMerge pull request #16771 from poettering/dyn-pwq
Lennart Poettering [Wed, 19 Aug 2020 13:40:41 +0000 (15:40 +0200)] 
Merge pull request #16771 from poettering/dyn-pwq

make libpwquality a dlopen() dependency + use it in systemd-firstboot, too

5 years agoMerge pull request #16762 from poettering/homed-fixlets
Zbigniew Jędrzejewski-Szmek [Wed, 19 Aug 2020 09:43:49 +0000 (11:43 +0200)] 
Merge pull request #16762 from poettering/homed-fixlets

homed: five fixlets

5 years agoman: Improve MemoryMin=/MemoryLow= description 16559/head
Benjamin Berg [Fri, 24 Jul 2020 11:17:23 +0000 (13:17 +0200)] 
man: Improve MemoryMin=/MemoryLow= description

The description didn't really explain how the distribution mechanism
works exactly and the relationship of leaf and slice units.

Update the documentation and also explicitly explain the expected
behaviour as it is created by the memory_recursiveprot cgroup2 mount
option.

5 years agomount-setup: Enable memory_recursiveprot for cgroup2
Benjamin Berg [Thu, 23 Jul 2020 10:56:32 +0000 (12:56 +0200)] 
mount-setup: Enable memory_recursiveprot for cgroup2

When available, enable memory_recursiveprot. Realistically it always
makes sense to delegate MemoryLow= and MemoryMin= to all children of a
slice/unit.

The kernel option is not enabled by default as it might cause
regressions in some setups. However, it is the better default in
general, and it results in a more flexible and obvious behaviour.

The alternative to using this option would be for user's to also set
DefaultMemoryLow= on slices when assigning MemoryLow=. However, this
makes the effect of MemoryLow= on some children less obvious, as it
could result in a lower protection rather than increasing it.

From the kernel documentation:

  memory_recursiveprot

        Recursively apply memory.min and memory.low protection to
        entire subtrees, without requiring explicit downward
        propagation into leaf cgroups.  This allows protecting entire
        subtrees from one another, while retaining free competition
        within those subtrees.  This should have been the default
        behavior but is a mount-option to avoid regressing setups
        relying on the original semantics (e.g. specifying bogusly
        high 'bypass' protection values at higher tree levels).

This was added in kernel commit 8a931f801340c (mm: memcontrol:
recursive memory.low protection), which became available in 5.7 and was
subsequently fixed in kernel 5.7.7 (mm: memcontrol: handle div0 crash
race condition in memory.low).

5 years agoshared/seccomp: use _cleanup_ in one more place 16782/head
Zbigniew Jędrzejewski-Szmek [Tue, 18 Aug 2020 15:06:28 +0000 (17:06 +0200)] 
shared/seccomp: use _cleanup_ in one more place

(cherry picked from commit 27605d6a836d85563faf41db9f7a72883d44c0ff)

5 years agoshared/seccomp: do not use ifdef guards around textual syscall names
Zbigniew Jędrzejewski-Szmek [Tue, 18 Aug 2020 14:10:47 +0000 (16:10 +0200)] 
shared/seccomp: do not use ifdef guards around textual syscall names

It is possible that we will be running with an upgraded libseccomp, in which
case libseccomp might know the syscall name, even if the number is not known at
the time when systemd is being compiled. The guard only serves to break such
upgrades, by requiring that we also recompile systemd.

For s390-specific syscalls, use a define to exclude them, so that that we don't
try to filter them on other arches.

(cherry picked from commit 6cf852e79eb0eced2f77653941f9c75c3bd79386)

5 years agoMerge pull request #16640 from keszybz/various-patches
Lennart Poettering [Wed, 19 Aug 2020 08:30:45 +0000 (10:30 +0200)] 
Merge pull request #16640 from keszybz/various-patches

Improve systemd-analyze security a bit and other assorted bits

5 years agomeson: add min version for libfdisk
Anita Zhang [Tue, 18 Aug 2020 06:09:38 +0000 (23:09 -0700)] 
meson: add min version for libfdisk

Was trying to run src/partition/test-repart.sh on CentOS 8 and the first
resize call kept failing with ERANGE. Turned out that CentOS 8 comes
with libfdisk-devel-2.32.1 which is missing
https://github.com/karelzak/util-linux/commit/2f35c1ead621f42f32f7777232568cb03185b473
(in libfdisk 2.33 and up).

5 years agoupdate TODO 16677/head
Lennart Poettering [Wed, 5 Aug 2020 22:03:23 +0000 (00:03 +0200)] 
update TODO

5 years agomountpoint-util: use new kernel 5.8 statx() API for determining mount points
Lennart Poettering [Wed, 5 Aug 2020 21:53:42 +0000 (23:53 +0200)] 
mountpoint-util: use new kernel 5.8 statx() API for determining mount points

We finally have an explicit API for this in the kernel. It's great and
simple. Let's use it!

5 years agomountpoint-util: use new kernel 5.8 statx() API for determining mnt_id
Lennart Poettering [Wed, 5 Aug 2020 21:28:21 +0000 (23:28 +0200)] 
mountpoint-util: use new kernel 5.8 statx() API for determining mnt_id

The kernel finally has a proper API to determine the mnt_id of a file.
Let's use it.

This adds support for the STATX_MNT_ID field of statx(), added in
kernel 5.8.

5 years agomountpoint-util: minor modernizations
Lennart Poettering [Wed, 5 Aug 2020 21:28:14 +0000 (23:28 +0200)] 
mountpoint-util: minor modernizations

5 years agoupdate TODO 16771/head
Lennart Poettering [Tue, 18 Aug 2020 08:41:18 +0000 (10:41 +0200)] 
update TODO

5 years agofirstboot: hook up with libpwquality
Lennart Poettering [Tue, 18 Aug 2020 08:37:44 +0000 (10:37 +0200)] 
firstboot: hook up with libpwquality