1
0
mirror of https://github.com/systemd/systemd.git synced 2024-12-22 17:35:35 +03:00
Commit Graph

67169 Commits

Author SHA1 Message Date
Daan De Meyer
bcc911a7d7 mkosi: Conditionally use tools tree
If the systemd version on the host is too old and there's no local
build directory, use the default tools tree which will build an
image containing all the tooling required to build systemd and use
that to build the other presets.
2023-09-09 15:53:26 +02:00
Daan De Meyer
a940484ee5 mkosi: Only build system preset by default
Let's not build all presets by default, but only the system preset.
Also, let's only make the system preset depend on the initrd preset
if we're building a bootable disk image. This means that if we build
the system image as a cpio, uki or directory, the initrd preset will
be skipped as it's not necessary, making the build a little faster.
2023-09-09 15:45:49 +02:00
Daan De Meyer
076a16dee8 mkosi: Move to Fedora 39 2023-09-09 15:45:48 +02:00
Daan De Meyer
aa72f856a1 mkosi: Update to latest 2023-09-09 15:45:41 +02:00
Lennart Poettering
0df7d52576 serialize: add common deserialize_read_line() helper and use it everywhere
This introduces a common helper replacing three very similar uses.

Prompted by review of: #27890
2023-09-08 20:59:44 +01:00
Mike Yuan
93f1da4556 conf-parser: parse main config first only if not symlinked to/as drop-in
Otherwise we'll skip parsing main config directly.

Replaces #27152
Replaces #28956:
chase() is an overkill for determining whether
two files are the same. We only need to check
if the inodes are the same.
2023-09-08 16:25:12 +02:00
Mike Yuan
fc159b2fd9 repart,bootspec: use set_ensure_consume 2023-09-08 16:25:12 +02:00
Alvin Alvarado
a05fa30f88 ukify/man: Look for a config file in systemd folders if not specified
If the user does not specify a config file to use, ukify will try looking for one at {/run,/etc,/usr/local/lib,/usr/lib}/systemd/ukify.conf in order and then use the first one found. Also made sure the --config input is a pathlib.Path by specifying its type in its CONFIG_ITEMS entry.
Big cheers to Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> for helping!
2023-09-08 16:21:28 +02:00
Mike Yuan
b8f18c3089
Merge pull request #29123 from yuwata/conf-parser-cleanups-for-config-section
conf-parser: several cleanups and generalizations for ConfigSection
2023-09-08 18:11:12 +08:00
Luca Boccassi
30a0f7e310
Merge pull request #29121 from yuwata/network-drop-duplicated
network: drop duplicated checks and function calls
2023-09-08 10:42:08 +01:00
Lennart Poettering
fea82394bc
Merge pull request #29071 from YHNdnzj/loop-write-full
io-util: introduce loop_write_full and use it where appropriate
2023-09-08 10:24:39 +02:00
Daan De Meyer
6ec74f916a mkosi: Drop arch workaround
archlinux-keyring was updated in Michel's PPA so let's drop the
workaround.
2023-09-08 09:20:46 +01:00
Yu Watanabe
e63c6e9ffa conf-parser: introduce ordered_hashmap_by_section_find_unused_line() 2023-09-08 12:55:44 +09:00
Yu Watanabe
d9171a230d conf-parser: check overflow in hashmap_find_free_section_line()
Also, this also renames the function, and makes it optionally takes
a filename.
2023-09-08 12:55:44 +09:00
Yu Watanabe
08ca764d0a conf-parser: modernize config_section_new()
- add assertions,
- rename argument to store result.
2023-09-08 12:55:44 +09:00
Yu Watanabe
7bf9e0d5f6 hashmap: introduce HASHMAP_BASE_FOREACH() and friend 2023-09-08 12:55:44 +09:00
Yu Watanabe
f7f5028edc network: drop duplicated check
The same check is in network_adjust_dhcp_server().
2023-09-08 06:41:37 +09:00
Yu Watanabe
0ae8ff50ac network: drop duplicated address_set_broadcast()
It will be called later in link_request_address().
2023-09-08 06:41:37 +09:00
Frantisek Sumsal
3bf7d79637 ci: temporarily disable Packit's i386
As it currently crashes when extracting debuginfo due to [0] and hangs
until it's killed by the watchdog (which takes ~5 hours).

[0] https://bugzilla.redhat.com/show_bug.cgi?id=2237392
2023-09-07 22:22:56 +01:00
Lennart Poettering
4bba26aea6 tpm2-util: drop support for creating TPM2 trial sessions
This is unused these days, we instead calculate policy hashes ourselves
and do not need trial sessions for that anymore. Given how unreliable
they are in actual TPMs, we don't want to use them anyway, so I don't
think we ever want to readd this.

