Commit graph

70607 commits

Author SHA1 Message Date
Frantisek Sumsal 7990028468 packit: add a libarchive runtime dependency too
Addresses https://github.com/systemd/systemd/pull/31075#issuecomment-1911117026:

[   40.039232] testsuite-50.sh[624]: ++ systemd-dissect --make-archive /tmp/tmp.RZEq3t/minimal_0.raw
[   40.044745] testsuite-50.sh[625]: ++ sha256sum
[   40.066693] systemd-dissect[621]: libarchive.so.13 is not installed: libarchive.so.13: cannot open shared object file: No such file or directory
[   40.068577] systemd-dissect[621]: Archive support not available (compiled without libarchive, or libarchive not installed?).
[   40.092242] systemd-dissect[624]: libarchive.so.13 is not installed: libarchive.so.13: cannot open shared object file: No such file or directory
[   40.095716] systemd-dissect[624]: Archive support not available (compiled without libarchive, or libarchive not installed?).
[   40.100510] testsuite-50.sh[538]: + test e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 '!=' ''
[   40.100510] testsuite-50.sh[538]: + test e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 = e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855
[   40.108249] testsuite-50.sh[627]: + tar t
[   40.113791] testsuite-50.sh[626]: + systemd-dissect --make-archive /tmp/tmp.RZEq3t/minimal_0.raw
[   40.120300] testsuite-50.sh[628]: + grep etc/os-release
[   40.176288] systemd-dissect[626]: libarchive.so.13 is not installed: libarchive.so.13: cannot open shared object file: No such file or directory
[   40.180273] systemd-dissect[626]: Archive support not available (compiled without libarchive, or libarchive not installed?).
[   40.184017] testsuite-50.sh[627]: tar: This does not look like a tar archive
[   40.185430] testsuite-50.sh[627]: tar: Exiting with failure status due to previous errors

Follow-up for b68f4ca.
2024-01-26 16:10:00 +01:00
Luca Boccassi 34bbda18a5 man: add working example for sd_bus_set_watch_bind()
This example is able to deal with D-Bus going away and reappearing,
like on soft-reboot, so link it in both manpages.
2024-01-26 14:41:20 +00:00
Luca Boccassi 343e35b36d core: add SYSTEMD_VERITY_SHARING env var for local development
When running an image that cannot be mounted (e.g.: key missing intentionally
for development purposes), there's a retry loop that takes some time
and slows development down. Add an env var to disable it.
2024-01-26 10:14:15 +00:00
Daan De Meyer 20eeec72ed
Merge pull request #31095 from bluca/test_time_tz
test: unset TZ before timezone-sensitive unit tests are run
2024-01-26 09:02:34 +01:00
Daan De Meyer 329288613c
Merge pull request #31048 from YHNdnzj/fstab-modernization
fstab-util/generator: a few cleanups/improvements
2024-01-26 09:01:19 +01:00
Luca Boccassi b5d4862707 sd-bus: fix exiting event loop when sd_bus_set_exit_on_disconnect is used
If sd_bus_set_exit_on_disconnect is used and the bus is part of an event
loop, and the D-Bus connection goes away (e.g.: soft-reboot), sd-bus
will always exit() the program instead of returning from the loop, as
the reference to the event is removed before it is checked.
2024-01-26 08:59:46 +01:00
Daan De Meyer 9b8dd5fbea
Merge pull request #31092 from DaanDeMeyer/auto-features
mkosi: Use --auto-features=enabled for meson
2024-01-26 08:59:16 +01:00
Luca Boccassi 431f836bd4 CI: set TZ= in a unit test run to ensure tests don't break 2024-01-26 00:25:04 +00:00
Luca Boccassi 1e902c3463 test: unset TZ before timezone-sensitive unit tests are run
Some tests have hard-coded results that need to match, and change if
the caller has a timezone set via the TZ= environment variable, as it
is the case during reproducible build tests. Unset it.
2024-01-26 00:22:38 +00:00
Daan De Meyer 868c3a71d7 mkosi: Use --auto-features=enabled for meson 2024-01-26 00:12:57 +01:00
Yu Watanabe 107d036c03
Merge pull request #31083 from yuwata/core-several-cleanups
core: several cleanups
2024-01-26 05:30:01 +09:00
Luca Boccassi c84e8125c0
Merge pull request #31090 from poettering/bpf-lsm-rename
rename a bunch of bpf related .c/.h files, and functions there in to make naming of systematic
2024-01-25 18:20:25 +00:00
Daan De Meyer b6e8d086bd mkosi: Fix formatting in build script 2024-01-25 19:06:06 +01:00
Lennart Poettering b68f4cade4 dissect: add --make-archive option to convert DDI to tarball 2024-01-25 18:47:39 +01:00
Daan De Meyer 6811774510 man: Document ranges for distributions config files and local config files
Let's recommend that config files and drop-ins in /usr use the range
0-49 and config files in /etc and /run use the range 50-99 so that
files in /run and /etc will generally always override files from
/usr.
2024-01-25 18:46:24 +01:00
Mike Yuan 9f6c32ac96
fstab-generator: drop unapplicable options for /usr/ too
We already drop these for /sysroot/usr/ in parse_fstab
(1e9b2e4fdd). Let's make
things consistent, and do the same for /usr/ too (after
switch-root).
2024-01-26 01:06:41 +08:00
Mike Yuan 74467890ff
fstab-generator: modernize write_extra_dependencies 2024-01-26 01:06:41 +08:00
Mike Yuan 27db64bce8
fstab-generator: add missing assertions 2024-01-26 01:06:41 +08:00
Mike Yuan 4c7cc69652
fstab-generator: drop unneeded initialization 2024-01-26 01:06:40 +08:00
Mike Yuan 5d19388349
fstab-util: clean up fstab_filter_options
Let's get rid of the confusing goto so that the flow is more
straightforward. Note that the behavior is slightly changed:
previously, ret_filtered would be an empty string even if
the original opts passed in is NULL, but after this commit
it returns NULL too. But this shouldn't matter, as all our
code handles NULL opts gracefully.
2024-01-26 01:06:40 +08:00
Mike Yuan c521ce42b4
fstab-generator: drop assertions for mount opts
fstab_filter_options accepts NULL and (with later changes)
might even return NULL.
2024-01-26 01:06:40 +08:00
Mike Yuan 215286a405
fileio: fputs_with_space → _with_separator and modernization 2024-01-26 00:37:59 +08:00
Lennart Poettering 368b2bccd3
Merge pull request #31089 from keszybz/drop-syscall-filtering-and-new-syscalls
Drop syscall filtering and add new syscalls
2024-01-25 17:12:13 +01:00
Yu Watanabe ea1e0bf10b core: introduce unit_unwatch_pidref_done() helper function
No functional change, just refactoring.
2024-01-26 00:31:02 +09:00
Yu Watanabe ec5e2a1393 core/unit: split out unit_kill_one()
This also renames 'error' -> 'ret_error'.

