Commit Graph
45809 Commits
Author SHA1 Message Date
Yu Watanabe b9541abdb9 dissect: insert missing space 2023-10-26 12:16:12 +09:00
Daan De Meyer c173be0d4c Merge pull request #29708 from DaanDeMeyer/bootctl-always
Always build bootctl
2023-10-25 22:59:59 +02:00
Luca Boccassi 9ceda23941 Merge pull request #29710 from mrc0mmand/test-pcrextend
test: TEST-70-TPM2 shenagians
2023-10-25 21:13:56 +01:00
Frantisek Sumsal dd741b8893 random-seed: terminate the option array
So we don't crash on invalid options:

$ build/systemd-random-seed --foo
Segmentation fault (core dumped)
2023-10-25 20:41:46 +01:00
Frantisek Sumsal 181a80e602 tpm2-setup: drop the COMMAND placeholder from the help
Since systemd-tpm2-setup doesn't expect any arguments.
2023-10-25 18:18:48 +02:00
Frantisek Sumsal 91893f772b tpm2-setup: terminate the option array
Otherwise bad things happen:

$ build/systemd-tpm2-setup --foo
Segmentation fault (core dumped)
2023-10-25 18:18:48 +02:00
Daan De Meyer 7e7ea1b1c8 meson: Always build systemd-measure
Same idea as with bootctl, we might be doing image builds from a
system that doesn't boot with UEFI but we still might want to measure
stuff for the image we're building so let's not gate this behind
ENABLE_BOOTLOADER.
2023-10-25 16:49:30 +02:00
Daan De Meyer dedb925eaf meson: Always build bootctl
bootctl is rather useful to have, even if on a system without UEFI,
as it has a number of verbs that are unrelated to UEFI (e.g kernel-identify),
and more importantly, it supports --root to operate on directory trees
(which could be intended to be deployed on UEFI) so let's make sure we
always build it.
2023-10-25 16:49:24 +02:00
Raul Cheleguini 813dbff4d5 nspawn: allow user-specified MAC address on container side
Introduce the environment variable SYSTEMD_NSPAWN_NETWORK_MAC to allow
user-specified MAC address on container side.
2023-10-25 13:59:46 +01:00
Luca Boccassi 2e53544c76 Merge pull request #29704 from mrc0mmand/cocci
Another round of Coccinelle tweaks
2023-10-25 13:42:21 +01:00
Luca Boccassi 9674c06510 Merge pull request #29695 from poettering/repart-reduce-global-vars
repart,cryptenroll: three smaller tweaks
2023-10-25 13:18:38 +01:00
Lennart Poettering 3c6439bf2c cryptsetup: remove redundant check
The immediately preceeding check already covered that.

This removes and addition made back in aae6eb9611.

cc @williamcroberts
2023-10-25 13:18:17 +01:00
Luca Boccassi 4c46ece4c8 Merge pull request #29698 from poettering/tpm2-no-best-pcr
tpm2: minor tweaks
2023-10-25 13:18:03 +01:00
Frantisek Sumsal 1a9a61f9cc udev: strdupa() → strdupa_safe() 2023-10-25 11:29:20 +02:00
Frantisek Sumsal 73151fbe30 network: use timestamp_is_set() in one more place 2023-10-25 11:28:12 +02:00
Frantisek Sumsal 25f7271c42 network: ENOTSUP → EOPNOTSUPP 2023-10-25 11:26:19 +02:00
Frantisek Sumsal c8ccd444a2 core,journal: drop unnecessary !! casts 2023-10-25 11:21:40 +02:00
Luca Boccassi 7470e161cf Merge pull request #29553 from keszybz/analyze-cat-config-tldr
analyze/cat-config: add switch to print only "interesting" parts of conffiles
2023-10-25 09:53:19 +01:00
Lennart Poettering 980a5aeffa tpm2-util: add line breaks in compound struct init, like we usually do 2023-10-25 10:33:29 +02:00
Frantisek Sumsal b9439855d2 Merge pull request #29687 from yuwata/network-state-file-sync
network: several fixlets for state file
2023-10-25 08:29:58 +00:00
Lennart Poettering 51abb74eab cryptenroll: validate positional arguments before looking at detail parameters
Let's switch the order in which we process positional arguments and
analyze/tweak detail parameters. Let's look at the positional arguments
first (i.e. the "big picture") and then look at the switches (i.e.
"little details").

THis doesn't matter much, but makes for better error messages I think.
At least I was very confused that a completely borked cmdline I passed
to cryptenrolled complained about some detail and let the major fuckup
pass...
2023-10-25 09:29:34 +02:00
Lennart Poettering 996d22e50a cryptenroll: add section headers to --help text 2023-10-25 09:29:34 +02:00
Lennart Poettering d66ff6fe77 cryptenroll: add addition asserts 2023-10-25 09:29:34 +02:00
Lennart Poettering c588cf9720 repart: reduce scope of two variables
This replicates what 475c473d32 did for
cryptenroll for repart, which has very similar code for this.
2023-10-25 09:29:34 +02:00
Lennart Poettering 4af7f27aeb tpm2-util: add line breaks in compound struct init, like we usually do 2023-10-25 09:29:20 +02:00
Lennart Poettering 3ee5e9d5f3 tpm2-util: dont't find best PCR bank if no PCRs are selected whatsoever
This will otherwise just yield weird log message, complaining that PCRs
were not initialized. But which PCRs if we have none selected?
2023-10-25 09:29:20 +02:00
Lennart Poettering adabcbabff execute: log about failures when opening a terminal to reset 2023-10-25 09:28:17 +02:00
Lennart Poettering 83d5bbaf1b mount-util: add one more const 2023-10-25 15:53:10 +09:00
Luca Boccassi 648fbfe621 Merge pull request #29677 from keszybz/rewinddir-alternative-fix
Rewind dir fd before using it for cleanup
2023-10-24 19:41:02 +01:00
Mike Yuan 828ad30470 sleep-config: make hybrid sleep always use 'suspend' disk mode
If user requests hybrid sleep, we should always use 'suspend'
disk mode. If that's not supported, let's correctly report it
so they can choose plain hibernation instead. HybridSleepMode=
serves no purpose in this case and should be removed.

