1
0
mirror of https://github.com/systemd/systemd.git synced 2025-02-04 21:47:31 +03:00

61116 Commits

Author SHA1 Message Date
Daan De Meyer
d91a5f6481 find-esp: Relax filesystem root directory check
When relaxed checks are requested, let's not require the efi/xbootldr
directory to be the root of the filesystem. When building images, image
builders might install all efi/xbootldr files to a regular directory
first before packing them up into a partition. To allow bootctl to be
used in such scenarios to install systemd-boot, we need to relax the
fsroot check.
2022-11-23 09:20:10 +01:00
Luca Boccassi
0dce448bbc repart: respect --discard=no also for block devices
It's only used to avoid BLKDISCARD on individual partitions at the moment.
It can take a lot of time to run on very slow devices, so avoid it for
them too.
2022-11-23 01:33:26 +01:00
Jason A. Donenfeld
da403fd38a Update changelog with latest sd-boot, sd-stub, and bootctl changes 2022-11-23 01:33:05 +01:00
Jason A. Donenfeld
0a1d8ac77a stub: handle random seed like sd-boot does
sd-stub has an opportunity to handle the seed the same way sd-boot does,
which would have benefits for UKIs when sd-boot is not in use. This
commit wires that up.

It refactors the XBOOTLDR partition discovery to also find the ESP
partition, so that it access the random seed there.
2022-11-23 00:56:45 +01:00
Lennart Poettering
0c14c45e5c sd-event: reenable epoll_pwait2()
This reenables epoll_pwait2() use, i.e. undoes the effect of
39f756d3ae4765b8bf017567a12b8a4b358eaaf5.

Instead of just reverting that, this PR will change things so that we
strictly rely on glibc's new epoll_pwait2() wrapper (which was added
earlier this year), and drop our own manual fallback syscall wrapper.
That should nicely side-step any issues with correct syscall wrapping
definitions (which on some arch seem not to be easy, given the sigset_t
size final argument), by making this a glibc problem, not ours.

Given that the only benefit this delivers are time-outs more granular
than msec, it shouldn't really matter that we'll miss out on support
for this on systems with older glibcs.
2022-11-23 00:54:23 +01:00
Daan De Meyer
c9bb7438db
Merge pull request #25485 from DaanDeMeyer/gpt-fix
gpt: Specify designator array sizes explicitly
2022-11-22 22:29:50 +01:00
Daan De Meyer
df655bf34c gpt: Drop PARTITION_LINUX_GENERIC and PARTITION_USER_HOME
These don't have an inherent purpose, and aren't used throughout
the codebase, so let's simplify things and remove these.

See https://github.com/systemd/systemd/pull/24803#discussion_r1028190421
for more information.
2022-11-22 15:59:50 +01:00
Daan De Meyer
3cde36ffa3 gpt: Specify designator array sizes explicitly
Avoid users accidentally accessing uninitialized memory by always
making sure the array size covers all possible enum values.
2022-11-22 15:53:02 +01:00
Luca Boccassi
d4b3ae65f3
Merge pull request #25477 from yuwata/network-wifi-reconfigure-on-connect
network: wifi: try to reconfigure when connected
2022-11-22 13:37:15 +01:00
Zbigniew Jędrzejewski-Szmek
70b9ea26b6 man/journalctl: mention systemd-cat, make the description more direct
We said "query the journal". This is true but also very generic. Let's say
"print log entries from the journal" instead, so that users who are looking for
"logging" are more likely to figure out that the journalctl is the tool for
them.

Also, mention systemd-journal-remote.service which can write the journal too.
And give some hints how to figure out how to write *to* the journal.
2022-11-22 13:31:04 +01:00
Anita Zhang
6ee27eb3ca man: update docs for MemoryZSwapMax= 2022-11-22 11:01:50 +01:00
Benjamin Fogle
f4a49d1c58 resolved: Fix OpenSSL error messages 2022-11-22 16:04:45 +09:00
Yu Watanabe
8a4ad01a72 network: wifi: try to reconfigure when connected
Sometimes, RTM_NEWLINK message with carrier is received earlier than
NL80211_CMD_CONNECT. To make SSID= or other WiFi related settings in
[Match] section work, let's try to reconfigure the interface.

Fixes a bug introduced by 96f5f9ef9a1ba5146d3357c1548fb675d3bd5b68.

