Commit Graph
45929 Commits
Author SHA1 Message Date
Lennart Poettering 7e472fc984 Merge pull request #29778 from yuwata/log-tests-skipped
tests: use log_tests_skipped() more
2023-10-31 11:19:10 +01:00
Lennart Poettering b3634c45d7 network-generator: add support for ip=link-local 2023-10-31 11:03:49 +01:00
Lennart Poettering ce3e9428ac network-generator: name enum for "ip=dhcp" case same as literal string
Let's make this less confusing, and use the same string externally as
enum name internally.
2023-10-31 10:56:31 +01:00
Yu Watanabe 2bd4959028 locale: drop implementation detail from comment in config file 2023-10-31 17:15:21 +09:00
Yu Watanabeandcunshunxia 0e7a7cd4e9 locale,firstboot: add headers to vconsole.conf
Closes #29717.
Replaces #29760.

Co-authored-by: cunshunxia <cunshunxia@tencent.com>
2023-10-31 17:15:21 +09:00
Yu Watanabe f155cb6d75 env-util: make write_env_file() optionally take headers
This also makes write_env_file() and write_env_file_label() optionally
take dir_fd, and drop write_env_file_at().

Preparation for later commits.
2023-10-31 17:15:21 +09:00
Yu Watanabe 78101ca9cc Merge pull request #29247 from naraghavan/naraghavan/dhcpv6-vendor-options
networkd: Add DHCP vendor specific sub options to dbus API
2023-10-31 17:14:20 +09:00
Yu Watanabe 84a594f4b3 tests: use log_tests_skipped() and friend more 2023-10-31 14:54:27 +09:00
Yu Watanabe 678fbf7eef tests: make log_tests_skipped() and friend accept format string 2023-10-31 14:46:38 +09:00
Yu Watanabe d19434fbf8 tree-wide: fix typo 2023-10-31 14:35:33 +09:00
Ronan Pigott 9968ca32cf network: free dhcp6_hostname
Fixes: b90480c80d ("network: introduce SendHostname/Hostname DHCPv6 options")
2023-10-31 14:26:44 +09:00
Raito Bezarius b9a0a13f7a secure-boot: print just before cold-resetting to help diagnose hangs
When testing the secureboot enroll feature, it can be hard to distinguish without
using the QMP API of QEMU whether we are in a hang situation of the UEFI firmware.

Making it clear that we reached the `ResetSystem` can be helpful towards that need.
2023-10-30 13:20:48 +00:00
Mike Yuan 77bd39385e sleep-config: allow setting empty HibernateMode= (use kernel default)
Both sleep_mode_supported and write_mode support this,
but parse_sleep_config currently prohibits this - it always
uses our default value if user specifies HibernateMode=<empty>.
2023-10-30 11:34:21 +00:00
Ronan Pigott b90480c80d network: introduce SendHostname/Hostname DHCPv6 options
These options were previously reused by the DHCPv6 client from the
DHCPv4 client settings. Let's separate them for consistency.
2023-10-30 11:04:10 +00:00
Luca Boccassi 7b6d3dcdd2 exec-invoke: don't double-close FDs on error
When a late error occurs in sd-executor, the cleanup-on-close of the
context structs happen, but at that time all FDs might have already
been closed via close_all_fds(), so a double-close happens. This
can be seen when DynamicUser is enabled, with a non-existing
WorkingDirectory.

Invalidate the FDs in the context structs if close_all_fds succeeds.
2023-10-28 16:56:25 +02:00
Mike Yuan 6d468648b9 Merge pull request #29740 from YHNdnzj/sleep-round-four
sleep: make sure we clear HibernateLocation on all error paths
2023-10-28 17:53:54 +08:00
Frantisek Sumsal f939a403ca tmpfiles: ignore EINVAL with --graceful
Add EINVAL to the list of ignored errnos, since acl_from_text() returns
EINVAL if it can't translate the given string.

~# cat /tmp/tmpfiles-test.conf
a+ /tmp/foo - - - - default:group:foo:rwx
~# build/systemd-tmpfiles /tmp/tmpfiles-test.conf --create --graceful
Failed to parse ACL "default:group:foo:rwx", ignoring: Invalid argument

