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

54345 Commits

Author SHA1 Message Date
Tony Asleson
788a0ef179 test: exercise sytemd-integritysetup & generator
Ensures we can open a dm-integrity volume formated with
integritysetup.
2021-11-05 21:17:17 +00:00
Jan Janssen
ad102dd09a sd-boot: Add .osrel section
This allows starting systemd-boot from \EFI\Linux for easier testing
and bisection without risking an unbootable system as the user does not
need to replace their working loader.
2021-11-05 22:11:43 +01:00
Luca Boccassi
03e93377dc analyze: explain how the weight/range policy fields are used 2021-11-05 21:09:43 +00:00
Lennart Poettering
874cbf675d
Merge pull request #21252 from poettering/homed-record-dir-env-var
homed: add env var to override dir where we fine stored user records
2021-11-05 21:52:00 +01:00
Lennart Poettering
7cdd5c0d4c user-record: fix display of access mode 2021-11-05 21:37:45 +01:00
Lennart Poettering
30df35869c user-record: show fs/luks/gpt UUIDs as proper UUIDs
These are not defined by us, but are defined as proper UUIDs by their
respective specs, hence show them as such.
2021-11-05 21:37:20 +01:00
Lennart Poettering
67302b38b4 docs: document systemd-homed development env vars 2021-11-05 19:07:52 +01:00
Lennart Poettering
005daeed2b homed: add env var to override dir where we fine stored user records
This adds an env var which we can use to redirect where homed stores and
looks for user records kept on the host. This is useful for debugging
purposes so that one can easily run another homed instnce that doesn't
interfere with the main instance.
2021-11-05 18:35:28 +01:00
Jan Janssen
d874a13efc test: Add test for flag macros 2021-11-05 16:27:41 +01:00
Zbigniew Jędrzejewski-Szmek
20f7ada699
Merge pull request #20056 from calestyo/split-up-sysusers.d-systemd.conf.in
sysusers: split up systemd.conf
2021-11-05 15:30:33 +01:00
Luca Boccassi
8389fd19d2
Merge pull request #20138 from keszybz/coding-style-variable-decls
A coding style tweak and checking of sd_notify() calls and voidification of pager_open()
2021-11-05 13:57:30 +00:00
Zbigniew Jędrzejewski-Szmek
5f035b13de meson-render-jinja2: use ast.literal_eval()
Imports are sorted in the usual fashion: stdlib first.

literal_eval() parses string/numbers/lists/sets/dicts, and nothing else, while
eval will execute any python code. Using literal_eval() is generally more
correct, because it avoids the risk of side effects from the parsed expression.
In this case, we generate the parsed strings ourselves, so it's very unlikely
to have anything unexpected in the expressions. But let's do the correct thing
anyway.
2021-11-05 14:56:32 +01:00
Zbigniew Jędrzejewski-Szmek
7f9521d5e1
Merge pull request #21225 from medhefgo/boot-cleanup
Boot cleanup
2021-11-05 14:53:47 +01:00
Luca Boccassi
fac2c3e97d basic/mountpoint-util: detect erofs as a read-only FS 2021-11-05 14:02:04 +01:00
Lennart Poettering
d7654742ee loop-util: reopen device node if we shortcut loop device creation
The LoopDevice object supports a shortcut: if the backing fd we are
supposed to create a loopback device of refers to a
block device alrady then we'll use it as is – if we can – instead of
setting up an unnecessary loopback device that would be pretty much
the same as its backing device.

Previously, when doing this we'd just dup() the original backing fd and
use that. But that's problematic in case O_DIRECT was set on the fd,
since we'll keep that flag set on our copy too, which means we can't do
simple, regular IO on it anymore.

Thus, let's reopen the inode in this case with the exact access flags
we'd apply if we'd actually allocate and open a new loopback device.

Fixes: #21176
2021-11-05 07:08:16 +00:00
Luca Boccassi
d54017e8f7 analyze: fix typos in test policy 2021-11-04 19:22:28 +00:00
Luca Boccassi
7544461cd0
Merge pull request #21229 from keszybz/improve-m-hint
Improve hint to use -M in various tools
2021-11-04 18:40:26 +00:00
Jan Janssen
d1da890004 sd-boot: Fix efi_arch checks
efi_arch is set to whatever meson returns from host_machine.cpu_family() and
gnu_efi_arch is then set accordingly.