hence, let's drop this unused feature.
2023-09-07 20:41:54 +01:00
Jan Janssen
b7801869d7 efi: Add some more paranoia asserts 2023-09-07 20:41:12 +01:00
Zbigniew Jędrzejewski-Szmek
c63db5420c
Merge pull request #29036 from YHNdnzj/hibernate-resume-when-battery-low
hibernate-resume: split out the logic of finding hibernate location and support battery-check better
2023-09-07 17:34:27 +02:00
наб
ef658a63f8 parse_timestamp: accept RFC3339-style timezone and %FT%R[:%S[.%N]]
We basically parsed the RFC3339 format already, except with a space:
      NOTE: ISO 8601 defines date and time separated by "T".
      Applications using this syntax may choose, for the sake of
      readability, to specify a full-date and full-time separated by
      (say) a space character.
so now we handle both
  2012-11-23 11:12:13.456
  2012-11-23T11:12:13.456
as equivalent.

Parse directly-suffixed Z and +05:30 timezones as well:
  2012-11-23T11:12:13.456Z
  2012-11-23T11:12:13.456+02:00
as they're both defined by RFC3339.

We do /not/ allow z or t; the RFC says
      NOTE: Per [ABNF] and ISO8601, the "T" and "Z" characters in this
      syntax may alternatively be lower case "t" or "z" respectively.

      This date/time format may be used in some environments or contexts
      that distinguish between the upper- and lower-case letters 'A'-'Z'
      and 'a'-'z' (e.g. XML).  Specifications that use this format in
      such environments MAY further limit the date/time syntax so that
      the letters 'T' and 'Z' used in the date/time syntax must always
      be upper case.  Applications that generate this format SHOULD use
      upper case letters.
We /are/ in a case-sensitive environment, neither are in wide-spread
use, and "z" poses an issue of whether "todayz" should be the same
as "todayZ" ("today UTC") or an error (it should be an error).

Fractional seconds are limited to six digits (they're nominally
   time-secfrac    = "." 1*DIGIT
), since we only support 1µs-resolution timestamps, and limit to six
digits in our other sub-second formats.

Parsing
  2012-11-23T11:12
is an extension two ways (no seconds, no timezone),
mirroring our "canonical" format.

Fixes #5194
2023-09-07 17:33:15 +02:00
Mike Yuan
3a1fc3860f
shared/wall: use loop_write_full 2023-09-07 20:32:45 +08:00
Mike Yuan
e22c60a9d5
io-util: introduce loop_write_full that takes a timeout
Also drop do_poll as the use case is covered
by timeout.
2023-09-07 20:30:44 +08:00
Mike Yuan
89a1bb9012
units: order battery-check before hibernate-resume 2023-09-07 20:21:16 +08:00
Mike Yuan
a628d933cc
hibernate-resume: split out the logic of finding hibernate location
Before this commit, the hibernate location logic only exists in
the generator. Also, we compare device nodes (devnode_same()) and
clear EFI variable HibernateLocation in the generator too. This is
not ideal though: when the generator gets to run, udev hasn't yet
started, so effectively devnode_same() always fails. Moreover, if
the boot process is interrupted by e.g. battery-check, the hibernate
information is lost.

Therefore, let's split out the logic of finding hibernate location.
The generator only does the initial validation of system info and
enables systemd-hibernate-resume.service, and when the service
actually runs we validate everything again, which includes comparing
the device nodes and clearing the EFI variable. This should make
things more robust, plus systems that don't utilize a systemd-enabled
initrd can use the exact same logic to resume using the EFI variable.
I.e., systemd-hibernate-resume can be used standalone.
2023-09-07 20:21:16 +08:00
Lennart Poettering
82b7bf8c1c
Merge pull request #28957 from yuwata/core-mount-set-dirty-on-umount
core/credential,mount: re-read /proc/self/mountinfo before invoking umount command
2023-09-07 11:54:52 +02:00
Christian Kirbach
8e2d9d40b3 po: Translated using Weblate (German)
Currently translated at 85.4% (194 of 227 strings)

Co-authored-by: Christian Kirbach <christian.kirbach@gmail.com>
Translate-URL: https://translate.fedoraproject.org/projects/systemd/master/de/
Translation: systemd/main
2023-09-07 07:08:28 +09:00
Zbigniew Jędrzejewski-Szmek
1c5d54b2df test: use 'until' instead of 'while !'
In general, it's better to avoid a negation. And "!" is special, because it is
used for history expansion, i.e. the same command would behave differently if
pasted on the command line.

Inspired by 4a899c5a23.
2023-09-06 19:54:29 +01:00
David Santamaría Rogado
8b7f0eb6a8 hwdb: keyboard: D330 FnLk toggle
Map Fn+Tab to fn_esc as is FnLock toggle in this keyboard. Still doesn't behave as expected because work in ideapad_laptop kernel module could be required but now at least we report the same mapping in others keyboards with Fn+ESC for FnLock and not unknown.

Signed-off-by: David Santamaría Rogado <howl.nsp@gmail.com>
2023-09-06 19:00:29 +01:00
Luca Boccassi
7d84904925
Merge pull request #29098 from keszybz/man-page-postreview-fixup
man/systemd-id128: fix example
2023-09-06 18:58:27 +01:00
Jan Janssen
400229eaae man: Add new Microsoft CAs to example
Also, let's use the links from the Microsoft documentation as they are
guaranteed to be stable.

