]> git.ipfire.org Git - thirdparty/systemd.git/log
thirdparty/systemd.git
7 months agomeson: remove more deprecated meson options 36915/head
Yu Watanabe [Tue, 1 Apr 2025 04:49:36 +0000 (13:49 +0900)] 
meson: remove more deprecated meson options

- default-hierarchy meson option was deprecated by
  31323f21bb0ae7c712f43500c42997c91a6d20bf (v256).
- nscd meson option was deprecated by
  28f1f1a5e652508d6e61ace8918e8b831e4b62b4 (v257).

Let's completely remove them now.

7 months agomkosi/opensuse: drop default-hierarchy from systemd.spec
Yu Watanabe [Sat, 5 Apr 2025 11:59:44 +0000 (20:59 +0900)] 
mkosi/opensuse: drop default-hierarchy from systemd.spec

7 months agomkosi: update arch commit reference
Yu Watanabe [Sat, 5 Apr 2025 11:50:37 +0000 (20:50 +0900)] 
mkosi: update arch commit reference

7948d79b63 upgpkg: 257.5-1: new upstream release
d9badad1d4 drop use of deprecated nscd meson option
af071243cf upgpkg: 257.4-1: new upstream release

7 months agoudev-watch: push inotify fd to service manager's fdstore (#36977)
Yu Watanabe [Sat, 5 Apr 2025 11:34:42 +0000 (20:34 +0900)] 
udev-watch: push inotify fd to service manager's fdstore (#36977)

7 months agoshared/cred-util: Ensure TPM code is used with HAVE_TPM2 guards
Khem Raj [Sat, 5 Apr 2025 04:40:41 +0000 (21:40 -0700)] 
shared/cred-util: Ensure TPM code is used with HAVE_TPM2 guards

Building with no TPM2 we end up with following error

/usr/include/x86_64-linux-gnu/bits/string_fortified.h:29:10: note: in a call to built-in function ‘__builtin___memcpy_chk’
In function ‘memcpy’,
    inlined from ‘encrypt_credential_and_warn’ at ../git/src/shared/creds-util.c:1091:17:
/usr/include/x86_64-linux-gnu/bits/string_fortified.h:29:10: error: argument 2 null where non-null expected [-Werror=nonnull]
   29 |   return __builtin___memcpy_chk (__dest, __src, __len,
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   30 |                                  __glibc_objsize0 (__dest));
      |                                  ~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/x86_64-linux-gnu/bits/string_fortified.h:29:10: note: in a call to built-in function ‘__builtin___memcpy_chk’
cc1: some warnings being treated as errors   29 |   return __builtin___memcpy_chk (__dest, __src, __len,
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   30 |                                  __glibc_objsize0 (__dest));
      |                                  ~~~~~~~~~~~~~~~~~~~~~~~~~~

This is because code referencing tpm2 data structures is still used while the
initialization of the function has been compiled out since its conditional on HAVE_TPM2

We add needed guards in places where it is missing to fix this problem