Resolves: #29742
2023-10-28 10:14:07 +01:00
Lennart Poettering a868e43772 namespace: normalize MountMode type a bit
Let's prefix it with a common prefix, and make sure the names are all
singular and the string table actually matches the names.

No change in behavour, just some rafactoring to make this enum a bit
less special, and make it follow our usual coding style more closely.
2023-10-28 10:27:56 +09:00
Yu Watanabe 2aa246e88f Merge pull request #29693 from rpigott/dhcp-rapid-commit
network: implement RFC4039 DHCP Rapid Commit
2023-10-28 10:23:23 +09:00
Luca Boccassi f456fa23b7 Merge pull request #29737 from glance-/tpm2-openssl
tpm2: fix build failure without openssl
2023-10-27 23:21:44 +01:00
Luca Boccassi 8a505d3b6b Merge pull request #29734 from YHNdnzj/fstab-filter-options
fstab-generator: drop ignored mount options from mount unit Options=
2023-10-27 23:20:46 +01:00
Frantisek Sumsal b0bb3be130 core: don't insert an extra space before each SocketBind{Allow,Deny}= item
The extra space was actually screwing up deserialization:

~# systemd-run --wait --pipe -p SocketBindAllow=any true
Running as unit: run-u167.service
Finished with result: exit-code
Main processes terminated with: code=exited/status=234
Service runtime: 1ms
CPU time consumed: 0
~# journalctl -b -p err
...
Oct 27 16:39:15 arch systemd-executor[5983]: Failed to deserialize: Invalid argument

Let's not do that by default and introduce a simple wrapper which
inserts the space after each item only when necessary.
2023-10-27 20:08:47 +02:00
Frantisek Sumsal a4b156bb24 core: actually set the CPU scheduling policy when deserializing it 2023-10-27 19:50:06 +02:00
Mike Yuan cc1c8d129f sleep: make sure we clear HibernateLocation on all error paths
Also, let's say "sleep operation" rather than "sleep state",
the latter of which creates ambiguity with /sys/power/state.
2023-10-28 00:17:15 +08:00
Mike Yuan b3ee014879 fstab-generator: drop unapplicable mount options for / from mount unit Options=
Prompted by #29705

Note that x-systemd.wanted-by= and x-systemd.required-by= are not
dropped, since we ignore them because they are unnecessary rather
than unapplicable.
2023-10-27 23:51:01 +08:00
Luca Boccassi bb42782bff resolved: fix build failure with gnutls
Follow-up for bd1ae17833
2023-10-27 13:54:10 +01:00
Anton Lundin 5629d4e29f tpm2: fix build failure without openssl 2023-10-27 13:54:10 +01:00
Nandakumar Raghavan 6b44099b3b networkd: Add DHCP vendor specific options to dbus API
Add DHCP vendor specific options to expose in dbus API.
This will be added to the JSON output when we query
org.freedesktop.network1.Manager object.
2023-10-27 12:11:09 +00:00
Mike Yuan 122f6f1eaa sleep: minor modernization for lock_all_homes 2023-10-27 18:11:32 +08:00
Mike Yuan 78c21009bf sleep: rework write_state and write_mode 2023-10-27 18:11:29 +08:00
Mike Yuan 0374cbd668 sleep: update help text for suspend-then-hibernate 2023-10-27 17:57:03 +08:00
Mike Yuan 4706c3ec2b sleep: log about errno 2023-10-27 17:57:03 +08:00
Mike Yuan 37f80890b2 sleep: drop unneeded includes 2023-10-27 17:57:03 +08:00
Mike Yuan e024cdd270 sleep: introduce sleep_operation_is_hibernation 2023-10-27 17:57:03 +08:00
Mike Yuan ba2f3ec832 fstab-generator: use RET_GATHER more 2023-10-27 17:51:18 +08:00
xinpeng wang 2f1d114010 logind: fix abnormal switching causing the screen to go black
After logind receives the SIGRTMIN signal from the kernel, it will execute
manager_vt_switch---session_leave_vt---session_device_pause_all,The device
permissions of the session are removed here;under normal circumstances, the
tty value read from /sys/class/tty/tty0/active changes and switchesto a new
session,give the new session resume device permissions.
But under abnormal circumstances (such as switching quickly on a device using
wayland; and sometimes the kernel will suddenly send a SIGRTMIN signal, but
nothing changes),In these cases, logind does not give session resume device
permission, causing the device to have a black screen and suspended animation.
2023-10-27 10:19:58 +01:00
janana 2b4cdac91a udev: fix typo for persistent flag
The 'parsistent' adjective is misspelt.
2023-10-27 10:19:15 +01:00
Luca Boccassi 6cd1f6546c Merge pull request #29332 from esposem/ukify_simplify
ukify: automatically infer --signtool from the parameters given
2023-10-27 00:10:28 +01:00
Michal Sekletar 1e9b2e4fdd fstab-generator: drop nofail and noauto options for critical mounts
Setting nofail for /usr mount doesn't make sense because without /usr we
can't really boot. However, having the flag set might cause races in
initrd where we could try to switchroot into rootfs before /usr is
actually mounted. Let's just ignore it so that we always have proper
mount unit ordering for /sysroot/usr mount.
2023-10-27 00:07:54 +01:00
Ronan Pigott 808b65a087 network: implement RFC4039 DHCP Rapid Commit
This implements the DHCPv4 equivalent of the DHCPv6 Rapid Commit option,
enabling a lease to be selected in an accelerated 2-message exchange
instead of the typical 4-message exchange.
2023-10-26 15:26:50 -07:00
Ronan Pigott 5516b0dd20 network: cleanup unreachable condition in dhcp client path
The client state is unconditionally set just above, making this
conditional unreachable.
2023-10-26 15:26:50 -07:00
Lennart Poettering 7113640493 fd-uitl: rename PIPE_EBADF → EBADF_PAIR, and add EBADF_TRIPLET
We use it for more than just pipe() arrays. For example also for
socketpair(). Hence let's give it a generic name.