On x86, efi_arch == x86 and gnu_efi_arch == ia32. Surprisingly, compilation
worked (without disabling some instruction sets) and nobody ever complained
about systemd-bootia32.efi not working.
2021-11-04 18:54:31 +01:00
Jan Janssen
1840dfc327 sd-boot: Detect supported compile args
This brings the final list of compiler arguments more in line with
how meson does things. In particular, --buildtype=plain will not
add any optimizations on its own (and would have to be provided
through CFLAGS=).
2021-11-04 18:54:31 +01:00
Jan Janssen
f8a738bbc0 sd-boot: Add some link flags
These flags are used by gnu-efi. Adding --no-undefined even allows
us to drop the no-undefined-symbols.sh test in favor of immediate
compile time errors.
2021-11-04 18:54:31 +01:00
Jan Janssen
1f6f233f87 sd-stub: Fix possible memory leak 2021-11-04 18:54:31 +01:00
Jan Janssen
65ff3d2626 sd-boot: Check for existence of required pe sections 2021-11-04 18:48:53 +01:00
Jan Janssen
ff9d65f6ff sd-boot: Move optional header verification into verify_pe 2021-11-04 18:37:07 +01:00
Jan Janssen
785b5fcf5f sd-boot: Use FLAGS_SET 2021-11-04 18:37:07 +01:00
Jan Janssen
a8a7723ba9 sd-boot: Move flags helpers to macro-fundamental.h 2021-11-04 18:37:07 +01:00
Jan Janssen
1224d57ba5 sd-boot: Always compile with -ffreestanding and -fshort-wchar
This is not a hosted environment and we should not pretend otherwise
if -ffreestanding is not supported.

With EFI strings being in UCS2, it is not supported to build without
-fshort-wchar as gcc/clang default to a w_char_t size of 4 bytes.

This also makes the charset for wide chars explicit on gcc. This way
we get a nice error message if anyone ever tries to add 💩 to strings.
2021-11-04 18:37:07 +01:00
Jan Janssen
3c86dcc39c sd-boot: Save and restore console attributes
This also only writes the message on a new line if we aren't at the
beginning of one already.
2021-11-04 18:37:07 +01:00
Lennart Poettering
3663f754f1
Merge pull request #21070 from medhefgo/boot-save
sd-boot: Add support to boot last select entry
2021-11-04 17:37:12 +01:00
Lennart Poettering
71bb9594e9
Merge pull request #21030 from DaanDeMeyer/path-skipped
core: Propagate condition failed state from service to path unit.
2021-11-04 15:20:00 +01:00
Zbigniew Jędrzejewski-Szmek
a4eba5d8cf update-helper: add missing loop over user units
Noticed by Luca.