No functional change, just refactoring.
2024-01-26 00:31:02 +09:00
Yu Watanabe fe80d62657 core/unit: split out unit_kill_context_one()
No functional change, just refactoring.
2024-01-26 00:30:59 +09:00
Lennart Poettering cba88d0b6b
Merge pull request #31082 from yuwata/network-cleanups-for-removing-routes
network: several cleanups for removing routes
2024-01-25 16:24:19 +01:00
Lennart Poettering 9af6ab4499 update TODO 2024-01-25 16:11:33 +01:00
Lennart Poettering 0e949cff53 bpf-socket-bind: rename bpf_serialize_socket_bind() → bpf_socket_bind_serialize()
This function is the only outlier, all other BPF glue functions are
called bpf_<module>_xyz(). Hence swap this over here too.
2024-01-25 16:11:33 +01:00
Lennart Poettering 62e2249020 core: rename restrict-ifaces.[ch] → bpf-restrict-ifaces.[ch]
Let's also clean-up naming of the "restrict-ifaces" BPF code. Let's name
the userspace glue analogous to the actual bpf code in src/core/bpf.
2024-01-25 16:11:33 +01:00
Lennart Poettering 352ec23c7f bpf-restrict-fs: also rename functions to bpf_restrict_fs_xyz()
Rename the functions too, to make clear this is really just about the
restrict-fs, and not generic LSM_BPF code.
2024-01-25 16:11:33 +01:00
Franck Bui 7ba1816dfe loop-util: drop unused .uevent_seqnum_not_before and .timestamp_not_before fields 2024-01-25 16:10:36 +01:00
Lennart Poettering 730d591798
Merge pull request #31087 from YHNdnzj/logind-cleanup
logind: several cleanups
2024-01-25 15:47:56 +01:00
Lennart Poettering 169b56758b core: rename "bpf-lsm.[ch]" → "bpf-restrict-fs.[ch]"
This file is a bit misnamed. What it actually implements is one specific
BPF LSM module, that restricts file systems. As such it really should be
named after that, and not primarily by the mechanism it uses for that.

With this our glue code is now named the same way as the actual bpf code
files in src/core/bpf/, thus things become a bit more symmetric.

This is particular relevant as we'll soon have another BPF LSM in our
tree, see #26826, and we should be able to distinguish them by name.

This commit just renames the files and does some dumb search/replace of
the string. A follow-up commit will name some functions more expressively
inside the files.
2024-01-25 14:08:26 +01:00
Zbigniew Jędrzejewski-Szmek bca1b70af9 Update syscalls lists
For discussion of listmount() and statmount(), see
https://lwn.net/Articles/950569/.
2024-01-25 13:51:36 +01:00
Zbigniew Jędrzejewski-Szmek 58fcc6b013 meson: drop arch filtering in syscall list
I added the filtering in 752fedbea7 as a way
to reduce the number of items in the tables. I thought it's "obvious", but
it might not be so.