Addresses https://github.com/systemd/systemd/pull/29681#discussion_r1369812785
2023-10-24 19:07:03 +02:00
Zbigniew Jędrzejewski-Szmek c04cec128f shared/pretty-print: skip redundant section headers with --tldr
If the same section appears consecutively in a given file, subsequent
occurenced are not printed.

[Slice]
Foo=bar
[Slice]   # this is not printed
Bar=bar

Requested in
https://github.com/systemd/systemd/pull/29553#pullrequestreview-1677310352.
2023-10-24 18:32:18 +02:00
Zbigniew Jędrzejewski-Szmek 5737c890d6 binfmt: add --tldr 2023-10-24 18:32:18 +02:00
Zbigniew Jędrzejewski-Szmek f80f5dd6cc sysctl: add --tldr 2023-10-24 18:32:18 +02:00
Zbigniew Jędrzejewski-Szmek 918560d70f sysusers: add --tldr 2023-10-24 18:32:17 +02:00
Zbigniew Jędrzejewski-Szmek 1be6a5db21 tmpfiles: add --tldr
This is like --cat-config, but omits the comments and empty lines.
The name is incoungrous with --cat-config, but I don't see a nice way to
call it that wouldn't be annoyingly long.

pager_open() is moved to cat_config() to remove some lines from run().
2023-10-24 18:32:17 +02:00
Zbigniew Jędrzejewski-Szmek a9e6803582 shared/pretty-print: add highlighting 2023-10-24 18:24:12 +02:00
Zbigniew Jędrzejewski-Szmek 063c838206 analyze/cat-config: add switch to print only "interesting" parts of config files
When looking at configuration, often a user wants to suppress the comments and
just look at the parts that actually configure something, roughly equivalent to
  systemd-analyze cat-config … | rg -v '^(#|;|$)
This switch implements this natively, skipping lines that start with a comment
character or only contain whitespace.

For formats that have section headers, section headers are skipped, if only
followed by stuff that would be skipped. (The last section header is printed
when we're about to print some actual output.)

Note that the caller doesn't know if the format has headers or not. We do format
type detection in pretty-print.c. So the caller only specifies tldr=true|false, and
conf_files_cat() figures out if the format has headers and whether those should
be handled specially.

The comments that show the file name are always printed, even if all of the file
is suppressed.

This is a partial answer to the discussions in
https://github.com/systemd/systemd/pull/28919,
https://github.com/systemd/systemd/pull/29248. If the default config is shown in
config files, the user can conveniently use '--tldr' to show the relevant parts.
2023-10-24 15:59:34 +02:00
Zbigniew Jędrzejewski-Szmek e3b84b105e shared/copy: rewind dir fd before using it for cleanup
This seems to be the only place where rm_rf_children() is called with a
possibly used fd, which is then passed through to rm_rf_children_impl().

This also fixes #29606.
(Tested on Fedora rawhide with kernel 6.5.6-300.fc39.x86_64.)
2023-10-24 13:37:10 +02:00
Luca Boccassi e5cd8bc060 Merge pull request #29601 from yuwata/mmap-check-overflow
mmap: check offset and size more carefully
2023-10-24 12:20:04 +01:00
Luca Boccassi 50dbadc9d1 Merge pull request #29685 from poettering/cryptenroll-reduce-scope
cryptenroll: two minor simplifications
2023-10-24 10:49:37 +01:00
Yu Watanabe bd7d902884 network: also synchronously update manager state file 2023-10-24 18:39:47 +09:00
Yu Watanabe a70c27b834 network: make link_save() static 2023-10-24 18:39:47 +09:00
Yu Watanabe ac4a69500e network: do not try to save link state file twice on boot
On enumeration, (that is, before manager_start() is called), enumerated
links may already have the dirty flag. In that case, saving the state
file in manager_start() should clear the flag.
2023-10-24 18:39:47 +09:00
Mike Yuan cf6416612c Merge pull request #29681 from YHNdnzj/sleep-round-three
sleep-config: cleanup round three
2023-10-24 17:03:54 +08:00
Yu Watanabe 8875639a7c Merge pull request #29679 from keszybz/drop-iovec-null
Drop IOVEC_NULL
2023-10-24 17:05:45 +09:00
Zbigniew Jędrzejewski-Szmek 1dd33bf3e4 basic/iovec-util: use FOREACH_ARRAY in one more place 2023-10-23 22:30:37 +02:00
Zbigniew Jędrzejewski-Szmek 3c9783c7f4 basic/iovec-util: drop TAKE_IOVEC
As suggested in
https://github.com/systemd/systemd/pull/29679#discussion_r1368678932.
2023-10-23 22:23:13 +02:00
Lennart Poettering 475c473d32 cryptenroll: merge two if checks with same condition
This removes a duplicate condition check by adding a common surrounding
if block.

This also change a confusing if check: "(X && Y) && Z" to simply "X && Y && Z"
2023-10-23 22:19:40 +02:00
Lennart Poettering 91a1632a4c cryptenroll: reduce scope of two global variables
No change in behaviour
2023-10-23 22:19:29 +02:00
Luca Boccassi d334c1211f systemctl: fallback if logind doesn't support new flag
Follow-up for 665a3d6d15
2023-10-23 19:43:15 +01:00