shellcheck doens't catch this, and somehow it was missed in review
and testing ;(
2021-11-04 11:39:04 +01:00
Zbigniew Jędrzejewski-Szmek
10a7340a97 tree-wide: do not print hint about -M if -M is already used
(Or when -H is used, since -H and -M are incompatible.)

Note that the slightly unusual form with separate boolean variables (hint_vars,
hint_addr) instead of e.g. a const char* variable to hold the message, because this
way we don't trigger the warning about non-literal format.
2021-11-04 11:00:54 +01:00
Zbigniew Jędrzejewski-Szmek
fb293b3c0f busctl: do not print hint about -M if -M is already used
(Or when -H is used, since -H and -M are incompatible.)
2021-11-04 11:00:15 +01:00
Zbigniew Jędrzejewski-Szmek
237fbb6719 shared/bus-util: make bus_log_*_error() functions functions
They were defined as macros, but they are a bit too complicated for this,
so it's getting unwieldy. We can make them functions without any loss.
2021-11-04 11:00:15 +01:00
Lennart Poettering
aedec452b9 tree-wide: always use TAKE_FD() when calling rearrange_stdio()
rearrange_stdio() invalidates specified fds even on failure, which means
we should always invalidate the fds we pass in no matter what. Let's
make this explicit by using TAKE_FD() for that everywhere.

Note that in many places we such invalidation doesnt get us much
behaviour-wise, since we don't use the variables anymore later. But
TAKE_FD() in a way is also documentation, it encodes explicitly that the
fds are invalidated here, so I think it's a good thing to always make
this explicit here.
2021-11-03 23:05:26 +00:00
Daan De Meyer
12ab94a1e4 core: Propagate condition failed state to triggering units.
Alternative to https://github.com/systemd/systemd/pull/20531.

Whenever a service triggered by another unit fails condition checks,
stop the triggering unit to prevent systemd busy looping trying to
start the triggered unit.
2021-11-03 20:25:14 +00:00
Yu Watanabe
829b86bc0f
Merge pull request #21217 from keszybz/debug-test-process-util
procfs-util: fix confusion wrt. quantity limit and maximum value
2021-11-04 04:03:56 +09:00
Yu Watanabe
3f5e7edbdb
Merge pull request #21216 from poettering/take-fd-tweak
fd-util: make TAKE_FD free of double evaluation
2021-11-04 04:01:45 +09:00
Lennart Poettering
b7759c8f0a macro: make TAKE_PTR() side-effect free 2021-11-03 16:36:19 +01:00
Lennart Poettering
7950211df3 tree-wide: port more code to sigkill_wait() 2021-11-03 16:36:19 +01:00
Lennart Poettering
8f03de5323 tree-wide: port various places to use TAKE_PID() 2021-11-03 16:36:09 +01:00
Lennart Poettering
883946f0d2 process-util: rework TAKE_PID() to be side-effect free 2021-11-03 15:57:02 +01:00
Lennart Poettering
2c1612100d process-util: wait for processes we killed even if killing failed
The processes might be zombies in which case killing will fail, but
reaping them still matters.
2021-11-03 15:57:02 +01:00
Lennart Poettering
a70877d881 test: add test that ensures TAKE_FD() works as it should 2021-11-03 15:57:02 +01:00
Zbigniew Jędrzejewski-Szmek
384c2c3239 Make pager_open() return void 2021-11-03 15:24:56 +01:00
Lennart Poettering
90d59676b3 fd-util: make TAKE_FD free of double evaluation
Better be safe than sorry.
2021-11-03 15:22:18 +01:00
Zbigniew Jędrzejewski-Szmek
028f7d3ac6 manager: fix confusion when to send READY=1
I got the logic reversed in 6d93265955.
Let's just remove the conditionalization of the status message: if we're
sending something, we might just as well always attach READY=1, the extra
few bytes don't make much of a difference.

FWIW, it seems that this bug didn't cause problems, probably because we'd send
READY=1 either from user_manager_send_ready() or from a later call to
manager_send_ready().
2021-11-03 11:32:31 +01:00
Zbigniew Jędrzejewski-Szmek
d4341b76d0 tree-wide: drop "f" from sd_notify() calls with a static string
If we don't need to do any formatting, let's optimize things a bit.
2021-11-03 11:29:49 +01:00
Zbigniew Jędrzejewski-Szmek
d7737416f5 journald: modernize code to send notifications
No change except making things a bit less verbose.
2021-11-03 11:29:49 +01:00
Zbigniew Jędrzejewski-Szmek
4bf4f50faa tree-wide: warn when sd_notify fails with READY=1 or FDSTOREREMOVE=1
Most sd_notify() calls are like log_info() — the result is only informative
and if they fail, it's best ignore this. But if a call with READY=1 fails,
the unit may enter a failed state, so we should warn about this. Similarly
for FSTOREREMOVE=1: the manager may be left with a stale fd, at least wasting
resources.
2021-11-03 11:29:49 +01:00
Zbigniew Jędrzejewski-Szmek
9214f2999b CODING_STYLE: allow joined variable declarations and function calls
… but only for a single variable.

The guidelines already allowed declaring variables at the point of
initialization. But not making a function call to do that. Let's allow that
now.  The existing style of declaring and initializing seperate is still
allowed, and whatever makes most sense should be used.
2021-11-03 10:30:36 +01:00