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

69668 Commits

Author SHA1 Message Date
Luca Boccassi
08542781e2
Merge pull request #30531 from yuwata/trivial-cleanups
Trivial cleanups
2023-12-19 23:19:25 +01:00
Yu Watanabe
5d889f3ab8 signal-util: align table 2023-12-20 03:07:46 +09:00
Yu Watanabe
97df9fa065 time-util: make usleep_safe() return earlier if 0 is passed 2023-12-20 03:07:46 +09:00
Daan De Meyer
06cfce8671
Merge pull request #30527 from DaanDeMeyer/sys
test: Skip various tests when /sys is not mounted
2023-12-19 18:59:09 +01:00
Daan De Meyer
a412a1b92a test: Skip various tests when /sys is not mounted
When running tests in a container, /sys might not be mounted, so
let's make sure we skip tests that depend on /sys in this case.
2023-12-19 16:38:57 +01:00
Daan De Meyer
79f44fb8a1 test: Make sure SYSTEMD_HWDB_UPDATE_BYPASS is disabled in the hwdb test
Let's make this test independent on what's in the environment.
2023-12-19 16:01:54 +01:00
Daan De Meyer
53ea4d7a47 mkosi: Add strace and gdb to base image build packages
For debugging failing tests in combination with mkosi's --debug-shell.
2023-12-19 15:59:16 +01:00
Matteo Croce
b408d46b83 systemctl: show success messages when showing transaction
Extend `--show-transaction` so it shows a success message when an unit
is successfully started.
2023-12-19 04:52:41 -08:00
Matteo Croce
e22ad53d5c dbus-wait-for-jobs: change 'quiet' flag to enum
Change the 'quiet' flag to `bus_wait_for_jobs()` to an enum, so we can
select with more granularity the type of information logged.
2023-12-19 04:52:41 -08:00
Frantisek Sumsal
97e52d62fb Revert "mkosi: pin CentOS8 kernel to working version"
A fixed kernel finally landed on mirrors, so let's revert the C8S kernel
pin.

This reverts commit a64398b2ca1cdaee291550face0d1ce5f8ea52f6.
2023-12-19 12:48:55 +00:00
Yu Watanabe
422d8905c0 find-esp: add debugging log about failure in parsing env variable
Addresses https://github.com/systemd/systemd/pull/30321#discussion_r1429716344.
2023-12-19 12:01:26 +01:00
Lukas Nykryn
3b2e7dc5a2 udev: allow/denylist for reading sysfs attributes when composing a NIC name
Users can currently pick specific versions of NIC naming, but that
does not guarantee that NIC names won't change after the kernel adds
a new sysfs attribute.

This patch allows for an allow/deny list of sysfs attributes
that could be used when composing the name.

These lists can be supplied as an hwdb entry in the form of
/etc/udev/hwdb.d/50-net-naming-allowlist.hwdb
net:naming:drvirtio_net
  ID_NET_NAME_ALLOW=0
  ID_NET_NAME_ALLOW_ACPI_INDEX=1
  ID_NET_NAME_ALLOW_ADDR_ASSIGN_TYPE=1
  ID_NET_NAME_ALLOW_ADDRESS=1
  ID_NET_NAME_ALLOW_ARI_ENABLED=1
  ID_NET_NAME_ALLOW_DEV_PORT=1
  ID_NET_NAME_ALLOW_FUNCTION_ID=1
  ID_NET_NAME_ALLOW_IFLINK=1
  ID_NET_NAME_ALLOW_INDEX=1
  ID_NET_NAME_ALLOW_LABEL=1
  ID_NET_NAME_ALLOW_PHYS_PORT_NAME=1
  ID_NET_NAME_ALLOW_TYPE=1
2023-12-19 19:15:52 +09:00
Vladimir Stoiakin
06b7738287 cryptsetup: convert a EC point to compressed format if required by a token 2023-12-19 13:14:16 +03:00
Vladimir Stoiakin
3d05c05873 cryptsetup: Add support for EC keys in PKCS#11 tokens
Since EC keys doesn't support encryption directly, we use ECDH protocol.
We generate a pair of EC keys in the same EC group, then derive a shared secret using the generated private key and the public key in the token.
The derived shared secret is used as a volume key. The generated public key is stored in the LUKS2 JSON token header area. The generated private key is erased.
To unlock a volume, we derive the shared secret with the stored public key and a private key in the token.

