Commit Graph
89185 Commits
Author SHA1 Message Date
Yu Watanabe 7e77105988 test-network: follow-up for modem manager test and add test case for networkctl dhcp-lease (#42203) 2026-05-21 09:10:30 +09:00
Lennart Poettering 85d47bfa92 firstboot: make clear where the full screen console wizards end
The three first boot screens are visually separated from the console
output before them via the "chome" and welcome strings and sufficient
whitespace. But so far they weren't from the output after them. This is
sometimes a big confusing. Let's add a bit of a separator between the
end and what comes next, too.

Just cosmetics, nothing else.
2026-05-21 09:09:38 +09:00
Yu Watanabe 6cb65dacd1 vmspawn: rearrange --help and man page a bit (#42200)
This does not change man page or --help contents at all, but it does
introduce new sections, and moves some knobs between sections. It also
reorders things in the man page so that man page and --help show items
in the same order again.
2026-05-21 09:07:34 +09:00
Lennart Poettering 20ab4a8b15 report: use new --help formatting calls 2026-05-21 09:05:26 +09:00
Yu Watanabe 0080566c92 test-network: add test cases for 'networkctl dhcp-lease' command
Addresses the request:
https://github.com/systemd/systemd/pull/42137#pullrequestreview-4305664376
2026-05-21 07:51:16 +09:00
Yu Watanabe 18f2e9bcfa test-network: try to stop test-modem-manager-mock.service only when necessary
Otherwise, all test cases that does not create/start the service emits
the following error:
```
Failed to stop test-modem-manager-mock.service: Unit test-modem-manager-mock.service not loaded.
```

Moreover, without this change, extra 'systemctl daemon-reload' is triggered after
all test cases. That's super heavy, especially when the test is running on
sanitizers.

Follow-up for abe3d570f8.
2026-05-21 07:10:50 +09:00
Yu Watanabe ba13cd1245 include: update kernel headers from v7.1-rc4
It seems there is no notable changes to us.
2026-05-21 07:07:37 +09:00
Yu Watanabe 52421acf17 test-network: use networkctl_status() helper function at one more place 2026-05-21 07:06:32 +09:00
Yu Watanabe 8e7665f87f Bump minimum required version of musl to 1.2.6 (#42208)
musl v1.2.6 has been released on 2026-03-20, and alpine-edge already has it:
https://pkgs.alpinelinux.org/package/edge/main/x86_64/musl
2026-05-21 07:04:12 +09:00
Luca Boccassi 8b675d315b mkosi: update debian commit reference to 3e1930512d1efee7e11b619a5f493b3229594a51
* 3e1930512d Downgrade dependency on dbus to recommends in sd-container
* 61d6ecf0a0 Conflict with sysuser-helper
* fbc4646437 autopkgtest: add dependency on procps
2026-05-20 22:46:56 +01:00
Lennart Poettering 95fe2d07ed man: order --secure-boot= to the same location in man page as in --help for vmspawn 2026-05-20 23:40:22 +02:00
Lennart Poettering b12a365866 vmspawn: move --kernel=/--initrd= under the "Execution" section
This has little to do with host configuration (where it was so far), and
a lot with what being executed, let's move it over.

Note that --help and man page so far differed here quite a bit: the
former had the "Execution" section, the latter didn't. This creates it
in the man page, to bring the two back in sync.
2026-05-20 23:39:47 +02:00
Lennart Poettering 183ec272ef vmspawn: split out networking related options into its own "Networking" section in --help 2026-05-20 23:38:30 +02:00
Lennart Poettering f9a40f7aa3 vmspawn: split 'Integration' section into 'Logging' and 'SSH'
Each of the two has multiple options, hence let's split them out.
2026-05-20 23:37:32 +02:00
Lennart Poettering 1a0b17df32 vmspawn: move image related knobs close to --image=
(Also, arrange the order if the image options group in the man page to
the same as in the --help text)
2026-05-20 23:37:31 +02:00
Yu Watanabe 6a35ae68cb NEWS: mention bump of musl requirement 2026-05-21 05:06:35 +09:00
Yu Watanabe 12b9760800 musl: drop several statx definitions
Those dropped definitions have been provided since musl v1.2.6.
2026-05-21 05:06:35 +09:00
Yu Watanabe bc40f6cc32 musl: drop renameat2() wrapper
musl provides renameat2() since v1.2.6:
https://git.musl-libc.org/cgit/musl/commit/?id=05ce67fea99ca09cd4b6625cff7aec9cc222dd5a
2026-05-21 05:06:35 +09:00
Yu Watanabe f405aa53c3 README: bump required minimum version of musl to 1.2.6
musl v1.2.6 has been released on 2026-03-20:
https://git.musl-libc.org/cgit/musl/commit/?id=9fa28ece75d8a2191de7c5bb53bed224c5947417

alpine/postmarketos already have musl v1.2.6 in the edge repository:
https://pkgs.alpinelinux.org/package/edge/main/x86_64/musl

Also, Yocto Project 6.0 (wrynose) already has v1.2.6.

Let's bump the requirement now.
2026-05-21 05:06:35 +09:00
Philip Withnall 8c0f9073c7 updatectl: Add a --no-ask-password argument
While commit 83c1e8ff5f added support for interactive polkit
authentication in `updatectl`, some users might want to disable that for
some use cases; so add the standard `--no-ask-password` argument.

Signed-off-by: Philip Withnall <pwithnall@gnome.org>
Helps: https://github.com/systemd/systemd/issues/37412
2026-05-21 04:24:55 +09:00
Yu Watanabe bcbae0c132 Couple of rearragements for src/core/meson.build (#42207)
Net result is `import-creds.c` moving from libcore to systemd
2026-05-21 04:18:14 +09:00
Daan De Meyer 393b908669 ci: run the musl build & test under mkosi with a postmarketOS tools tree (#42171) 2026-05-20 21:03:14 +02:00
Yu Watanabe 5904cee941 include: move several missing definitions to musl
Those moved ones have been defined in glibc <= 2.34, and only
necessary when built with musl.

Follow-up for c8c1bcf194.
2026-05-21 03:51:26 +09:00
Yu Watanabe b17723e66b firstboot: auto-fill keymap/locale questions with data from firmware, if available (#42177)
Let's make the installer experience a tiny bit nicer, and prefill
everything with the data the firmware gives us.
2026-05-21 03:50:43 +09:00
Yu Watanabe 594f2314b2 dns-packet: bail out early if the packet is too short (#42189)
This should address the nit from Claude in
https://github.com/systemd/systemd/pull/42178#pullrequestreview-4320763076.
2026-05-21 03:43:18 +09:00
Daan De Meyer c7113f6b3c ci: run the musl build & test under mkosi with a postmarketOS tools tree
Drop the standalone Unit-tests (musl) workflow that ran on an Alpine sandbox
spun up by jirutka/setup-alpine, and merge it into unit-tests.yml as a new
build-musl job that provisions a postmarketOS tools tree via mkosi and runs
the meson build + test suite through 'mkosi box'. postmarketOS is musl-native,
so the musl-gcc / -idirafter /usr/include wrappers the Fedora tools tree
needed are gone; the linter.yml's own musl build step also goes away since
the unit-tests workflow now covers it (and tests it).

postmarketOS doesn't ship a downstream systemd packaging spec, so the new
tools tree config in mkosi.tools.conf/mkosi.conf.d/postmarketos.conf does not
set PrepareScripts and lists build deps manually. mkosi.sync now early-exits
when PKG_SUBDIR is unset so the missing pkgenv entry doesn't trip set -u.

Co-developed-by: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-20 17:22:35 +00:00
Daan De Meyer 65f076f4b0 test-path: Skip test when we can't create a cgroup
Instead of having CI runner specific checks, let's just
skip the test if we get EXIT_CGROUP which is what we get
when we can't create a cgroup. This makes the check work
independently of CI runner, and specifically also on github
actions.
2026-05-20 17:22:35 +00:00
Luca Boccassi e13e69de7c meson: move one source file from libcore to systemd array 2026-05-20 18:15:56 +01:00
Luca Boccassi fd16d4ac54 meson: reorder core sources alphabetically 2026-05-20 18:15:56 +01:00
Luca Boccassi 70b6dc7631 meson: reorder core sources array
To hint that sources should be added to the lowest common denominator
first
2026-05-20 18:15:56 +01:00
Daan De Meyer fc7a32df38 test-path: Migrate to test framework and macros
- Also clean up the logging in check_states() to
  only log on state changes so it's less noisy.
2026-05-20 16:04:26 +00:00
Daan De Meyer eb69a3c59d test-path: Fail earlier on start-limit-hit 2026-05-20 16:04:26 +00:00
Daan De Meyer fde1cccf31 meson: Skip coccinelle suite by default
It's not fully passing yet so disable it by default until it is.
clang-tidy follows the same model.
2026-05-20 16:04:26 +00:00
Daan De Meyer b01dcb3a81 test-ukify: Skip kernel images we can't access 2026-05-20 16:04:26 +00:00
Daan De Meyer e44f92ec40 mkosi: update mkosi ref to be746d51bc90568b196951a60095ba87bf51ca8b
* be746d51bc Make full $PATH available when building tools tree
2026-05-20 16:04:26 +00:00
Daan De Meyer 12836f982a ptyfwd: Imply PTY_FORWARD_READ_ONLY if stdin isn't readable
if stdin is connected to a closed pipe or similar, imply 
PTY_FORWARD_READ_ONLY so we don't even try to read from it
in the first place. Otherwise we'll immediately get a hangup
which will cause the forwarder to call sd_event_exit() and
shut down the event loop.

Debugged-by: Christian Brauner <brauner@kernel.org>
2026-05-20 18:04:13 +02:00
Lennart Poettering f941dff917 vmspawn: initial support for SEV-SNP guests (#42193) 2026-05-20 17:42:26 +02:00
Yu Watanabe 79877fdfa9 systemd-udevd: configure NIC IRQs CPU affinity (#40304)
# Context

#40195 defines the initial proposal and the motivation behind this PR.

This PR introduces 3 new options for `.link` files `[Link]` section:
- `IRQAffinityPolicy=`
- `IRQAffinity=`
- `IRQAffinityNUMA=`

The purpose is to allow `systemd-udevd` to configure a NIC's IRQs
affinity to specific CPU(s).

`IRQAffinityPolicy=` supports two policies:
- `single`: assign all the NIC IRQs to CPU 0, or the first CPU in the
CPU set resulting from the union of `IRQAffinity=` and
`IRQAffinityNUMA=`.
- `spread`: assign all the NIC IRQs to all the CPUs (or the union of
`IRQAffinity=` and `IRQAffinityNUMA=` if defined) in a round-robin
fashion while optimizing for cache locally while spreading apart queues
on CPUs as much as possible.

Both `IRQAffinity=` and `IRQAffinityNUMA=` behaves as filters to reduce
the CPU set to assign IRQs to, and are only valid if
`IRQAffinityPolicy=` is defined.

# Spreading IRQs

This section describes the algorithm responsible for spreading IRQs over
different CPUs to maximize performance.

## 1. Discover CPU topology

Read from `/sys/devices/system/cpu/cpu*/topology` to identify:
- L3 cache domains (dies)
- Physical cores VS hyperthreads
- NUMA nodes
- Core ordering within each die

```
Example: Dual-socket server with 2 dies per socket, 4 cores per die

      ┌─────────────────────────────────────────────────────────────────┐
      │                         NUMA Node 0                             │
      │   ┌─────────────────────────┐   ┌─────────────────────────┐     │
      │   │   Die 0 (L3 Cache)      │   │   Die 1 (L3 Cache)      │     │
      │   │  ┌────┐┌────┐┌────┐┌────│   │  ┌────┐┌────┐┌────┐┌────│     │
      │   │  │ C0 ││ C1 ││ C2 ││ C3 │   │  │ C4 ││ C5 ││ C6 ││ C7 │     │
      │   │  │0,16││1,17││2,18││3,19│   │  │4,20││5,21││6,22││7,23│     │
      │   │  └────┘└────┘└────┘└────│   │  └────┘└────┘└────┘└────│     │
      │   └─────────────────────────┘   └─────────────────────────┘     │
      └─────────────────────────────────────────────────────────────────┘
      ┌─────────────────────────────────────────────────────────────────┐
      │                         NUMA Node 1                             │
      │   ┌─────────────────────────┐   ┌─────────────────────────┐     │
      │   │   Die 2 (L3 Cache)      │   │   Die 3 (L3 Cache)      │     │
      │   │  ┌────┐┌────┐┌────┐┌────│   │  ┌────┐┌────┐┌────┐┌────│     │
      │   │  │ C8 ││ C9 ││C10 ││C11 │   │  │C12 ││C13 ││C14 ││C15 │     │
      │   │  │8,24││9,25││10,2││11,2│   │  │12,2││13,2││14,3││15,3│     │
      │   │  └────┘└────┘└────┘└────│   │  └────┘└────┘└────┘└────│     │
      │   └─────────────────────────┘   └─────────────────────────┘     │
      └─────────────────────────────────────────────────────────────────┘
                  (Numbers show CPU IDs: first HT, second HT)
```

## 2. Filter the first hyperthread only

Use only the first hyperthread of each physical core to avoid SMT
contention. Two IRQs on sibling HTs contend for ALU/cache without cache
benefit.

```
      Before: CPUs 0-31 (16 cores × 2 HTs)
      After:  CPUs 0-15 (first HT of each core)
```

## 3. Equidistant permutations

Reorder dies and CPUs so consecutive selections are maximally spread
apart.

```
        Original order:  [0, 1, 2, 3]          (adjacent dies/CPUs)
                            |
                            v
        Equidistant:     [0, 2, 1, 3]          (spread apart)
```

This ensures that even if only 2 IRQs are assigned, they land on dies 0
and 2 (not 0 and 1), maximizing physical distance. The permutation is
also applied within each die:

```
        Die permutation:   Die0 -> Die2 -> Die1 -> Die3
        
        Within each die:
        ┌───────────────────────────────────────────────┐
        │ Die 0: [C0,C1,C2,C3]     -> [C0,C2,C1,C3]     │
        │ Die 1: [C4,C5,C6,C7]     -> [C4,C6,C5,C7]     │
        │ Die 2: [C8,C9,C10,C11]   -> [C8,C10,C9,C11]   │
        │ Die 3: [C12,C13,C14,C15] -> [C12,C14,C13,C15] │
        └───────────────────────────────────────────────┘
```

## 4. Round-robin selection across dies

Pick one CPU from each die in rotation, following permuted order.

```

      Round 1:     Die0->C0   Die2->C8   Die1->C4   Die3->C12
                      |          |          |          |
                      v          v          v          v
      IRQs:         [IRQ0]     [IRQ1]     [IRQ2]     [IRQ3]
      
      Round 2:     Die0->C2   Die2->C10  Die1->C6   Die3->C14
                      |          |          |          |
                      v          v          v          v
      IRQs:         [IRQ4]     [IRQ5]     [IRQ6]     [IRQ7]
```

If there are more IRQs than physical cores, this logic wraps around and
reuse CPUs. Only the first hyperthread of each core is used to avoid
cache line contention between queues.

Closes #40195.
2026-05-21 00:39:47 +09:00
Luca Boccassi 5833182dc1 Revert "meson: shrink developer-mode build artifacts"
This reverts commit 6891016149.
2026-05-20 16:21:54 +01:00
Lennart Poettering 10151303ab update TODO 2026-05-20 16:39:08 +02:00
Lennart Poettering ec1f40c89d firstboot: port help() to help-util.[ch] APIs 2026-05-20 16:39:04 +02:00
Lennart Poettering 460dab3936 firstboot: prefill language prompt with firmware language if it makes
sense
2026-05-20 16:38:19 +02:00
Lennart Poettering ad19aced00 bootctl: show platform lang in bootctl status output 2026-05-20 16:38:19 +02:00
Lennart Poettering 862816a1fc locale-setup: pick up platform lang from firmware 2026-05-20 16:38:19 +02:00
Lennart Poettering 706de22cba sysinstall: prefill firmware variable question with 'yes' 2026-05-20 16:38:18 +02:00
Lennart Poettering 1d646aed65 firstboot: prefill keymap question with EFI provided info 2026-05-20 16:38:18 +02:00
Lennart Poettering a80024e96d ask-string: support prefilling a string query with an explicit string 2026-05-20 16:34:21 +02:00
Lennart Poettering 183051f23f vconsole-util: move code to read EFI keyboard layout into generic code 2026-05-20 16:34:21 +02:00
Daan De Meyer 933a45835f basic/math-util: drop libm where possible
- test-random-util is reworked to not use sqrt()
- pretty-print.c inlines ceil() so libm doesn't have
  to be linked into libshared
- We add fno-math-errno to allow inlining of more math
  functions by not requiring standard math functions to 
  set errno on invalid input.
2026-05-20 16:32:22 +02:00
Daan De Meyer 6891016149 meson: shrink developer-mode build artifacts
Two complementary changes in the developer-mode branch of meson.build:

  1. -ffunction-sections -fdata-sections: pair with the existing
     -Wl,--gc-sections so the linker can drop unused individual functions
     and data instead of being forced to pull whole .o files into each
     binary. Biggest impact on statically-linked NSS/PAM modules (a single
     call into creds-util.c used to drag in the entire creds-util
     translation unit, which transitively pulled TPM2, OpenSSL, PKCS11 and
     KDF helpers via tpm2-util.c / openssl-util.c) and on tests that embed
     daemon objects via meson's objects: extraction.

  2. -gz=zstd + -fdebug-types-section + -Wl,--compress-debug-sections=zstd:
     compress every .debug_* section with zstd, and move type DIEs into a
     COMDAT-mergeable section so identical types described across many TUs
     land once. Both are transparent to GDB / readelf / addr2line.

Gated to mode == 'developer' for now: no major distro (Fedora, Debian/
Ubuntu, Arch, Alpine, Gentoo, openSUSE, Yocto) enables -ffunction-sections
in their system-wide default CFLAGS, and the interaction with -flto=auto +
-ffat-lto-objects (which Fedora et al. ship by default) deserves a broader
evaluation before turning it on for release builds. Developer mode benefits
straightforwardly: smaller plugins, smaller tests, smaller libraries, no
interference with the hardening/LTO flag combinations distros pin.

Size impact on a clean developer-mode build, 626 ELF objects:

| Category                   |   n |      Before |       After |               Δ |     % |
| -------------------------- | --: | ----------: | ----------: | --------------: | ----: |
| NSS plugins                |   4 |  22,163,272 |   6,681,120 |    −15,482,152  | −69.9 |
| PAM plugins                |   3 |  18,132,160 |   5,764,880 |    −12,367,280  | −68.2 |
| libsystemd.so (public ABI) |   1 |   6,009,360 |   3,350,168 |     −2,659,192  | −44.3 |
| libudev.so (public ABI)    |   1 |   4,379,336 |   1,441,256 |     −2,938,080  | −67.1 |
| libsystemd-shared-261.so   |   1 |  15,130,264 |  11,293,952 |     −3,836,312  | −25.4 |
| libsystemd-core-261.so     |   1 |   7,356,408 |   4,992,600 |     −2,363,808  | −32.1 |
| cryptsetup-token plugins   |   3 |     139,800 |     113,344 |        −26,456  | −18.9 |
| daemons / CLI tools        | 178 |  43,581,288 |  31,911,368 |    −11,669,920  | −26.8 |
| test binaries              | 386 | 124,717,072 |  60,185,904 |    −64,531,168  | −51.7 |
| fuzzers                    |  48 |  33,138,056 |  13,864,952 |    −19,273,104  | −58.2 |
| **TOTAL**                  | 626 | 274,747,016 | 139,599,544 | **−135,147,472** | **−49.2** |

Biggest individual wins:

| Binary                   |   Before |    After |      Δ |
| ------------------------ | -------: | -------: | -----: |
| test-networkd-address    |  6.21 MB |  0.82 MB | −86.8% |
| test-network-tables      |  6.23 MB |  0.85 MB | −86.4% |
| test-networkd-conf       |  6.27 MB |  1.32 MB | −78.9% |
| libnss_myhostname.so.2   |  6.40 MB |  1.53 MB | −76.1% |
| fuzz-netdev-parser       |  6.22 MB |  1.51 MB | −75.7% |
| fuzz-network-parser      |  6.22 MB |  1.70 MB | −72.6% |
| libnss_systemd.so.2      |  6.90 MB |  2.04 MB | −70.4% |
| libnss_resolve.so.2      |  4.42 MB |  1.38 MB | −68.8% |
| pam_systemd_home.so      |  6.91 MB |  2.22 MB | −67.9% |
| libudev.so.1.7.13        |  4.18 MB |  1.37 MB | −67.1% |
| pam_systemd.so           |  7.02 MB |  2.55 MB | −63.6% |
| libsystemd-shared-261.so | 14.43 MB | 10.77 MB | −25.4% |

The big test wins come from the ~30 daemons (systemd-networkd,
systemd-resolved, systemd-journald, systemd-logind, systemd-homed,
systemd-importd, systemd-machined, …) whose compiled .o files are embedded
directly into their unit tests via meson's objects: extraction mechanism.
With per-function sections on the daemon sources, the test binary can GC
the bulk of code it never exercises; the remaining DWARF is then shared
zstd-compressed across every .o.

Build-speed cost is below noise on a 24-core build: across four clean
builds (with-flags / sections-only / baseline / with-flags rerun) the
range was 23.6–26.0 s real time and 7m39s–7m48s user time, with the
two with-flags runs faster than the baseline by a couple of seconds —
overhead from per-function-section bookkeeping and zstd compression
disappears into parallel-build noise.
2026-05-20 16:27:10 +02:00