Fixes #25384.
2022-11-22 14:44:26 +09:00
Yu Watanabe
4642371d07 network: drop unnecessary prototype
Follow-up for a39a9ac8065c29330207838b70fe388bde2bc254.
2022-11-22 14:32:19 +09:00
Yu Watanabe
6ad17c31fb
Merge pull request #25470 from keszybz/strv-extendf-format
Improve check for strv_extendf() format string
2022-11-22 12:27:37 +09:00
наб
848517ddd4 systemctl: edit: write override files as text files
Instead of stripping the newline off the final would-be line;
continue to reduce an empty-line-only file to an empty file, though

Closes #25303
2022-11-22 01:45:50 +01:00
Zbigniew Jędrzejewski-Szmek
5a65d2e535 bootctl: use grey-and-slash prefix for source in list too
Follow-up for 7851732262ec94f50598c4a289589a6ddb97ebfd. The source
field also shows a path relative to $BOOT, so it should be displayed
in the same fashion.
2022-11-22 01:40:20 +01:00
Lennart Poettering
e4cb147a2e udev: make sure auto-root logic also works in UKIs booted from XBOOTLDR
If no root= switch is specified on the kernel command line we'll use the
root disk on which the partition the LoaderDevicePartUUID efi var is
located – as long as that partition is an ESP. Let's slightly liberalize
that and also allow it if that partition is an XBOOTLDR partition. This
ensures that UKIs spawned directly from XBOOTLDR work the same as those
from the ESP.