Co-authored-by: MkfsSion <mkfssion@mkfssion.com>
2023-12-19 13:14:16 +03:00
Vladimir Stoiakin
876206f267 cryptenroll, homectl: deduplicate generation of LUKS2 volume keys 2023-12-19 13:14:16 +03:00
Yu Watanabe
91436851d5
Merge pull request #30491 from fbuihuu/vconsole-handle-kd-grahpics-mode
vconsole-setup: handle the case where the vc is in KD_GRAPHICS mode m…
2023-12-19 11:49:31 +09:00
Lennart Poettering
8722c7e7bc siphash: make sure siphash24_compress_usec_t() works the same on LE/BE archs
Let's be systematic here, and always hash LE values. It doesn't matter
in our current codebase, but it might one day.
2023-12-19 11:48:53 +09:00
Yu Watanabe
03251a0b40
Merge pull request #30518 from mrc0mmand/assorted-tweaks
A couple of assorted tweaks
2023-12-19 11:48:40 +09:00
Lennart Poettering
e22ca70008 ether-addr-util: split out logic to mark MAC addresses as random 2023-12-19 11:48:05 +09:00
Frantisek Sumsal
32c376a46c test: add missing operators
Without them only the last expression's return value is honored, causing
unexpected CI fails:

[   26.006721] testsuite-04.sh[1191]: + for _ in {0..9}
[   26.007672] testsuite-04.sh[1191]: + setterm --term linux --dump --file /tmp/console.dump
[   26.008871] testsuite-04.sh[1233]: + SYSTEMD_COLORS=256
[   26.009606] testsuite-04.sh[1233]: + /usr/lib/systemd/systemd-bsod
[   26.063296] systemd[1]: session-1.scope: Deactivated successfully.
[   26.124789] testsuite-04.sh[1191]: + grep -aq 'Press any key to exit' /tmp/console.dump
[   26.131509] testsuite-04.sh[1191]: + grep -aq 'Root emergency message' /tmp/console.dump
[   26.137882] testsuite-04.sh[1191]: + grep -aq 'The current boot has failed' /tmp/console.dump
[   26.141650] testsuite-04.sh[1191]: + return 0
[   26.144816] testsuite-04.sh[1191]: + grep -aq 'Scan the QR code' /tmp/console.dump
[   26.153591] testsuite-04.sh[1191]: + at_exit
[   26.154744] testsuite-04.sh[1191]: + local EC=1
[   26.155697] testsuite-04.sh[1191]: + [[ 1 -ne 0 ]]
[   26.156787] testsuite-04.sh[1191]: + [[ -e /tmp/console.dump ]]
[   26.157799] testsuite-04.sh[1191]: + cat /tmp/console.dump
[   26.158858] testsuite-04.sh[1244]:    The current boot has failed!
[   26.159858] testsuite-04.sh[1244]:    Root emergency message

I'm genuinely impressed that this worked at all.
2023-12-19 11:47:17 +09:00
Ronan Pigott
d4fd7fb5d7 typo: transer -> transfer 2023-12-19 11:46:47 +09:00
Frantisek Sumsal
e80c6ea740 pcrlock: use empty_or_dash() more 2023-12-18 17:26:19 +01:00
Frantisek Sumsal
3c4d0ec940 analyze: use strempty() 2023-12-18 17:25:10 +01:00
Frantisek Sumsal
31dcc1b4ba man: avoid potential shell expansion in systemctl's example
Resolves: #30014
2023-12-18 17:09:06 +01:00
Frantisek Sumsal
159d1e2659 journalctl: also refuse --cursor-file= with --since=
We already refuse the other two cursor-related options (--cursor= and
--after-cursor=) with --since=, so let's do the same with
--cursor-file=.

Closes: #20523
2023-12-18 17:06:43 +01:00
Lennart Poettering
803b2a51fb update TODO 2023-12-18 16:34:15 +01:00
Luca Boccassi
c2d5d8c401
Merge pull request #30464 from CodethinkLabs/misc-integration-test-fixes
Misc integration test fixes
2023-12-18 16:11:16 +01:00
Luca Boccassi
e7bfce0d0a
Merge pull request #30492 from mrc0mmand/skip-TEST-08-without-systemd-in-initrd
test: skip TEST-08-INITRD if systemd didn't run in the initrd
2023-12-18 16:10:33 +01:00
Franck Bui
0d29fd46d1 vconsole-setup: remember the correct error value when open_terminal() fails 2023-12-18 15:48:56 +01:00
Franck Bui
58161db61b vconsole-setup: handle the case where the vc is in KD_GRAPHICS mode more gracefully
Regardless of whether a vc path is passed, the behavior of
systemd-vconsole-setup wasn't ideal when either the passed vc or /dev/tty1 was
in graphics mode.

When a vc in graphics mode was passed, no message was emitted despite the fact
that the font settings couldn't be applied. The previous code might have
assumed that setfont(8) would throw a warning but that's not case.