Also add EBADF_TRIPLET to mirror this for things like
stdin/stdout/stderr arrays, which we use a bunch of times.
2023-10-26 22:30:42 +02:00
Raul Cheleguini 5e21da878c nspawn: Make parameter provided_mac a const for setup_veth() 2023-10-26 21:17:29 +01:00
Luca Boccassi b44a72da57 Merge pull request #29711 from berrange/tests-silverblue
Fix test suite when developing on Fedora SilverBlue (rpm-ostree) host
2023-10-26 21:17:03 +01:00
Luca Boccassi 554a25eb9d Merge pull request #29727 from aafeijoo-suse/default-tpm2-public-key-fix
tpm2: fixes related to `tpm2-pcr-public-key.pem`
2023-10-26 21:16:07 +01:00
Luca Boccassi 63862de4b7 core: do not post-process skipped mounts
When a mount is gracefully skipped (e.g.: BindReadOnlyPaths=-/nonexistent)
we still post-process it, like making it read-only. Except if nothing
has been mounted, the mount point will be made read-only for no reason.
Track when mounts are skipped and avoid post-processing.

One day we'll switch all of this to the new mount api and do these
operations atomically or not at all.

Fixes https://github.com/systemd/systemd/issues/29725
2023-10-26 21:15:41 +01:00
Richard Maw 31cfcf5008 test: Skip test-recurse-dir on overlayfs 2023-10-26 19:11:21 +01:00
Daan De Meyer 7b794ba019 mkfs-util: Use actual UID/GID in protofile instead of root 2023-10-26 19:10:31 +01:00
Antonio Alvarez Feijoo 2e9f607284 repart: do not ignore tpm2-pcr-public-key.pem
If `--tpm2-public-key=` is not specified, but `tpm2-pcr-public-key.pem` exists
in /{etc,run,usr/lib}/systemd/, it's being ignored.

Fixes 9e437994
2023-10-26 16:51:37 +02:00
Daniel P. Berrangé 6aa77f9284 test-blockdev-util: avoid abort when /home is a symlink
On rpm-ostree distributions like Fedora SilverBlue /home (and various
other well known locations) are symlinks to somewhere beneath /var.

The path_is_encrypted() method uses O_NOFOLLOW and as a result will
return ELOOP on /home. This causes test-blockdev-util to abort.
Add ELOOP to the ignorable set of errnos for testing.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2023-10-26 14:46:15 +01:00