Commit Graph
79414 Commits
Author SHA1 Message Date
Zbigniew Jędrzejewski-Szmek 40ff0dec08 test/ukify: deduplicate path specification 2025-02-14 17:27:12 +01:00
Zbigniew Jędrzejewski-Szmek 8c81f9a3cf ukify: fixes with kernel compression (#36381) 2025-02-14 16:47:49 +01:00
fishears 8ac7e25aab hwdb.d: add support for Akoya P15645 2025-02-15 00:10:00 +09:00
Yu Watanabe 5a83fd5a2a resolve: fix use-after-free (#36353)
Fixes a bug introduced by 81ae2237c1.
Fixes #36351.
2025-02-15 00:03:21 +09:00
Yu Watanabe 03d8b9dfab TEST-75-RESOLVED: skip a testcase when running on sanitizer 2025-02-14 11:54:56 +00:00
Yu Watanabe 2c9d6986d8 TEST-75-RESOLVED: keep IPv6 stack enabled
To make the issue #36351 easily reproduced.
2025-02-14 11:54:56 +00:00
Yu Watanabe 39da9b894f TEST-75-RESOLVED: assume knot 3.0 or newer is installed
And make the test failed if knot is installed but older than 3.0.
2025-02-14 11:54:56 +00:00
Yu Watanabe bf4b254d70 mkosi: wrap several more commands when running on sanitizers
They are used in TEST-75-RESOLVED.
2025-02-14 11:54:56 +00:00
Muhammad Nuzaihan Bin Kamal Luddin e644b332d0 resolve: clear previous assignments of RefuseRecordTypes= on reload
Follow-up for 81ae2237c1.
2025-02-14 11:54:56 +00:00
Yu Watanabe 225dbd6108 resolve: fix use-after-free
Fixes a bug introduced by 81ae2237c1.
Fixes #36351.
2025-02-14 11:54:56 +00:00
Mike Yuan d08848b906 README: new mount API was introduced in v5.2
Follow-up for d75c74e7bf
2025-02-14 12:53:22 +01:00
Luca Boccassi cdedc90caf ukify: do not insist on a stub being available when joining pcrsigs
It is not used in this case, so skip it, otherwise it will need to be
installed even if it is not used

Follow-up for 9876e88e23
2025-02-14 10:57:03 +00:00
Luca Boccassi 0dd03215f1 ukify: if the specified kernel is not a valid PE file try to decompress it
On some distros on some architectures (e.g.: Ubuntu arm64) the kernel is shipped as
a gzipped file, which the UEFI firmware does not understand.
If pefile fails to parse it, try to decompress it.
2025-02-14 10:57:03 +00:00
Luca Boccassi a6d51ae582 ukify: fix zboot parsing with zstd
The header starts with 'zstd', not 'zstd22':

$ ukify build --linux vmlinuz-6.13+unreleased-cloud-arm64 --initrd /boot/initrd.img-6.12.12-amd64 --output uki
Kernel version not specified, starting autodetection 😖.
Real-Mode Kernel Header magic not found
+ readelf --notes vmlinuz-6.13+unreleased-cloud-arm64
readelf: Error: Not an ELF file - it has the wrong magic bytes at the start
Traceback (most recent call last):
  File "/home/bluca/git/systemd/src/ukify/ukify.py", line 2510, in <module>
    main()
    ~~~~^^
  File "/home/bluca/git/systemd/src/ukify/ukify.py", line 2499, in main
    make_uki(opts)
    ~~~~~~~~^^^^^^
  File "/home/bluca/git/systemd/src/ukify/ukify.py", line 1328, in make_uki
    opts.uname = Uname.scrape(linux, opts=opts)
                 ~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^
  File "/home/bluca/git/systemd/src/ukify/ukify.py", line 384, in scrape
    version = func(filename, opts=opts)
  File "/home/bluca/git/systemd/src/ukify/ukify.py", line 374, in scrape_generic
    text = maybe_decompress(filename)
  File "/home/bluca/git/systemd/src/ukify/ukify.py", line 221, in maybe_decompress
    return get_zboot_kernel(f)
  File "/home/bluca/git/systemd/src/ukify/ukify.py", line 201, in get_zboot_kernel
    raise NotImplementedError(f'unknown compressed type: {comp_type!r}')
NotImplementedError: unknown compressed type: b'zstd\x00\x00'
2025-02-14 10:28:41 +00:00
Luca Boccassi fbc6fecf1a ukify: switch from zstd to zstandard
The zstd library does not support stream decompression, and it
requires the zstd header to contain extra metadata, that the kernel
build does not append:

$ file -k vmlinuz-6.13+unreleased-cloud-arm64
vmlinuz-6.13+unreleased-cloud-arm64: PE32+ executable (EFI application) Aarch64 (stripped to external PDB), for MS Windows, 2 sections\012- data
$ ukify build --linux vmlinuz-6.13+unreleased-cloud-arm64 --initrd /boot/initrd.img-6.12.12-amd64 --output uki
Kernel version not specified, starting autodetection 😖.
Real-Mode Kernel Header magic not found
+ readelf --notes vmlinuz-6.13+unreleased-cloud-arm64
readelf: Error: Not an ELF file - it has the wrong magic bytes at the start
Traceback (most recent call last):
  File "/home/bluca/git/systemd/src/ukify/ukify.py", line 2508, in <module>
    main()
    ~~~~^^
  File "/home/bluca/git/systemd/src/ukify/ukify.py", line 2497, in main
    make_uki(opts)
    ~~~~~~~~^^^^^^
  File "/home/bluca/git/systemd/src/ukify/ukify.py", line 1326, in make_uki
    opts.uname = Uname.scrape(linux, opts=opts)
                 ~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^
  File "/home/bluca/git/systemd/src/ukify/ukify.py", line 382, in scrape
    version = func(filename, opts=opts)
  File "/home/bluca/git/systemd/src/ukify/ukify.py", line 372, in scrape_generic
    text = maybe_decompress(filename)
  File "/home/bluca/git/systemd/src/ukify/ukify.py", line 219, in maybe_decompress
    return get_zboot_kernel(f)
  File "/home/bluca/git/systemd/src/ukify/ukify.py", line 199, in get_zboot_kernel
    return cast(bytes, zstd.uncompress(f.read(size)))
                       ~~~~~~~~~~~~~~~^^^^^^^^^^^^^^
zstd.Error: Input data invalid or missing content size in frame header.

This appears to be by design:

https://github.com/sergey-dryabzhinsky/python-zstd/issues/53

Switch to python3-zstandard, which works.
2025-02-14 10:28:41 +00:00
Yu Watanabe dd0d821a33 journal-remote: fix typo
Follow-ups for cfaf78001c.
2025-02-14 13:23:27 +09:00
Yu Watanabe 530ee01c60 TODO: fix typo
Follow-ups for 0eeeb36bd5 and
3fd11dbcd9.
2025-02-14 13:23:11 +09:00
Yu Watanabe d75c74e7bf README: mention fsopen() is since kernel v5.2
It is introduced by the following commit.
https://github.com/torvalds/linux/commit/24dcb3d90a1f67fe08c68a004af37df059d74005
2025-02-14 13:06:33 +09:00
Yu Watanabe 4053af87bb core/mount: rework GracefulOptions= as x-systemd.graceful-option= (#36356)
Prompted by #36337
2025-02-14 13:01:14 +09:00
Yu Watanabe daae625140 core/service: drop unneeded unit_add_to_gc_queue() (#36368) 2025-02-14 12:51:48 +09:00
Daan De Meyer ebcd568aa3 mkosi: Update to latest 2025-02-14 02:05:03 +00:00
Luca Boccassi 1585237b6a varlink idl fixes (#36376) 2025-02-13 21:16:04 +00:00
Daan De Meyer 1e6514d6d0 fmf: Don't fail if we can't modify sysctl values
If the script is running unprivileged we might not be able to modify
these so let's skip in that case.
2025-02-13 20:35:56 +00:00
Zbigniew Jędrzejewski-Szmek de02b551ad core/condition: fix segfault when key not found in os-release
'ConditionOSRelease=|ID_LIKE$=*rhel*' results in a segfault.
The key 'ID_LIKE' is not present in Fedora's os-release file.

I think the most reasonable behaviour is to treat missing keys as empty.
This matches the "shell-like" sprit, since in a shell empty keys would
by default be treated as empty too. Thus, "ID_LIKE=" would match, if
ID_LIKE is not present in the file, and ID_LIKE=!$foo" would also match.
The other option would be to make those matches fail, but I think that'd
make the feature harder to use, esp. with negative matches.

Documentation is updated to clarify the new behaviour.

https://bugzilla.redhat.com/show_bug.cgi?id=2345544
2025-02-13 18:16:42 +01:00
Lennart Poettering 2d790b225d logind: map enum strings to underscores in logind
Varlink doesn't know dashes in enums, we use them all the time. Convert
dashes to underscores hence before we pass them through varlink.
2025-02-13 18:16:20 +01:00
Lennart Poettering 0c69a67294 varlink: fix IDL for errno error 2025-02-13 18:15:52 +01:00
Lennart Poettering 411bc7c96c update TODO 2025-02-13 17:43:11 +01:00
Lennart Poettering 3329debc93 update TODO 2025-02-13 17:35:59 +01:00
Daan De Meyer 5ca1865ad9 sysupdate: Don't use compression extension for UKIs in manpage
UKIs should generally not be compressed since the kernel image and
initrd in them will already be compressed so let's remove the compression
suffix from the examples in the sysupdate manpage.
2025-02-13 13:08:15 +01:00
Daan De Meyer 78056ba850 ptyfwd: Forward various signals to forked process (#36345) 2025-02-13 11:30:34 +01:00
Daan De Meyer 3fd11dbcd9 Update TODO 2025-02-13 10:21:03 +01:00
Daan De Meyer b000e16798 ptyfwd: Forward various signals to forked process
We want systemd-pty-forward to be something that can be dropped in
somewhere without too much thought. To enable this, let's make sure
we forward various signals to the forked process. This makes sure that
any signals are delivered to the actual child process regardless of whether
it's running within systemd-pty-forward or not.
2025-02-13 10:21:00 +01:00
Lennart Poettering 3c837087c2 login: Queue session for garbage collection on leader death (#36364)
This ensures sessions are cleaned up properly in case the user service
manager was manually stopped.

How to reproduce:
- Install Fedora 41
- Log in
- Run `systemctl --user exit`
- Log in again
- Run `loginctl`

Expected results:
- Only 1 `manager` session

Actual results:
- More than 1 `manager` session
2025-02-13 09:10:06 +01:00
msizanoen a6bccda28d login: Queue session for garbage collection on leader death
This ensures sessions are cleaned up properly in case the user service
manager was manually stopped.
2025-02-13 09:29:11 +07:00
msizanoen b2a4109031 login: Continue watching leader pidfd after stop
This ensures that garbage collection will be triggered when the leader
process dies.
2025-02-13 09:29:11 +07:00
Lennart Poettering 276e641275 update TODO 2025-02-12 22:02:04 +01:00
Lennart Poettering 0eeeb36bd5 update TODO 2025-02-12 21:55:57 +01:00
Daan De Meyer b429f82eaf mkosi: Update to latest
In https://github.com/systemd/mkosi/pull/3497, mkosi has started parsing
options passed after the verb as regular mkosi options instead of options
for the invoked command. We adapt to this change by adding '--' as a delimiter
everywhere where required.
2025-02-12 21:39:27 +01:00
Mike Yuan f565e5a94a core/mount: log only once about fs not supporting new mount API 2025-02-12 18:16:44 +01:00
Mike Yuan c2198d0c3f mountpoint-util: assume fsopen() works in mount_option_supported()
Our baseline includes it now.
2025-02-12 18:16:44 +01:00
Mike Yuan 0d76f1c423 core/mount: rework GracefulOptions= to be just x-systemd.graceful-option=
09fbff57fc introduced new knob
for such functionality. However, that seems unnecessary.

The mount option string is ubiquitous in that all of fstab,
kernel cmdline, credentials, systemd-mount, ... speak it.
And we already have x-systemd.device-bound= that's parsed
by pid1 instead of fstab-generator. It feels hence more natural
for graceful options to be an extension of that, rather than
its own property.

There's also one nice side effect that the setting itself
is now more graceful for systemd versions not supporting
such feature.
2025-02-12 18:16:44 +01:00
Mike Yuan 818315ae61 core/service: drop unneeded unit_add_to_gc_queue()
Follow-up for a1d315730f
and 6ac62d61db

With the aforementioned commits, unit_release_resources()
is dispatched in a dedicated queue, and Service.n_keep_fd_store
has been dropped, hence the comment is outdated. Moreover,
the unit is added to GC queue in unit_notify() already.
No other unit types do this in corresponding _enter_dead()
functions, nor does Service need it anymore.
2025-02-12 17:54:34 +01:00
Mike Yuan 468e87267f core/unit: use UNIT_IS_INACTIVE_OR_FAILED at one more place 2025-02-12 17:49:22 +01:00
Mike Yuan 85f759baee bus-unit-util: add missing assertions 2025-02-12 15:34:54 +01:00
Mike Yuan 0fa062f983 core/dbus-mount: add missing ReloadResult and CleanResult properties 2025-02-12 15:34:54 +01:00
Mike Yuan c7c6cf2031 core/mount: trivial coding style cleanups 2025-02-12 15:34:53 +01:00
Mike Yuan 74c0d9726c core/mount: report accurate can_start and can_reload 2025-02-12 15:33:11 +01:00
Mike Yuan 65bc0c03b9 core/mount: check parameters_fragment first in mount_enter_(re)mounting()
I.e. don't perform any action if we can't spawn mount task anyway.
Later the same check would be added to mount_can_start/reload(),
so this makes things more coherent too.
2025-02-12 15:32:30 +01:00
Mike Yuan 7e9a78d6be core/mount: filter out "fail" option as well 2025-02-12 14:43:06 +01:00
Mike Yuan 5fe4c30ca7 core/dbus-service: fix alignment 2025-02-12 14:43:04 +01:00