(Note that this makes no difference if sd-boot is in the mix, as in that
case LoaderDevicePartUUID is always set to the ESP, as that's where
sd-boot is located, and sd-boot will set the var first, sd-stub will
only set it later if it#s not set yet.)
2022-11-22 01:32:51 +01:00
Lennart Poettering
7d1e61cab6 tree-wide: make constant ratelimit compound actually const
The compiler should recognize that these are constant expressions, but
let's better make this explicit, so that the linker can safely share the
initializations all over the place.
2022-11-22 01:30:55 +01:00
Jason A. Donenfeld
47b3e96647 boot: remove random-seed-mode
Now that the random seed is used on virtualized systems, there's no
point in having a random-seed-mode toggle switch. Let's just always
require it now, with the existing logic already being there to allow not
having it if EFI itself has an RNG. In other words, the logic for this
can now be automatic.
2022-11-22 01:30:03 +01:00
Luca Boccassi
a0c544ee09
Merge pull request #25379 from keszybz/update-doc-links
Update doc links
2022-11-22 01:07:13 +01:00
Zbigniew Jędrzejewski-Szmek
400102ec91 basic/strv: check printf arguments to strv_extendf()
The second argument to _printf_() specifies where the arguments start. We need to
use 0 in two cases: when the args in a va_list and can't be checked, and with journald
logging functions which accept multiple format strings with multiple argument sets,
which the _printf_ checker does not understand. But strv_extendf() can be checked.
2022-11-21 20:08:50 +01:00
Zbigniew Jędrzejewski-Szmek
6457ce15be manager: fix format strings for trigger metadata
Fixup for c8bc7519c888a99134f88f8c82353246d3c0cc5d.
2022-11-21 20:08:50 +01:00
Yu Watanabe
69b31b29a0
Merge pull request #25395 from poettering/tpm2-dlsym-assert
dlfcn-util: add static asserts ensuring our sym_xyz() func ptrs match …
2022-11-22 03:36:03 +09:00
Lennart Poettering
0d9e6d76be mkosi: pull in libbpf1 instead of legacy libbpf0 on debian 2022-11-21 16:13:29 +01:00
Lennart Poettering
7736a71fd2 dlfcn-util: add static asserts ensuring our sym_xyz() func ptrs match the types from the official headers
Make sure that the sym_xyz function pointers have the types that the
functions we'll assign them have.

And of course, this found a number of incompatibilities right-away, in
particular in the bpf hookup.

(Doing this will trigger deprecation warnings from libbpf. I simply
turned them off locally now, since we are well aware of what we are
doing in that regard.)

There's one return type fix (bool → int), that actually matters I think,
as it might have created an incompatibility on some archs.
2022-11-21 16:13:17 +01:00
Lennart Poettering
28795f2c13 update TODO 2022-11-21 15:14:22 +01:00
Jason A. Donenfeld
a4eea6038c bootctl: install system token on virtualized systems
Removing the virtualization check might not be the worst thing in the
world, and would potentially get many, many more systems properly seeded
rather than not seeded. There are a few reasons to consider this:

- In most QEMU setups and most guides on how to setup QEMU, a separate
  pflash file is used for nvram variables, and this generally isn't
  copied around.

- We're now hashing in a timestamp, which should provide some level of
  differentiation, given that EFI_TIME has a nanoseconds field.

- The kernel itself will additionally hash in: a high resolution time
  stamp, a cycle counter, RDRAND output, the VMGENID uniquely
  identifying the virtual machine, any other seeds from the hypervisor
  (like from FDT or setup_data).

- During early boot, the RNG is reseeded quite frequently to account for
  the importance of early differentiation.

So maybe the mitigating factors make the actual feared problem
significantly less likely and therefore the pros of having file-based
seeding might outweigh the cons of weird misconfigured setups having a
hypothetical problem on first boot.
2022-11-21 15:13:26 +01:00
Daan De Meyer
261b14be76
Merge pull request #25461 from DaanDeMeyer/repart-followups
repart followups
2022-11-21 14:02:25 +01:00
Zbigniew Jędrzejewski-Szmek
2bd051a06d docs/BOOT_LOADER_INTERFACE: reword sentence to apply to both entry types 2022-11-21 12:26:35 +01:00
Zbigniew Jędrzejewski-Szmek
db81144428 tree-wide: BLS and DPS are now on uapi-group website 2022-11-21 12:26:35 +01:00
Daan De Meyer
6b1ea55e0b repart: Rework PartitionTarget initialization 2022-11-21 11:47:13 +01:00
Daan De Meyer
488bb758c0 repart: Use fd based operations in partition_populate_directory() 2022-11-21 11:47:13 +01:00
BerndAdameit
082ac7bb12 man/sd_bus_default: Refer to man-pages project (man7.org) for ssh(1) 2022-11-21 11:35:33 +01:00
Lennart Poettering
b22afd2844
Merge pull request #25409 from medhefgo/boot-fixes
boot: Several fixes
2022-11-21 11:34:50 +01:00
Daan De Meyer
48b1e18aae repart: Remove redundant parentheses in partition_populate_directory() 2022-11-21 10:53:23 +01:00
Daan De Meyer
a9abef7f67 mkfs-util: Use FORK_CLOSE_ALL_FDS 2022-11-21 10:51:15 +01:00
Daan De Meyer
92b11378ff mkfs-util: Prefer fd based stat() where possible 2022-11-21 10:49:37 +01:00
Daan De Meyer
29ec4bce0e mkfs-util: Use GID_FMT 2022-11-21 10:46:59 +01:00
Daan De Meyer
922576e452 repart: Use ASSERT_PTR() in partition_encrypt() 2022-11-21 10:45:26 +01:00
Daan De Meyer
983154f518 repart: Use ftruncate() instead of posix_allocate() 2022-11-21 10:44:38 +01:00
Daan De Meyer
766f52f25c repart: Fix parse_filter_partitions() log messages 2022-11-21 10:36:37 +01:00
Daan De Meyer
53538e33e9 repart: Fix FilterPartitionsType enum name 2022-11-21 10:35:18 +01:00
Daan De Meyer
5f59807d2d repart: Rework unused partition number algorithm 2022-11-21 10:34:28 +01:00
Daan De Meyer
c1979cd881 repart: Use IN_SET() in one more place 2022-11-21 10:28:36 +01:00
Richard E. van der Luit
214ba5cadf po: Translated using Weblate (Dutch)
Currently translated at 100.0% (193 of 193 strings)

Co-authored-by: Richard E. van der Luit <fedoraproject@veneax.nl>
Translate-URL: https://translate.fedoraproject.org/projects/systemd/master/nl/
Translation: systemd/main
2022-11-21 00:43:55 +09:00
Jan Janssen
967a868563 boot: Replace firmware security hooks directly
For some firmware, replacing their own security arch instance with our
override using ReinstallProtocolInterface() is not enough as they will
not use it. This commit goes back to how this was done before by
directly modifying the security protocols.

Fixes: #25336
2022-11-19 16:39:04 +01:00
Jan Janssen
5489c13bae boot: Rework security arch override
This simplifies the caller interface for security arch overrides by only
having to pass a validator and an optional context.
2022-11-19 16:37:27 +01:00
Jan Janssen
679007044f boot: Manually convert filepaths if needed
The conversion of a filepath device path to text is needed for the stub
loader to find credential files.
2022-11-19 16:36:02 +01:00
Jan Janssen
af7ef648cd boot: Do not require a loaded image path
If the device path to text protocol is not available (looking angrily at
Apple) we would fail to boot because we cannot get the loaded image
path. As this is only used for cosmetic purposes, we can just silently
continue.

Fixes: #25363
2022-11-19 16:36:02 +01:00