Signed-off-by: Khem Raj <raj.khem@gmail.com>
7 months agonspawn: drop cgv1 handling; core: drop cgroup agent (#36764)
Yu Watanabe [Sat, 5 Apr 2025 08:57:18 +0000 (17:57 +0900)] 
nspawn: drop cgv1 handling; core: drop cgroup agent (#36764)

7 months agoTEST-17-UDEV: check journal about inotify watch 36977/head
Yu Watanabe [Fri, 4 Apr 2025 14:26:03 +0000 (23:26 +0900)] 
TEST-17-UDEV: check journal about inotify watch

7 months agoTEST-17-UDEV: rename subtests
Yu Watanabe [Fri, 4 Apr 2025 20:47:32 +0000 (05:47 +0900)] 
TEST-17-UDEV: rename subtests

7 months agoudev-watch: dump installed inotify watches on start and stop
Yu Watanabe [Fri, 4 Apr 2025 13:42:24 +0000 (22:42 +0900)] 
udev-watch: dump installed inotify watches on start and stop

7 months agoudev: push inotify fd to file descriptor store
Yu Watanabe [Wed, 2 Apr 2025 18:09:31 +0000 (03:09 +0900)] 
udev: push inotify fd to file descriptor store

Then, if we get inotify fd on start, it is not necessary to re-enable
inotify watch.

7 months agoudev-watch: split-out manager_process_inotify() from on_inotify()
Yu Watanabe [Wed, 2 Apr 2025 18:01:03 +0000 (03:01 +0900)] 
udev-watch: split-out manager_process_inotify() from on_inotify()

No functional change, just refactoring.

7 months agoudev: move inotify watch related functions to udev-watch.c
Yu Watanabe [Wed, 2 Apr 2025 17:55:36 +0000 (02:55 +0900)] 
udev: move inotify watch related functions to udev-watch.c

7 months agoboot: only link libgcc when compiler is gcc
David C. Manuelda [Fri, 4 Apr 2025 19:24:13 +0000 (21:24 +0200)] 
boot: only link libgcc when compiler is gcc

When compiling in systems which do not have gcc installed
(like a musl+llvm system) the forced linkage "-lgcc" is
stopping it to compile. As when compiler is clang it do not
need to link explicitelly to gcc I've modified meson to only
link to gcc library when compiler is gcc.

Closes: #35162
7 months agouse grep whole-word search
Matteo Croce [Fri, 4 Apr 2025 16:16:08 +0000 (18:16 +0200)] 
use grep whole-word search

grep supports whole-word search with `-w`, no need to look for a
trailing space.

7 months agonetwork: add support for HSR netdev
Beniamino Galvani [Mon, 31 Mar 2025 19:44:50 +0000 (21:44 +0200)] 
network: add support for HSR netdev

Add support for creating HSR/PRP interfaces. HSR (High-availability Seamless
Redundancy) and PRP (Parallel Redundancy Protocol) are two protocols that
provide seamless failover against failure of any single network component. They
are both implemented by the "hsr" kernel driver.

7 months agotree-wide: allow building with -Werror=flex-array-member-not-at-end (#36993)
Luca Boccassi [Fri, 4 Apr 2025 17:37:54 +0000 (18:37 +0100)] 
tree-wide: allow building with -Werror=flex-array-member-not-at-end (#36993)

Fixes #36988.

7 months agocore: also stash executor path in Manager
Mike Yuan [Fri, 4 Apr 2025 13:52:17 +0000 (15:52 +0200)] 
core: also stash executor path in Manager

Prompted by b58c240312a5cc0f9f9eab3018d6459e44d085e0

Let's not query it over and over again in exec_spawn().

7 months agoTEST-64-UDEV-STORAGE: enable debug logging and set timeout
Yu Watanabe [Fri, 4 Apr 2025 15:21:16 +0000 (00:21 +0900)] 
TEST-64-UDEV-STORAGE: enable debug logging and set timeout

For debugging the following failure:
```
41/95 systemd:integration-tests / TEST-64-UDEV-STORAGE-mdadm_basic                              TIMEOUT        1800.02s   killed by signal 15 SIGTERM
[   30.902392] TEST-64-UDEV-STORAGE.sh[517]: + sfdisk --wipe=always /dev/md/mdmirpar
[   31.326202] TEST-64-UDEV-STORAGE.sh[517]: + udevadm trigger --settle --parent-match /dev/md/mdmirpar
[  900.971338] kauditd_printk_skb: 10 callbacks suppressed
[  900.971343] audit: type=1130 audit(1743767825.783:146): pid=1 uid=0 auid=4294967295 ses=4294967295 msg='unit=systemd-tmpfiles-clean comm="systemd" exe="/usr/lib/systemd/systemd" hostname=? addr=? terminal=? res=success'
[  900.974057] audit: type=1131 audit(1743767825.786:147): pid=1 uid=0 auid=4294967295 ses=4294967295 msg='unit=systemd-tmpfiles-clean comm="systemd" exe="/usr/lib/systemd/systemd" hostname=? addr=? terminal=? res=success'
Finishing after writing 68494 entries
qemu-kvm: terminating on signal 15 from pid 131949 (/usr/bin/python3)
```

7 months agostat-util: drop unnecessary call of xopenat() in xstatfsat()
Yu Watanabe [Fri, 4 Apr 2025 11:24:40 +0000 (20:24 +0900)] 
stat-util: drop unnecessary call of xopenat() in xstatfsat()

7 months agoudev-spawn: search executed command in build directory (#36985)
Yu Watanabe [Fri, 4 Apr 2025 15:11:15 +0000 (00:11 +0900)] 
udev-spawn: search executed command in build directory (#36985)

This makes pin_callout_binary() optionally provides the path of the pinned
binary, and makes it used in udev-spawn.c, to allow easy debugging of
program invocations requested by RUN{program} and friends.

7 months agoNEWS: document kernel baseline bump 36764/head
Mike Yuan [Sun, 16 Mar 2025 18:30:37 +0000 (19:30 +0100)] 
NEWS: document kernel baseline bump

Follow-up for 16ac586e5a77942bf1147bc9eae684d544ded88f

7 months agoNEWS: remark cgroup v1 removal
Mike Yuan [Sun, 16 Mar 2025 18:26:41 +0000 (19:26 +0100)] 
NEWS: remark cgroup v1 removal

7 months agocore/cgroup: drop extraneous CGRuntime check in unit_get_memory_available()
Mike Yuan [Mon, 24 Mar 2025 18:46:46 +0000 (19:46 +0100)] 
core/cgroup: drop extraneous CGRuntime check in unit_get_memory_available()

Currently, for units whose CGRuntime is not allocated just yet, e.g.
inactive ones, MemoryAvailable fails to account for their MemoryMax/High
settings. Let's remove the CGRuntime check hence. The call to
unit_get_memory_accounting() would certainly fail, but it doesn't matter,
since 'current' is initially set to 0 anyways.

7 months agocore/cgroup: fold unit_get_current_memory() into generic memory accounting helper
Mike Yuan [Mon, 24 Mar 2025 15:47:09 +0000 (16:47 +0100)] 
core/cgroup: fold unit_get_current_memory() into generic memory accounting helper

7 months agoprocfs-util: modernize convert_meminfo_value_to_uint64_bytes()
Mike Yuan [Mon, 24 Mar 2025 15:45:10 +0000 (16:45 +0100)] 
procfs-util: modernize convert_meminfo_value_to_uint64_bytes()

7 months agoprocfs-util: use xsprintf() where appropriate
Mike Yuan [Mon, 24 Mar 2025 15:35:46 +0000 (16:35 +0100)] 
procfs-util: use xsprintf() where appropriate

7 months agocore/cgroup: remove legacy hierarchy setup
Mike Yuan [Thu, 20 Mar 2025 17:35:50 +0000 (18:35 +0100)] 
core/cgroup: remove legacy hierarchy setup

This also makes pin_cgroupfs_fd actually pin the fs root,
so that we can port all cg_* helpers to operate under
the fd later on.

7 months agocore: remove cgroups-agent
Mike Yuan [Sun, 16 Mar 2025 20:09:07 +0000 (21:09 +0100)] 
core: remove cgroups-agent

7 months agomkosi: update debian commit reference
Mike Yuan [Wed, 2 Apr 2025 19:08:48 +0000 (21:08 +0200)] 
mkosi: update debian commit reference

4643263123 Add NEWS entry to warn about network connectivity loss due to mDNS, and workaround
c995755707 Update changelog for 257.4-9 release
5e2ba1a045 resolved: break mDNS, remove conflict with avahi
6cf6fa39b4 Update changelog for 257.4-8 release
5067878f3a reintroduce systemd-resolved, with conflict on avahi-daemon
60c0d67e45 d/rules: drop nscd meson option
542de2ed44 Install new files for upstream CI
1e9b0e30da d/t/boot-and-services: skip gdm3 test in nested LXD run
4142fb487b systemd.preinst: fix shellcheck warnings
7879441e78 systemd.preinst: do not use systemctl
1d5ba16cf0 Update changelog for 257.4-7 release
ddd3438e04 autopkgtest: re-enable integration tests
98698b582f autopkgtest: fix debugging leftover
f62660777f Backport patches to fix integration tests skipping
b7308013af autopkgtest: when nested tests-in-lxd skips don't fail outer run
d5e96c6e56 Update changelog for 257.4-6 release
2493e2ffc7 Add Lintian override for 'unknown-field Protected'
e27ebff834 d/control: fix systemd-boot and systemd-boot-tools descriptions
705fff1663 systemd: conflict with dracut on arm64
7e92bc39e9 Update changelog for 257.4-5 release
7638a4dcc1 autopkgtest: fix unit-tests for upstream CI
83a6bbe55a Add missing dh-exec shbang to d/systemd-tests.install
11b82593a5 Update changelog for 257.4-4 release
f221a72abd Drop systemd-nspawn on arm64
b8ecb66d05 Drop systemd-resolved package
560cde98d7 Move leftover resolved files to its own package
fc2758d02d autopkgtest: drop versioning constraints on tzdata
b2b7c59141 autopkgtest: remove workaround for 'meson compiile mkosi' and use 'mkosi -f' instead to avoid slow rebuilds
17e11869b5 systemd.postinst: add markers for janitor removals
581a5994f5 Handle new tmp mount on upgrade in preinst rather than postinst
58f6a4f689 d/control: only conflict against opensysusers << 0.7.3-4.1~
6dee609537 userdb: fix wildcard matching
cf722bcd44 systemd-container: use more wildcards to install files
2339308f43 userdbd: use wildcard to install units
a663f671bd Add myself to Uploaders
4a5bef9a48 Install new files
c529659001 Drop systemd-cgroups-agent with upstream profile
970061c678 d/rules: add TODO reminder to drop Ubuntu-specific workaround
88fc574439 systemd-boot: do case-insensitive parsing of efibootmgr output
eecb9466e0 Update tzdata-legacy version constraint for new bookworm-p-u tzdata version
5d9570efad Update changelog for 257.4-3 release
614efde487 Fix versioned breaks/replaces for sd-boot-tools

7 months agocgroup-util: remove now unused cg_kernel_controllers()
Mike Yuan [Sun, 16 Mar 2025 17:48:21 +0000 (18:48 +0100)] 
cgroup-util: remove now unused cg_kernel_controllers()

7 months agonspawn: reject existing cgroupfs mount if cgns is enabled
Mike Yuan [Sun, 16 Mar 2025 21:42:02 +0000 (22:42 +0100)] 
nspawn: reject existing cgroupfs mount if cgns is enabled

7 months agonspawn: do not spuriously override cgroup2fs options on host
Mike Yuan [Sun, 16 Mar 2025 21:08:48 +0000 (22:08 +0100)] 
nspawn: do not spuriously override cgroup2fs options on host

7 months agonspawn/meson: drop duplicate condition on ENABLE_NSPAWN
Mike Yuan [Sat, 29 Mar 2025 14:55:58 +0000 (15:55 +0100)] 
nspawn/meson: drop duplicate condition on ENABLE_NSPAWN

Follow-up for d95818f5221d9b9b19648cffa0cb2407f023b27e

The whole dir is skipped if disabled, so no need for individual
conditions below.

7 months agonspawn: drop cgroup v1 handling
Mike Yuan [Sun, 16 Mar 2025 17:47:45 +0000 (18:47 +0100)] 
nspawn: drop cgroup v1 handling

7 months agoudev-spawn: search executed command in build directory 36985/head
Yu Watanabe [Thu, 3 Apr 2025 11:07:33 +0000 (20:07 +0900)] 
udev-spawn: search executed command in build directory

This should be useful when debugging RUN{program}= and friends.

7 months agobuild-path: make pin_callout_binary() optionally provides the path to the found execu...
Yu Watanabe [Thu, 3 Apr 2025 14:41:42 +0000 (23:41 +0900)] 
build-path: make pin_callout_binary() optionally provides the path to the found executable

7 months agobuild-path: check if found path is executable binary
Yu Watanabe [Thu, 3 Apr 2025 14:38:40 +0000 (23:38 +0900)] 
build-path: check if found path is executable binary

Otherwise, the path may point to a non-executable, e.g. a directory.

7 months agomeson: enable -Werror=flex-array-member-not-at-end 36993/head
Yu Watanabe [Thu, 3 Apr 2025 16:18:48 +0000 (01:18 +0900)] 
meson: enable -Werror=flex-array-member-not-at-end

7 months agoethtool: do not embed struct with flexible array into another struct
Yu Watanabe [Thu, 3 Apr 2025 16:17:36 +0000 (01:17 +0900)] 
ethtool: do not embed struct with flexible array into another struct

To allow compile ethtool-util.c with -Werror=flex-array-member-not-at-end.

7 months agosbsign: rename WIN_CERTIFICATE -> WIN_CERTIFICATE_HEADER and drop trailing flexible...
Yu Watanabe [Thu, 3 Apr 2025 16:15:19 +0000 (01:15 +0900)] 
sbsign: rename WIN_CERTIFICATE -> WIN_CERTIFICATE_HEADER and drop trailing flexible array

To allow building sbsign with -Werror=flex-array-member-not-at-end.

7 months agoboot: allow building sd-boot with -Werror=flex-array-member-not-at-end
Yu Watanabe [Thu, 3 Apr 2025 16:14:10 +0000 (01:14 +0900)] 
boot: allow building sd-boot with -Werror=flex-array-member-not-at-end

7 months agodhcp: split out DHCP_MESSAGE_HEADER_DEFINITION to allow building test-dhcp-server...
Yu Watanabe [Thu, 3 Apr 2025 16:12:54 +0000 (01:12 +0900)] 
dhcp: split out DHCP_MESSAGE_HEADER_DEFINITION to allow building test-dhcp-server.c with -Werror=flex-array-member-not-at-end

7 months agogpt-auto-generator: fix memory leak
Antonio Alvarez Feijoo [Fri, 4 Apr 2025 09:18:18 +0000 (11:18 +0200)] 
gpt-auto-generator: fix memory leak

Follow-up for 74cfd0921c01c464b79548467e909e577bfc25ac

7 months agopo: Translated using Weblate (Spanish)
Javier Francisco [Thu, 3 Apr 2025 22:43:38 +0000 (22:43 +0000)] 
po: Translated using Weblate (Spanish)

Currently translated at 100.0% (257 of 257 strings)

Co-authored-by: Javier Francisco <fserrador@gmail.com>
Translate-URL: https://translate.fedoraproject.org/projects/systemd/main/es/
Translation: systemd/main

7 months agomkosi: Fix arch build script version sed expression
Daan De Meyer [Thu, 3 Apr 2025 20:44:32 +0000 (22:44 +0200)] 
mkosi: Fix arch build script version sed expression

Yours truly got rid of the _tag variable in the Arch Linux PKGBUILD
a while ago, so actually adapt the build script to that by changing
the pkgver= variable instead.

7 months agotest logind restart with different classes
Matteo Croce [Thu, 3 Apr 2025 10:57:37 +0000 (12:57 +0200)] 
test logind restart with different classes

Test logind restart with every possible value of XDG_SESSION_CLASS

7 months agoTwo more mkosi updates (#36992)
Daan De Meyer [Thu, 3 Apr 2025 16:56:59 +0000 (18:56 +0200)] 
Two more mkosi updates (#36992)

7 months agomkosi: update fedora commit reference 36992/head
Daan De Meyer [Thu, 3 Apr 2025 14:38:31 +0000 (16:38 +0200)] 
mkosi: update fedora commit reference

08ce156d74 fmf: Run mkosi genkey before mkosi summary
1126a7c6b8 Download commit archives via full sha instead of short one
cc473d807f fmf: Check out mkosi to some directory in /var/tmp

7 months agodocs: Make sure we run mkosi genkey before everything else
Daan De Meyer [Thu, 3 Apr 2025 14:37:56 +0000 (16:37 +0200)] 
docs: Make sure we run mkosi genkey before everything else

Otherwise other commands might fail saying the keys don't exist
yet.

7 months agotimedate: Use timestamp_is_set() more
Daan De Meyer [Thu, 3 Apr 2025 11:48:27 +0000 (13:48 +0200)] 
timedate: Use timestamp_is_set() more

Aside from just being cleaner, this also solves bogus compiler warnings
we're seeing when building on CentOS Stream 9 (-Wmaybe-uninitialized)

7 months agomkosi: Point ssh key and certificate to top level dir as well (#36989)
Daan De Meyer [Thu, 3 Apr 2025 13:34:44 +0000 (15:34 +0200)] 
mkosi: Point ssh key and certificate to top level dir as well (#36989)

7 months agomkosi: Switch to KernelInitrdModules= 36989/head
Daan De Meyer [Thu, 3 Apr 2025 12:52:52 +0000 (14:52 +0200)] 
mkosi: Switch to KernelInitrdModules=

No change in behavior, just switching to the new setting implemented
by @keszybz.

7 months agomkosi: Pass through NO_SYNC to tools and subimages as well
Daan De Meyer [Thu, 3 Apr 2025 12:51:48 +0000 (14:51 +0200)] 
mkosi: Pass through NO_SYNC to tools and subimages as well

The tools tree now invokes mkosi.sync, so we have to pass through
NO_SYNC as well.

7 months agomkosi: Point ssh key and certificate to top level dir as well
Daan De Meyer [Thu, 3 Apr 2025 12:38:28 +0000 (14:38 +0200)] 
mkosi: Point ssh key and certificate to top level dir as well

Follow up for 342d21ef19391fdb7fc41548ad48f5b1e7423943

7 months agomkosi: Fix ExtraSearchPaths= for build directory
Daan De Meyer [Thu, 3 Apr 2025 12:07:52 +0000 (14:07 +0200)] 
mkosi: Fix ExtraSearchPaths= for build directory

follow up for 342d21ef19391fdb7fc41548ad48f5b1e7423943

7 months agoudev: new "image_dissect" builtin that can be used to generate symlinks based on...
Lennart Poettering [Thu, 3 Apr 2025 11:32:11 +0000 (13:32 +0200)] 
udev: new "image_dissect" builtin that can be used to generate symlinks based on partition designators (#36631)

This replaces #36209 and implements this via a new builtin, rather than
by shelling out to systemd-dissect.

Replaces: #36209
Replaces: #28894
Fixes: #34319
Fixes: #33453
Fixes: #27897
Fixes: #18035
7 months agobuild-path: make invoke_callout_binary() honour $PATH as last resort
Lennart Poettering [Wed, 26 Mar 2025 15:15:25 +0000 (11:15 -0400)] 
build-path: make invoke_callout_binary() honour $PATH as last resort

If we cannot find the callout we need in the build dir let's look for it
in $PATH as last resort.

This makes invoke_callout_binary() usable for all binaries we install
into $PATH (as opposed to /usr/lib/systemd), but has no effect
on callout binaries specified with full path.

This is useful, since we soon want to invoke journalctl as a callout.

7 months agogenerator: two minor tweaks to fsck code (#36970)
Yu Watanabe [Thu, 3 Apr 2025 10:19:54 +0000 (19:19 +0900)] 
generator: two minor tweaks to fsck code (#36970)

7 months agomkosi: Move all mkosi configuration into mkosi/ subdirectory (#36954)
Daan De Meyer [Thu, 3 Apr 2025 10:18:47 +0000 (12:18 +0200)] 
mkosi: Move all mkosi configuration into mkosi/ subdirectory (#36954)

7 months agotwo udev blkid builtin tweaks (#36968)
Yu Watanabe [Thu, 3 Apr 2025 09:44:56 +0000 (18:44 +0900)] 
two udev blkid builtin tweaks (#36968)

Fixes: #34319
7 months agotest: add a new unit test, src/test/test-binfmt-util.c
ZIHCO [Thu, 3 Apr 2025 01:50:12 +0000 (02:50 +0100)] 
test: add a new unit test, src/test/test-binfmt-util.c

7 months agoupdate TODO 36631/head
Lennart Poettering [Fri, 14 Mar 2025 15:13:20 +0000 (16:13 +0100)] 
update TODO

7 months agoman: document new gpt-auto-generator features
Lennart Poettering [Thu, 20 Mar 2025 21:51:04 +0000 (22:51 +0100)] 
man: document new gpt-auto-generator features

7 months agogpt-auto-generator: write fsck override unit to "middle" generator dir
Lennart Poettering [Thu, 20 Mar 2025 09:34:42 +0000 (10:34 +0100)] 
gpt-auto-generator: write fsck override unit to "middle" generator dir

We generally let gpt-auto-generator write to the "late" generator dir,
so that the explicit fstab-generator can write to the "middle" one. And
I think we should leave it that way. But we also want to override the
generic systemd-fsck-root.service service potentially, and if we'd do
that in the "late" generator dir, it would be pointless, since that's
ordered *after* the static version hence would never be taken into
consdiration.

Hence clean this up: keep writing to the late dir for everything,
except for the fsck stuff.

7 months agoveritysetup: when we fail to unlock a disk with the root hash signature logic, retry...
Lennart Poettering [Thu, 20 Mar 2025 13:35:50 +0000 (14:35 +0100)] 
veritysetup: when we fail to unlock a disk with the root hash signature logic, retry without

Currently, there's no nice way to get a key into the dm-verity kernel
keyring unless recompiling the kernel, or enabling SB or buying into
shim. Neither sounds particularly attractive.

hence provide a reasonable fallback: if unlocking with signed roothash
doesn#t work, just try without. maybe the kernel policy allows this,
maybe not. It's worth a try.

7 months agodissect-image: move extension release arguments of verity_dissect_and_mount() into...
Lennart Poettering [Tue, 18 Mar 2025 21:24:00 +0000 (22:24 +0100)] 
dissect-image: move extension release arguments of verity_dissect_and_mount() into a structure

7 months agoman: document image filters
Lennart Poettering [Thu, 20 Mar 2025 16:15:41 +0000 (17:15 +0100)] 
man: document image filters

7 months agogpt-auto-generator: parse systemd.image_filter= from kernel cmdline
Lennart Poettering [Thu, 20 Mar 2025 16:23:52 +0000 (17:23 +0100)] 
gpt-auto-generator: parse systemd.image_filter= from kernel cmdline

7 months agobuiltin-dissect_image: add support for image filters
Lennart Poettering [Thu, 20 Mar 2025 09:36:46 +0000 (10:36 +0100)] 
builtin-dissect_image: add support for image filters

7 months agodissect-tool: expose image filtering via new --image-filter= parameter
Lennart Poettering [Wed, 19 Mar 2025 08:09:16 +0000 (09:09 +0100)] 
dissect-tool: expose image filtering via new --image-filter= parameter

7 months agodissect-image: add a concept for "filtering" partitions we dissect
Lennart Poettering [Tue, 18 Mar 2025 15:46:27 +0000 (16:46 +0100)] 
dissect-image: add a concept for "filtering" partitions we dissect

DDIs may contain multiple versions of the same OS, or even multiple
OSes. Hence it makes sense to not just pick the "newest", whatever that
might be, but only partitions associated with specific images, or in a
specific version.

Let's a concept for such filtering: a per-designator glob expression
that can be applied to the partition label string, and can be used for
such filtering.

Usecase: when picking UKI belonging to OS image X in version Y, make
sure we only pick a /usr/ partition belonging to X in version Y, and a
root and home partition belonging to X in any version.

This only adds the basic infrastructure, but doesn't actually expose it
anywhere.

7 months agoveritysetup: optionally pick up roothash/roothashsig from udev device db entry
Lennart Poettering [Tue, 18 Mar 2025 11:51:04 +0000 (12:51 +0100)] 
veritysetup: optionally pick up roothash/roothashsig from udev device db entry

7 months agogpt-auto-generator: add support for setting up verity partitions automatically
Lennart Poettering [Mon, 17 Mar 2025 20:38:12 +0000 (21:38 +0100)] 
gpt-auto-generator: add support for setting up verity partitions automatically

So far the gpt-auto-generator would only cover unprotected and encrypted
partitions. Teach it handling of verity too.

7 months agogpt-auto-generator: add support for mount.usr=dissect
Lennart Poettering [Mon, 17 Mar 2025 16:01:49 +0000 (17:01 +0100)] 
gpt-auto-generator: add support for mount.usr=dissect

So far, we did not support auto-discovery the /usr/ partition at boot.
Change that: on explicit request (i.e. mount.usr=dissect) automatically
discover the /usr/ partition based on our usual dissection logic.

7 months agogenerator: add root=off to explicitly turn search for rootfs off
Lennart Poettering [Fri, 14 Mar 2025 14:57:03 +0000 (15:57 +0100)] 
generator: add root=off to explicitly turn search for rootfs off

This is useful when booting into storage target mode, where we do not
want to enter a root fs, we just want to stay forever in the initrd,
and hence there's value in not even generating and jobs to find the
rootfs

7 months agogpt-auto-generator: optionally, set up root fs via dissection logic
Lennart Poettering [Fri, 14 Mar 2025 14:44:50 +0000 (15:44 +0100)] 
gpt-auto-generator: optionally, set up root fs via dissection logic

This introduces root=dissect, which is a lot like root=gpt-auto, but
uses the image dissection logic to find the root partition. It's also
based on the GPT efi var telling us about the root disk, but instead of
just picking some suitable root disk manually it uses the dissection
logic.

This is a big step forward, since it means we can actually make
use of the image policy logic for the root fs too.

7 months agodissect-image: relax image policy logic a bit
Lennart Poettering [Fri, 14 Mar 2025 11:01:17 +0000 (12:01 +0100)] 
dissect-image: relax image policy logic a bit

Previously if we found a verity signature partition in an image, and the
image policy required "verity" (but did not allow "signature") we'd
refuse the image. This is of course unnecessarily strict: if "verity" is
allowed, we can make use of the verity data, and ignore the signature
data.

hence, relax the rules here: when we pick up a partition and want to
test it against the policy, always consider all "weaker" uses too, maybe
they are allowed if the "stronger" users isn't.

7 months agodissect-image: guess verity root hash from the resources we found
Lennart Poettering [Fri, 14 Mar 2025 10:57:34 +0000 (11:57 +0100)] 
dissect-image: guess verity root hash from the resources we found

When dissecting an image, let's make use of the Verity data even if we
got told no root hash explicitly: we can simply determine it by
concatenating the data partition uuid with the verity partition uuid.

Of course, on first thought this doesn't really add much: if the root
hash is not pinned from somewhere, this does not guarantee trust in
the image.

However, this is very useful for attestation: if we have the root hash
we can measure it before mounting things, even if we don't actually
authenticate it.

Hence, at best this helps us with attestation, at worst it doesn't improve
security but certainly doesn't hurt it.

7 months agodissect-image: rework how we determine that we are ready to do verity/verity-sig
Lennart Poettering [Fri, 14 Mar 2025 10:46:38 +0000 (11:46 +0100)] 
dissect-image: rework how we determine that we are ready to do verity/verity-sig

Previously, if during early enumeration of the partition table we
figured out we have a verity + verity-sig partition, we determined we are
"ready" to do verity/verity-sig, as reported by the "verity_ready" and
"verity_ready_sig" fields of DissectedImage.

Let's rework this: only determine we are ready in case the VeritySettings
structure is fully populated. Mark verity-sig/verity only as ready once
we actually *load* the verity sig metadata from the special partition.

This is conceptually more correct, as we consider things "ready" only if
we actually have all data for it loaded. It's also preparation for a
later commit that guesses the verity root hash based on what we discover.

7 months agoudev: add dissect_image builtin
Lennart Poettering [Wed, 5 Mar 2025 16:42:33 +0000 (17:42 +0100)] 
udev: add dissect_image builtin

Fixes: #33453 #27897 #18035
7 months agoudev-builtin-blkid: skip GPT dissection unless we actually have partition support
Lennart Poettering [Fri, 14 Mar 2025 15:13:48 +0000 (16:13 +0100)] 
udev-builtin-blkid: skip GPT dissection unless we actually have partition support

7 months agoudev-builtin-blkid: look for ESP/XBOOTLDR only in initrd; afterwards just look at /
Lennart Poettering [Thu, 13 Mar 2025 21:03:04 +0000 (22:03 +0100)] 
udev-builtin-blkid: look for ESP/XBOOTLDR only in initrd; afterwards just look at /

So far the gpt-auto symlinks would point to:

   1. the disk the ESP/XBOOTLDR is located on
   2. or to a loopback device whose filename field is set to "rootdisk"
      or "rootdisk.raw"

This makes sense in the initrd. But once we transition to the host this
is quite confusing, since the symlinks might point to a different place
than what we actually ended up transitioning too: the actual backing
device of the root file system might be different from what gpt-auto
found.

Let's clean this up: let's avoid any ambiguities here: let's extend the
rules above with one more rule:

   3. if we left the initrd, we'll make gpt-auto point to the selected
      root file system, if it otherwise would have been a candidate.

Or in other words, the ID_PART_GPT_AUTO_ROOT_DISK=1 udev property now
always makes sense: in the initrd it points to the future root disk, and
on the host to the actual root disk.

Fixes: #34319
7 months agogenerator: downgrade complaint about trying to fsck a non-block device 36970/head
Lennart Poettering [Thu, 20 Mar 2025 09:36:20 +0000 (10:36 +0100)] 
generator: downgrade complaint about trying to fsck a non-block device

7 months agogenerator: also suppress fsck early if we are adding a bind mount
Lennart Poettering [Thu, 20 Mar 2025 09:33:56 +0000 (10:33 +0100)] 
generator: also suppress fsck early if we are adding a bind mount

There's no point in "fscking a bind mount". Let's not do it hence.

7 months agotest: Be smarter about detecting the mkosi configuration directory 36954/head
Daan De Meyer [Wed, 2 Apr 2025 16:15:04 +0000 (18:15 +0200)] 
test: Be smarter about detecting the mkosi configuration directory

Instead of always looking up two directories from the
test/integration-tests/meson.build file, let's search in up to 4
parent directories from the given meson project source root. This
allows us to just pass in meson.project_source_root() to
integration-test-wrapper.py instead of having to pass in a fixed
relative offset from the current meson file.

It'll also allow us to install the integration tests and mkosi
configuration in the future without breaking the standalone
integrationt tests functionality;

7 months agoudev-builtin-blkid: skip GPT dissection unless we actually have partition support 36968/head
Lennart Poettering [Fri, 14 Mar 2025 15:13:48 +0000 (16:13 +0100)] 
udev-builtin-blkid: skip GPT dissection unless we actually have partition support

7 months agoudev-builtin-blkid: look for ESP/XBOOTLDR only in initrd; afterwards just look at /
Lennart Poettering [Thu, 13 Mar 2025 21:03:04 +0000 (22:03 +0100)] 
udev-builtin-blkid: look for ESP/XBOOTLDR only in initrd; afterwards just look at /

So far the gpt-auto symlinks would point to:

   1. the disk the ESP/XBOOTLDR is located on
   2. or to a loopback device whose filename field is set to "rootdisk"
      or "rootdisk.raw"

This makes sense in the initrd. But once we transition to the host this
is quite confusing, since the symlinks might point to a different place
than what we actually ended up transitioning too: the actual backing
device of the root file system might be different from what gpt-auto
found.

Let's clean this up: let's avoid any ambiguities here: let's extend the
rules above with one more rule:

   3. if we left the initrd, we'll make gpt-auto point to the selected
      root file system, if it otherwise would have been a candidate.

Or in other words, the ID_PART_GPT_AUTO_ROOT_DISK=1 udev property now
always makes sense: in the initrd it points to the future root disk, and
on the host to the actual root disk.

Fixes: #34319
7 months agomkosi: Move all mkosi configuration into mkosi/ subdirectory
Daan De Meyer [Wed, 2 Apr 2025 12:27:45 +0000 (14:27 +0200)] 
mkosi: Move all mkosi configuration into mkosi/ subdirectory

Now that mkosi can automatically pick up its main configuration from
a mkosi/ subdirectory if it exists and there is no configuration in the
top level directory, let's make use of it  to reduce the amount of clutter
in the top level directory of the repository.

This will also make it easier to install the mkosi configuration files as
part of the testing packages later on.

7 months agomkosi: update fedora commit reference
Daan De Meyer [Thu, 3 Apr 2025 07:59:13 +0000 (09:59 +0200)] 
mkosi: update fedora commit reference

b17e5d64a1 Don't try to modify mkosi.repart config if mkosi conf is in subdir
e2b2ea3776 fmf: Use mkosi/mkosi.local.conf if the mkosi/ directory exists

7 months agomkosi: Update to latest
Daan De Meyer [Wed, 2 Apr 2025 13:27:24 +0000 (15:27 +0200)] 
mkosi: Update to latest

7 months agotest: wait for the device node symlink being created
Yu Watanabe [Thu, 3 Apr 2025 03:04:11 +0000 (12:04 +0900)] 
test: wait for the device node symlink being created

Follow-up for 6e003d18bbf5e9f55c08b25d80b138b3a98d5f26.

Hopefully fixes the following failure:
```
[   50.650939] TEST-87-AUX-UTILS-VM.sh[3637]: + mkdir -p /tmp/validatefs-test.mount/somewhere/else
[   50.652499] TEST-87-AUX-UTILS-VM.sh[3637]: + mount /dev/disk/by-label/qnurx /tmp/validatefs-test.mount/somewhere/else
[   50.660885] /dev/disk/by-label/qnurx: Can't lookup blockdev
[   50.654964] TEST-87-AUX-UTILS-VM.sh[3731]: mount: /tmp/validatefs-test.mount/somewhere/else: special device /dev/disk/by-label/qnurx does not exist.
```

7 months agotest: Use test.service template for all integration tests (#36979)
Yu Watanabe [Thu, 3 Apr 2025 03:11:49 +0000 (12:11 +0900)] 
test: Use test.service template for all integration tests (#36979)

Instead of having some tests have their own unit, let's make
test.service.in generic enough so that it works for all integration
tests.

7 months agotest: set timeout for udevadm settle/wait/lock
Yu Watanabe [Wed, 2 Apr 2025 16:48:19 +0000 (01:48 +0900)] 
test: set timeout for udevadm settle/wait/lock

Otherwise, if a test in a spurious state, it consumes quite long time.
Let's fail earlier in such case.

This also drops an unnecessary calls of 'udevadm settle' in
testcase_nvme_basic() of TEST-64-UDEV-STORAGE.

7 months agoTwo trivial cleanups (#36980)
Yu Watanabe [Wed, 2 Apr 2025 23:56:46 +0000 (08:56 +0900)] 
Two trivial cleanups (#36980)

7 months agotest logind restart
Matteo Croce [Wed, 2 Apr 2025 19:18:45 +0000 (21:18 +0200)] 
test logind restart

Add a simple check which ensures that a user service survives
a logind restart.

7 months agodissect-image: after probing file systems, we still have the chance to not use a...
Lennart Poettering [Fri, 14 Mar 2025 10:45:20 +0000 (11:45 +0100)] 
dissect-image: after probing file systems, we still have the chance to not use a partition

Just because we found something we should still allow it to not be used,
hence include UNUSED in the found flags.

7 months agohwdb/keyboard: Map FN key on TUXEDO NB02 devices
Werner Sembach [Wed, 2 Apr 2025 16:47:12 +0000 (18:47 +0200)] 
hwdb/keyboard: Map FN key on TUXEDO NB02 devices

Map the FN key of TUXEDO NB02 devices that produces a scancode unrecognized by
the Linux kernel.

Signed-off-by: Werner Sembach <wse@tuxedocomputers.com>
7 months agotree-wide: replace unsigned int -> unsigned, long int -> long 36980/head
Yu Watanabe [Wed, 2 Apr 2025 20:48:59 +0000 (05:48 +0900)] 
tree-wide: replace unsigned int -> unsigned, long int -> long

7 months agomemfd-util: make memfd_add/get_seals() static
Yu Watanabe [Wed, 2 Apr 2025 20:36:25 +0000 (05:36 +0900)] 
memfd-util: make memfd_add/get_seals() static

7 months agotest: Use test.service template for all integration tests 36979/head
Daan De Meyer [Wed, 2 Apr 2025 19:58:59 +0000 (21:58 +0200)] 
test: Use test.service template for all integration tests

Instead of having some tests have their own unit, let's make
test.service.in generic enough so that it works for all integration
tests.