One immediate problem is that the filter is broken, because on arm64,
os.uname().machine returns "aarch64", so we incorrectly filter out the arm
syscalls (there is just one: arm_fadvise64_64). Of course we could fix the
filter, but I think it's better to nuke it altogether. The filter on applies to
1 arm syscall and 5 s390 syscalls, and we have 500+ other syscalls, so this
"optimization" doesn't really matter. OTOH, if we get the filter wrong,
the result is bad. And also, the existence of the filter at all creates
problems for cross-builds.

I wanted to get rid of 'generate-syscall-list.py', but we need to generate a
backslash in the output. https://github.com/mesonbuild/meson/issues/1564 makes
this very very hard, since any attempt to put a backslash an inline argument
results in the backslash being replaces by a forward slash, which doesn't quite
have the same meaning. So let's use a standalone script until
https://github.com/mesonbuild/meson/issues/1564 is resolved.
2024-01-25 13:51:21 +01:00
Zbigniew Jędrzejewski-Szmek 04a7790f23 meson: use a single line for one-item file lists
That file was mixing two styles, which looks ugly. Let's not make
the file unnecessarily long.
2024-01-25 13:50:09 +01:00
Lennart Poettering 677e6c14b1 cgroup: don't enable bpf pseudo-controllers when doing a wildcard delegation
We can only delegate actual controllers, not the BPF pseudo-controllers
we defined as there's imply no concept for that. Hence, when users set
Delegate=yes to do a wildcard delegation, only delegate the regular
controllers.

This means that we won't bother with BPF stuff for such units where it's
entirelly unnecessary.
2024-01-25 13:42:13 +01:00
Lennart Poettering b009782b5d user-util: add comments explaining what the user name size limits effectively mean 2024-01-25 13:42:01 +01:00
Mike Yuan 74e75a05cf
logind-user: don't clear individual fields if object is freed anyway 2024-01-25 18:53:31 +08:00
Mike Yuan 562dc41bc4
logind-dbus: send session reply only for user start jobs 2024-01-25 18:53:31 +08:00
Mike Yuan ade9553d91
logind-dbus: modernize method_set_user_linger
Currently, user_start() doesn't return any error,
but let's not eat up the return value.
Preparation for #30910, after which user_start()
does return error.
2024-01-25 18:53:30 +08:00
Mike Yuan 210d4cde71
logind-user: don't say "user X logged out" in user_finalize
"Logging out" is something done by the human user. When we stop
tracking/GC a User object, let's use a more generic phrase in case
the specific User doesn't have human users (i.e. "user" class sessions)
at all. Eventually we want something like #2900, and log this
when all user class sessions log out and we're lingering again I think.
2024-01-25 18:53:30 +08:00
Bernhard M. Wiedemann ac0054e686 Sort input file list
so that /usr/lib/systemd/tests/unit-tests/test-libsystemd-sym
builds in a reproducible way
in spite of non-deterministic filesystem readdir order

See https://reproducible-builds.org/ for why this is good.

This patch was done while working on reproducible builds for openSUSE.
2024-01-25 10:34:56 +00:00
Yu Watanabe b5edf3a996 test-network: check if networkd forgets routes silently removed by the kernel 2024-01-25 16:43:44 +09:00
Yu Watanabe b91743e019 network/nexthop: drop dependent routes on removal
If a nexthop is removed, dependent routes are silently removed by the kernel.
Hence, networkd may be confused that routes that depends on the nexthop still
exist, and may fail to configure other routes or so.

This is the one for routes of 3cbbe8635a.
2024-01-25 16:43:44 +09:00
Yu Watanabe 6f09031e4d network/route: introduce reverse map for route with nexthop ID
It is not used in this commit, but will be used later.
Preparation for later commits.

This is the one for routes of 531c724682.
2024-01-25 16:43:44 +09:00
Yu Watanabe 97979ece0e network/route: also remove route on cancelling request
Otherwise, the route may arrive after we call
link_drop_foreign_address() or so on reconfiguring interface.

This is the one for routes of 4303e9806b.
2024-01-25 16:43:44 +09:00
Yu Watanabe d529b12a01 network/route: drop Route object even if we fail to remove the route
If we could not remove a route, then previously the corresponding
Route object was never removed, as it was freed only when we receive
remove notification from the kernel. So, we might confused that the
route still exists and being removed, and might block reconfiguring
the route.

With this change, even if we fail to remove a route, the corresponding
Route object will be freed.

This is the one for routes of 56a995fe8e.
2024-01-25 16:43:44 +09:00
Yu Watanabe 74c301b9ee network/route: introduce ref/unref functions for Route object
Then, Route object can live if it is detached from the owner (Manager,
Network, or Wireguard object).

This is the one for routes of ebd9690647.
2024-01-25 16:43:44 +09:00