When no argument was passed, systemd-vconsole-setup was supposed to
automatically select a valid tty, init it and copy the font setting to the
remaining ttys. However if the selected virtual console was in KD_GRAPHICS mode
the initialization of the font failed not only for the selected source vc but
for all of them.
2023-12-18 15:48:53 +01:00
Frantisek Sumsal
6277e47127
Merge pull request #30508 from topimiettinen/fix-flaky-test-address-static
test-network: fix racy test for address_static
2023-12-18 14:43:26 +00:00
Topi Miettinen
0e808f622b test-network: accept kernel versions like 1.2.3+ (self-built) 2023-12-18 14:40:21 +00:00
Lennart Poettering
f5fcf851b5
Merge pull request #30515 from poettering/dnslabelmax
extend most DNS label buffers by one
2023-12-18 15:12:27 +01:00
networkException
4e0db87e4c core: allow interface altnames in RestrictNetworkInterfaces=
This patch enables IFNAME_VALID_ALTERNATIVE for checks guarding the
parsing of RestrictNetworkInterfaces=.

The underlying implementation for this option already supports
altnames.
2023-12-18 15:12:10 +01:00
Lennart Poettering
a19e7f3101
Merge pull request #30321 from yuwata/find-esp
find-esp: gracefully handle btrfs RAID
2023-12-18 15:11:54 +01:00
Lennart Poettering
dadc06bc6c
Merge pull request #30150 from poettering/homectl-interactive
add "homectl firstboot" verb, that runs at first boot and can create a user, interactively or from creds
2023-12-18 15:11:23 +01:00
Lennart Poettering
360b9db31d 64bit mount id 2023-12-18 14:56:45 +01:00
Daan De Meyer
c88753db45 shutdown: Send EXIT_STATUS before final sync
There's a race condition where the EXIT_STATUS= message we send
just before shutting down the VM doesn't arrive on the host,
presumably because the VM is shut down before the kernel has had a
chance to forward the message to the host.

Since there's no obvious way to wait until the message has been
flushed to the host, let's send the message before we execute the
final sync() instead of after executing the final sync(). In my
testing, this seems to either guarantee the message is sent or
introduces sufficient delay that the kernel always has time to flush
its socket buffers to the host.
2023-12-18 13:21:17 +01:00
Lennart Poettering
604cfd1e4a update TODO 2023-12-18 11:11:17 +01:00
Lennart Poettering
641489e257 mkosi: use systemd.firstboot=no to turn of interactivity at boot
Now that creds are processed even if systemd.firstboot=no is set, we can
use it to disable the root pw prompt *and* the new homectl prompt at the
same time, without breaking the creds stuff.
2023-12-18 11:11:11 +01:00
Lennart Poettering
3ccadbce33 homectl: add "firstboot" command
This extends what systemd-firstboot does and runs on first boots only
and either processes user records passed in via credentials to create,
or asks the user interactively to create one (only if no regular user
exists yet).
2023-12-18 11:10:53 +01:00
Lennart Poettering
0a9c4a1082 firstboot: adjust what systemd.firstboot=no on the kernel cmdline does
So far by setting systemd.firstboot=no simply short-cut the whole tool
and made it exit early. This is against what the docs say though: they
just claim the user isn't asked for questions anymore. Let's change
behaviour so that the code actually matches the docs, or more
specifically: if credentials are passed into firstboot, then honour
them, regardless of the kernel cmdline option.

After all, if we get explicit data passed in we should operate on it,
and then leave systemd.firstboot=no just affect the interactivity.

I think this was actually mostly a bug introduced because the credential
stuff was added after the kernel cmdline option, hence this just catches
up with the new addition.
2023-12-18 11:10:47 +01:00
Lennart Poettering
6f9dd36990 homectl: when taking a JSON user record as input, strip secttions we don't want rather than complain about them
This makes it easier to take a user record from one host and create an
identical user on another.
2023-12-18 11:10:40 +01:00
Lennart Poettering
58982cf0cb creds-util: add helper for opening the credentials directory 2023-12-18 11:10:14 +01:00
Lennart Poettering
68f74b0af2
Merge pull request #30479 from keszybz/man-pages-synopsis-layout
Man pages synopsis layout
2023-12-18 10:44:58 +01:00
Lennart Poettering
d393666403 specifier: use mempcpy() where we can 2023-12-18 10:28:03 +01:00
Lennart Poettering
fd7e988700 resolved: increase most label buffers to fit a trailing NUL byte
This is just paranoia. In all these cases we don't really care about the
trailing NUL byte. But if there's space for it dns_label_unescape() is
going to insert it, and that's a good safety strategy.

This is a follow-up to c29c3adefa8cd859f8cb87d9ad62f3d77b7cd102 which
fixed an actual bug, unlike this commit, which is just paranoia.
2023-12-18 10:27:27 +01:00
Mike Yuan
ccf695a4cf
Merge pull request #30482 from YHNdnzj/ferror-handling
A few fixes for ferror() handling
2023-12-18 14:42:22 +08:00
Yu Watanabe
7d11a20ee4
Merge pull request #30494 from keszybz/trivial-cleanups
Trivial cleanups
2023-12-18 08:25:02 +09:00
Topi Miettinen
f432aa9083
Revert "test: temporarily skip checking NFT sets in test_address_static"
This reverts commit e4a80de119c5ce022396b436690f6321f4bb626b.
2023-12-17 18:01:42 +02:00