Fixes: #29102
2023-09-06 18:56:51 +01:00
Lennart Poettering
ef65c0f6cc openssl-util: add common implementation of digest+sign 2023-09-06 18:34:21 +01:00
Yu Watanabe
1e1225614c core/credential,mount: re-read /proc/self/mountinfo before invoking umount command
When a unit has credentials, stopping the service unmounts the credentials
directory. On shutdown, stopping the service and the corresponding mount
unit may be done mostly simultaneously, and if we invoke umount command soon
after umount() being called on stopping the service, the mount unit will
fail.

This makes Mount.invalidated_state flag set when umount() is called for a path,
and re-read /proc/self/mouninfo before invoking umount command if the flag is set.

Fixes #25527.
Replaces #26959.
2023-09-07 01:05:13 +09:00
Yu Watanabe
25033cca08 test-execute: check credentials can be read on ExecStartPost= and friends
Prompted by
https://github.com/systemd/systemd/pull/28787#issuecomment-1690614202.
2023-09-07 00:53:28 +09:00
Yu Watanabe
133e4de23f core/exec-credential: introduce exec_context_get_credential_directory() helper function
No functional change, just refactoring.
2023-09-07 00:53:28 +09:00
Yu Watanabe
43962c30fb core: rename credential.[ch] -> exec-credential.[ch]
Also rename setup_credentials() -> exec_setup_credentials().

Addresses the post-merge review
https://github.com/systemd/systemd/pull/28787#pullrequestreview-1592065048.
2023-09-07 00:53:28 +09:00
Yu Watanabe
73ff4d48de Revert "core: do not leak mount for credentials directory if mount namespace is enabled"
This reverts commits
- 9ae3624889
  "test-execute: add tests for credentials directory with mount namespace"↲
- 94fe4cf255
  "core: do not leak mount for credentials directory if mount namespace is enabled",
- 7241b9cd72
  "core/credential: make setup_credentials() return path to credentials directory",
- fbaf3b23ae
  "core: set $CREDENTIALS_DIRECTORY only when we set up credentials"

Before the commits, credentials directory set up on ExecStart= was kept
on e.g. ExecStop=. But, with the changes, if a service requests a
private mount namespace, the credentials directory is discarded after
ExecStart= is finished.

Let's revert the change, and find better way later.

Addresses the post-merge comment
https://github.com/systemd/systemd/pull/28787#issuecomment-1690614202.
2023-09-07 00:53:28 +09:00
Zbigniew Jędrzejewski-Szmek
bf91ab6e1e id128: add forgotten option to --help 2023-09-06 16:58:50 +02:00
Zbigniew Jędrzejewski-Szmek
b477c6949a man/systemd-id128: fix example
The example was supposed to show how
machine-id/new/machine-id --app-specific/show --app-specific tie together, but
the verb was ommitted.

I also extended the explanation a bit and used long option form in the first
example for more clarity. In the second, more complicated example, the
one-letter form is used for brevity.

Noticed in post-review:
b37e8184a5 (r1315678438)
2023-09-06 16:56:40 +02:00
Thorsten Kukuk
53c0397b1d shared/wall: use logind if build without utmp support
If systemd is build without utmp support, use sd_get_sessions() in
utmp_wall() to get a list of logged in users with the corresponding tty.
2023-09-06 13:19:26 +01:00
Yu Watanabe
468018703c core: allow to run generators without sandboxing on qemu-user
When running on non-native userland architecture via systemd-nspawn
and qemu-user-static QEMU-emulator, clone() with CLONE_NEWNS fails with
EINVAL.

Fixes #28901.

[zjs: add a comment in the code]
2023-09-06 13:18:50 +01:00
Luca Boccassi
ed11d58658
Merge pull request #29101 from DaanDeMeyer/kernel
mkosi: More kernel fixes
2023-09-06 13:18:01 +01:00
Daan De Meyer
cbe7778f4c mkosi: Don't disable CONFIG_USB
Having USB enabled seems useful enough, this wasn't doing anything
regardless because we already enable CONFIG_USB earlier in the kconfig
file so this just gets rid of warning.
2023-09-06 12:58:30 +02:00
Daan De Meyer
1ca30ea8c5 mkosi: Don't build hid selftests
We don't build our kernel with hid support so don't build the selftests
either.
2023-09-06 12:57:57 +02:00
Daan De Meyer
ac82e7acbc mkosi: Enable two more kernel configs
Required for some bpf selftests so let's enable these in our config.
2023-09-06 11:39:39 +01:00
Luca Boccassi
f557df6a46
Merge pull request #29099 from medhefgo/ci
ci: Misc improvements
2023-09-06 11:11:51 +01:00
Lennart Poettering
354e5b8873 update TODO 2023-09-06 12:05:21 +02:00
Jan Janssen
690db0c80f ci: Do not run build test as root
Although, this is CI, we can still do better. It also ensures that any
env var changes make it into the script, as things like PATH would not
survive a `sudo -E`.
2023-09-06 11:01:53 +02:00