]> git.ipfire.org Git - thirdparty/systemd.git/log
thirdparty/systemd.git
6 months agoether-addr-util: split out logic to mark MAC addresses as random
Lennart Poettering [Mon, 18 Dec 2023 13:47:47 +0000 (14:47 +0100)] 
ether-addr-util: split out logic to mark MAC addresses as random

6 months agotest: add missing operators
Frantisek Sumsal [Mon, 18 Dec 2023 17:02:41 +0000 (18:02 +0100)] 
test: add missing operators

Without them only the last expression's return value is honored, causing
unexpected CI fails:

[   26.006721] testsuite-04.sh[1191]: + for _ in {0..9}
[   26.007672] testsuite-04.sh[1191]: + setterm --term linux --dump --file /tmp/console.dump
[   26.008871] testsuite-04.sh[1233]: + SYSTEMD_COLORS=256
[   26.009606] testsuite-04.sh[1233]: + /usr/lib/systemd/systemd-bsod
[   26.063296] systemd[1]: session-1.scope: Deactivated successfully.
[   26.124789] testsuite-04.sh[1191]: + grep -aq 'Press any key to exit' /tmp/console.dump
[   26.131509] testsuite-04.sh[1191]: + grep -aq 'Root emergency message' /tmp/console.dump
[   26.137882] testsuite-04.sh[1191]: + grep -aq 'The current boot has failed' /tmp/console.dump
[   26.141650] testsuite-04.sh[1191]: + return 0
[   26.144816] testsuite-04.sh[1191]: + grep -aq 'Scan the QR code' /tmp/console.dump
[   26.153591] testsuite-04.sh[1191]: + at_exit
[   26.154744] testsuite-04.sh[1191]: + local EC=1
[   26.155697] testsuite-04.sh[1191]: + [[ 1 -ne 0 ]]
[   26.156787] testsuite-04.sh[1191]: + [[ -e /tmp/console.dump ]]
[   26.157799] testsuite-04.sh[1191]: + cat /tmp/console.dump
[   26.158858] testsuite-04.sh[1244]:    The current boot has failed!
[   26.159858] testsuite-04.sh[1244]:    Root emergency message

I'm genuinely impressed that this worked at all.

6 months agotypo: transer -> transfer
Ronan Pigott [Mon, 18 Dec 2023 23:38:44 +0000 (16:38 -0700)] 
typo: transer -> transfer

6 months agoupdate TODO
Lennart Poettering [Mon, 18 Dec 2023 15:32:21 +0000 (16:32 +0100)] 
update TODO

6 months agoMerge pull request #30464 from CodethinkLabs/misc-integration-test-fixes
Luca Boccassi [Mon, 18 Dec 2023 15:11:16 +0000 (16:11 +0100)] 
Merge pull request #30464 from CodethinkLabs/misc-integration-test-fixes

Misc integration test fixes

6 months agoMerge pull request #30492 from mrc0mmand/skip-TEST-08-without-systemd-in-initrd
Luca Boccassi [Mon, 18 Dec 2023 15:10:33 +0000 (16:10 +0100)] 
Merge pull request #30492 from mrc0mmand/skip-TEST-08-without-systemd-in-initrd

test: skip TEST-08-INITRD if systemd didn't run in the initrd

6 months agoMerge pull request #30508 from topimiettinen/fix-flaky-test-address-static
Frantisek Sumsal [Mon, 18 Dec 2023 14:43:26 +0000 (14:43 +0000)] 
Merge pull request #30508 from topimiettinen/fix-flaky-test-address-static

test-network: fix racy test for address_static

6 months agotest-network: accept kernel versions like 1.2.3+ (self-built)
Topi Miettinen [Sun, 17 Dec 2023 15:42:09 +0000 (17:42 +0200)] 
test-network: accept kernel versions like 1.2.3+ (self-built)

6 months agoMerge pull request #30515 from poettering/dnslabelmax
Lennart Poettering [Mon, 18 Dec 2023 14:12:27 +0000 (15:12 +0100)] 
Merge pull request #30515 from poettering/dnslabelmax

extend most DNS label buffers by one

6 months agocore: allow interface altnames in RestrictNetworkInterfaces=
networkException [Fri, 15 Dec 2023 02:22:52 +0000 (03:22 +0100)] 
core: allow interface altnames in RestrictNetworkInterfaces=

This patch enables IFNAME_VALID_ALTERNATIVE for checks guarding the
parsing of RestrictNetworkInterfaces=.

The underlying implementation for this option already supports
altnames.

6 months agoMerge pull request #30321 from yuwata/find-esp
Lennart Poettering [Mon, 18 Dec 2023 14:11:54 +0000 (15:11 +0100)] 
Merge pull request #30321 from yuwata/find-esp

find-esp: gracefully handle btrfs RAID

6 months agoMerge pull request #30150 from poettering/homectl-interactive
Lennart Poettering [Mon, 18 Dec 2023 14:11:23 +0000 (15:11 +0100)] 
Merge pull request #30150 from poettering/homectl-interactive

add "homectl firstboot" verb, that runs at first boot and can create a user, interactively or from creds

6 months ago64bit mount id
Lennart Poettering [Mon, 18 Dec 2023 13:54:34 +0000 (14:54 +0100)] 
64bit mount id

6 months agoshutdown: Send EXIT_STATUS before final sync
Daan De Meyer [Sun, 17 Dec 2023 18:41:56 +0000 (19:41 +0100)] 
shutdown: Send EXIT_STATUS before final sync

There's a race condition where the EXIT_STATUS= message we send
just before shutting down the VM doesn't arrive on the host,
presumably because the VM is shut down before the kernel has had a
chance to forward the message to the host.

Since there's no obvious way to wait until the message has been
flushed to the host, let's send the message before we execute the
final sync() instead of after executing the final sync(). In my
testing, this seems to either guarantee the message is sent or
introduces sufficient delay that the kernel always has time to flush
its socket buffers to the host.

6 months agoupdate TODO 30150/head
Lennart Poettering [Wed, 22 Nov 2023 09:59:57 +0000 (10:59 +0100)] 
update TODO

6 months agomkosi: use systemd.firstboot=no to turn of interactivity at boot
Lennart Poettering [Thu, 30 Nov 2023 17:41:53 +0000 (18:41 +0100)] 
mkosi: use systemd.firstboot=no to turn of interactivity at boot

Now that creds are processed even if systemd.firstboot=no is set, we can
use it to disable the root pw prompt *and* the new homectl prompt at the
same time, without breaking the creds stuff.

6 months agohomectl: add "firstboot" command
Lennart Poettering [Wed, 22 Nov 2023 09:58:14 +0000 (10:58 +0100)] 
homectl: add "firstboot" command

This extends what systemd-firstboot does and runs on first boots only
and either processes user records passed in via credentials to create,
or asks the user interactively to create one (only if no regular user
exists yet).

6 months agofirstboot: adjust what systemd.firstboot=no on the kernel cmdline does
Lennart Poettering [Thu, 30 Nov 2023 17:25:53 +0000 (18:25 +0100)] 
firstboot: adjust what systemd.firstboot=no on the kernel cmdline does

So far by setting systemd.firstboot=no simply short-cut the whole tool
and made it exit early. This is against what the docs say though: they
just claim the user isn't asked for questions anymore. Let's change
behaviour so that the code actually matches the docs, or more
specifically: if credentials are passed into firstboot, then honour
them, regardless of the kernel cmdline option.

After all, if we get explicit data passed in we should operate on it,
and then leave systemd.firstboot=no just affect the interactivity.

I think this was actually mostly a bug introduced because the credential
stuff was added after the kernel cmdline option, hence this just catches
up with the new addition.

6 months agohomectl: when taking a JSON user record as input, strip secttions we don't want rathe...
Lennart Poettering [Wed, 22 Nov 2023 12:13:59 +0000 (13:13 +0100)] 
homectl: when taking a JSON user record as input, strip secttions we don't want rather than complain about them

This makes it easier to take a user record from one host and create an
identical user on another.

6 months agocreds-util: add helper for opening the credentials directory
Lennart Poettering [Wed, 22 Nov 2023 09:57:20 +0000 (10:57 +0100)] 
creds-util: add helper for opening the credentials directory

6 months agoMerge pull request #30479 from keszybz/man-pages-synopsis-layout
Lennart Poettering [Mon, 18 Dec 2023 09:44:58 +0000 (10:44 +0100)] 
Merge pull request #30479 from keszybz/man-pages-synopsis-layout

Man pages synopsis layout

6 months agospecifier: use mempcpy() where we can 30515/head
Lennart Poettering [Mon, 18 Dec 2023 09:24:50 +0000 (10:24 +0100)] 
specifier: use mempcpy() where we can

6 months agoresolved: increase most label buffers to fit a trailing NUL byte
Lennart Poettering [Mon, 18 Dec 2023 08:42:22 +0000 (09:42 +0100)] 
resolved: increase most label buffers to fit a trailing NUL byte

This is just paranoia. In all these cases we don't really care about the
trailing NUL byte. But if there's space for it dns_label_unescape() is
going to insert it, and that's a good safety strategy.

This is a follow-up to c29c3adefa8cd859f8cb87d9ad62f3d77b7cd102 which
fixed an actual bug, unlike this commit, which is just paranoia.

6 months agoMerge pull request #30482 from YHNdnzj/ferror-handling
Mike Yuan [Mon, 18 Dec 2023 06:42:22 +0000 (14:42 +0800)] 
Merge pull request #30482 from YHNdnzj/ferror-handling

A few fixes for ferror() handling

6 months agoMerge pull request #30494 from keszybz/trivial-cleanups
Yu Watanabe [Sun, 17 Dec 2023 23:25:02 +0000 (08:25 +0900)] 
Merge pull request #30494 from keszybz/trivial-cleanups

Trivial cleanups

6 months agoRevert "test: temporarily skip checking NFT sets in test_address_static" 30508/head
Topi Miettinen [Sun, 17 Dec 2023 16:01:24 +0000 (18:01 +0200)] 
Revert "test: temporarily skip checking NFT sets in test_address_static"

This reverts commit e4a80de119c5ce022396b436690f6321f4bb626b.

6 months agotest-network: fix racy test for address_static
Topi Miettinen [Sun, 17 Dec 2023 15:56:02 +0000 (17:56 +0200)] 
test-network: fix racy test for address_static

NFT sets must be installed before starting networkd, otherwise some sets may be
installed too late.

Closes #30427

6 months agoAdd Bosto BT-12HD series to hwdb
QuonXF [Sat, 16 Dec 2023 17:58:12 +0000 (21:58 +0400)] 
Add Bosto BT-12HD series to hwdb

6 months agoresolved-util: NUL-terminate host label
Ronan Pigott [Sat, 16 Dec 2023 19:45:07 +0000 (12:45 -0700)] 
resolved-util: NUL-terminate host label

In case the host has a 63-byte hostname, we must have enough space for a
NUL terminator as well.

6 months agomeson: make lines more consistent
Diego Viola [Thu, 14 Dec 2023 21:35:00 +0000 (18:35 -0300)] 
meson: make lines more consistent

6 months agomachine: also clean up gid_map fscanf error handling 30482/head
Mike Yuan [Thu, 14 Dec 2023 15:57:26 +0000 (23:57 +0800)] 
machine: also clean up gid_map fscanf error handling

6 months agoRevert "test: disable TEST-08-INITRD on ubuntu CI" 30492/head
Frantisek Sumsal [Fri, 15 Dec 2023 10:06:28 +0000 (11:06 +0100)] 
Revert "test: disable TEST-08-INITRD on ubuntu CI"

No longer necessary, as the test checks if systemd ran in the initrd.

This reverts commit 0d290cbcd62c5021b485c6f2bf0cef633e77a2b1.

6 months agotest: skip TEST-08-INITRD if systemd didn't run in the initrd
Frantisek Sumsal [Fri, 15 Dec 2023 10:04:39 +0000 (11:04 +0100)] 
test: skip TEST-08-INITRD if systemd didn't run in the initrd

This test requires systemd in the initrd, which is not the case in
mkinitrd-based initrds (Ubuntu/Debian).

Resolves: #30481

6 months agotest-systemctl-enable: fix typo 30494/head
Zbigniew Jędrzejewski-Szmek [Fri, 15 Dec 2023 15:01:35 +0000 (16:01 +0100)] 
test-systemctl-enable: fix typo

Follow-up for fe6e0cfa19dd1de4ac599ae207182fd556adcfa7.

6 months agoNEWS: fix version
Zbigniew Jędrzejewski-Szmek [Fri, 15 Dec 2023 14:52:37 +0000 (15:52 +0100)] 
NEWS: fix version

6 months agoman: use <simplelist> for two more lists 30479/head
Zbigniew Jędrzejewski-Szmek [Fri, 15 Dec 2023 13:32:50 +0000 (14:32 +0100)] 
man: use <simplelist> for two more lists

6 months agoman: use <simplelist> for file lists in synopsis
Zbigniew Jędrzejewski-Szmek [Thu, 14 Dec 2023 11:52:03 +0000 (12:52 +0100)] 
man: use <simplelist> for file lists in synopsis

With <para><filename>…</filename></para>, we get a separate "paragraph" for
each line, i.e. entries separated by empty lines. This uses up a lot of space
and was only done because docbook makes it hard to insert a newline. In some
other places, <literallayout> was used, but then we cannot indent the source
text (because the whitespace would end up in the final page). We can get the
desired result with <simplelist>.

With <simplelist> the items are indented in roff output, but not in html
output. In some places this looks better then no indentation, and in others it
would probably be better to have no indent. But this is a minor issue and we
cannot control that.

(I didn't convert all spots. There's a bunch of other man pages which have two
lines, e.g. an executable and service file, and it doesn't matter there so
much.)

6 months agobasic/uid-range: add uid_map_read_one helper
Mike Yuan [Thu, 14 Dec 2023 15:55:43 +0000 (23:55 +0800)] 
basic/uid-range: add uid_map_read_one helper

6 months agocgroup-util: check ferror() first
Mike Yuan [Thu, 14 Dec 2023 15:41:06 +0000 (23:41 +0800)] 
cgroup-util: check ferror() first

Also, there's no need to set use errno_or_else(), since fscanf() is
documented to set errno on error.

6 months agofsck: use correct errno
Mike Yuan [Thu, 14 Dec 2023 15:38:39 +0000 (23:38 +0800)] 
fsck: use correct errno

6 months agoMerge pull request #30484 from mrc0mmand/test-tweaks
Luca Boccassi [Fri, 15 Dec 2023 11:20:35 +0000 (12:20 +0100)] 
Merge pull request #30484 from mrc0mmand/test-tweaks

A couple of test-related tweaks

6 months agoFix a typo in the org.freedesktop.systemd1 man page
Andrew Sayers [Thu, 14 Dec 2023 16:31:09 +0000 (16:31 +0000)] 
Fix a typo in the org.freedesktop.systemd1 man page

6 months agotest: tell delv to load anchors from /etc/bind.keys explicitly 30484/head
Frantisek Sumsal [Thu, 14 Dec 2023 15:59:21 +0000 (16:59 +0100)] 
test: tell delv to load anchors from /etc/bind.keys explicitly

Since [0] delv no longer does that automagically, so we have to that
explicitly with each delv invocation.

Resolves: #30477

[0] https://github.com/isc-projects/bind9/commit/c144fd2871206d209ccdb916f5959a3ceab1d44c

6 months agotest: don't check for -Dinstall-tests=true with NO_BUILD=1
Frantisek Sumsal [Thu, 14 Dec 2023 14:06:46 +0000 (15:06 +0100)] 
test: don't check for -Dinstall-tests=true with NO_BUILD=1

6 months agotest: install empty directories with NO_BUILD=1
Frantisek Sumsal [Thu, 14 Dec 2023 14:06:12 +0000 (15:06 +0100)] 
test: install empty directories with NO_BUILD=1

Resolves: #30478

6 months agotest: update comment style & drop one extraneous newline
Frantisek Sumsal [Thu, 14 Dec 2023 10:40:13 +0000 (11:40 +0100)] 
test: update comment style & drop one extraneous newline

Follow-up to 9fb2a61830.

6 months agotest: forward journal messages to console during sd-bsod tests
Frantisek Sumsal [Thu, 14 Dec 2023 10:36:52 +0000 (11:36 +0100)] 
test: forward journal messages to console during sd-bsod tests

Since we nuke the journal multiple times during that, which makes
potential fails undebugable.

6 months agomkosi: make sysvinit path inference consistent 30464/head
Richard Maw [Fri, 8 Dec 2023 18:47:04 +0000 (18:47 +0000)] 
mkosi: make sysvinit path inference consistent

The integration tests use /etc/rc.d/init.d if it exists
or falls back to /etc/init.d,
while the mkosi.build.chroot script dereferenced /etc/init.d.

This produces inconsistent results, as sometimes an image can be made
that has systemd built to expect /etc/init.d but /etc/rc.d/init.d
also exists.

6 months agomkosi: Install locales in fedora
Richard Maw [Tue, 12 Dec 2023 13:14:36 +0000 (13:14 +0000)] 
mkosi: Install locales in fedora

locale files are not generated on-demand in Fedora like they are in
Debian-like systems and are typically installed from package instead.

This is necessary for the locale tests,
which expect en_US.UTF-8 to be available.

6 months agoMerge pull request #30440 from yuwata/network-nexthop-cleanups-2
Yu Watanabe [Thu, 14 Dec 2023 12:44:02 +0000 (21:44 +0900)] 
Merge pull request #30440 from yuwata/network-nexthop-cleanups-2

network/nexthop: several cleanups

6 months agoman/tmpfiles: update summary
Zbigniew Jędrzejewski-Szmek [Thu, 14 Dec 2023 10:08:50 +0000 (11:08 +0100)] 
man/tmpfiles: update summary

It hasn't been just about "volatile" and "files" for a long time.

6 months agosd-netlink: the kernel ignores NLM_F_APPEND in RTM_NEWNEXTHOP message but uses NLM_F_... 30440/head
Yu Watanabe [Wed, 13 Dec 2023 06:37:06 +0000 (15:37 +0900)] 
sd-netlink: the kernel ignores NLM_F_APPEND in RTM_NEWNEXTHOP message but uses NLM_F_REPLACE

See insert_nexthop() in net/ipv4/nexthop.c of the kernel.

6 months agonetwork/nexthop: check existing nexthop can be replaced with requested one
Yu Watanabe [Wed, 13 Dec 2023 06:33:13 +0000 (15:33 +0900)] 
network/nexthop: check existing nexthop can be replaced with requested one

6 months agonetwork/nexthop: do not add NextHop object to Link on requesting
Yu Watanabe [Tue, 12 Dec 2023 18:55:45 +0000 (03:55 +0900)] 
network/nexthop: do not add NextHop object to Link on requesting

Then, all nexthops managed by networkd really exist (unless the kernel
silently removes a nexthop).

This is the same for nexthop already done by
3c283289aefb3cfb8bfa5c759209368b63d1692c and
0a0c2672dbd22dc85d660e5baa7e1bef701beb88 (for address), and
5d098f5d3614d1c0be7c825925637e9ab3d904fb (for neighbor).

6 months agonetwork/nexthop: manage all nexthops by manager
Yu Watanabe [Tue, 12 Dec 2023 18:43:27 +0000 (03:43 +0900)] 
network/nexthop: manage all nexthops by manager

The kernel manages nexthops by their IDs. Previously networkd manages
nexthops in three ways:
- by the corresponding link, if a nexthop has ifindex,
- by the manager, if a nexthop does not have ifindex,
- by the manager with their IDs.

This unifies the three managements of nexthops into one, and use the
same way as the kernel uses.

This is the one for nexthop already done by
aa9626ee3b96e0d2a9a816b5efd38fd7dc829def for neighbor.

6 months agonetwork/nexthop: rename manager_get_nexthop_by_id() -> nexthop_get_by_id()
Yu Watanabe [Tue, 12 Dec 2023 18:23:50 +0000 (03:23 +0900)] 
network/nexthop: rename manager_get_nexthop_by_id() -> nexthop_get_by_id()

6 months agonetwork/nexthop: rename nexthop_owned_by_link() -> nexthop_bound_to_link()
Yu Watanabe [Tue, 12 Dec 2023 18:20:05 +0000 (03:20 +0900)] 
network/nexthop: rename nexthop_owned_by_link() -> nexthop_bound_to_link()

No functional change.

6 months agonetwork/nexthop: NextHop.id is always positive when nexthop_configure() is called
Yu Watanabe [Tue, 12 Dec 2023 09:40:43 +0000 (18:40 +0900)] 
network/nexthop: NextHop.id is always positive when nexthop_configure() is called

If a nexthop is requested without a valid ID, then nexthop_acquire_id()
assigns an unused ID. So, at the time nexthop_configure() is called, the
ID is always valid.

6 months agonetwork/nexthop: do not assign invalid ID
Yu Watanabe [Mon, 11 Dec 2023 16:59:34 +0000 (01:59 +0900)] 
network/nexthop: do not assign invalid ID

This also reduces the scope of the iterator.

6 months agonetwork/nexthop: split-out nexthop_update_group()
Yu Watanabe [Mon, 11 Dec 2023 16:42:12 +0000 (01:42 +0900)] 
network/nexthop: split-out nexthop_update_group()

No functional change, just refactoring and preparation for later
commits.

6 months agonetwork: do not trigger assertion when link_get_by_index() called with an invalid...
Yu Watanabe [Mon, 11 Dec 2023 16:27:09 +0000 (01:27 +0900)] 
network: do not trigger assertion when link_get_by_index() called with an invalid ifindex

Should not change any behavior. Preparation for later commit.

6 months agoAdd $SYSTEMD_HWDB_UPDATE_BYPASS (#30463)
Daan De Meyer [Thu, 14 Dec 2023 09:57:05 +0000 (10:57 +0100)] 
Add $SYSTEMD_HWDB_UPDATE_BYPASS (#30463)

Same as $KERNEL_INSTALL_BYPASS, but for hwdb. This will speed up
cross architecture image builds in mkosi as I can disable package
managers from running the costly hwdb update stuff in qemu user
mode and run it myself with a native systemd-hwdb with --root=.

6 months agomachine-credential: introduce MachineCredentialContext
Mike Yuan [Tue, 12 Dec 2023 10:58:51 +0000 (18:58 +0800)] 
machine-credential: introduce MachineCredentialContext

This allows more straightforward memory management and
the use of static destructor.

Requested (by me) in https://github.com/systemd/systemd/pull/30143#discussion_r1401980763

6 months agoMerge pull request #30417 from YHNdnzj/unit-log-resource
Luca Boccassi [Thu, 14 Dec 2023 08:45:26 +0000 (08:45 +0000)] 
Merge pull request #30417 from YHNdnzj/unit-log-resource

core/unit: clean up unit_log_resources

6 months agoAdd three Dell platforms to sensor accel location base
Artur Pak [Thu, 14 Dec 2023 06:32:54 +0000 (14:32 +0800)] 
Add three Dell platforms to sensor accel location base

6 months agoMerge pull request #30467 from poettering/loop-block-tweaks
Daan De Meyer [Thu, 14 Dec 2023 08:38:17 +0000 (09:38 +0100)] 
Merge pull request #30467 from poettering/loop-block-tweaks

various tweaks to block device ioctls, and loop device mgmt

6 months agorlimit-util: add pid_getrlimit() helper
Lennart Poettering [Fri, 8 Dec 2023 09:25:57 +0000 (10:25 +0100)] 
rlimit-util: add pid_getrlimit() helper

This is gets the resource limits off a specified process, and is very
similar to prlimit() with a NULL new_rlimit argument. In fact, it tries
that first. However, it then falls back to use /proc/$PID/limits. Why?
Simply because Linux prohibits access to prlimit() for processes with a
different UID, but /proc/$PID/limits still works.

This is preparation to allow nspawn to run unprivileged.

6 months agoMerge pull request #30469 from poettering/userdbd-tweaks2
Luca Boccassi [Thu, 14 Dec 2023 08:19:51 +0000 (08:19 +0000)] 
Merge pull request #30469 from poettering/userdbd-tweaks2

userdb: some smaller userdb tweaks

6 months agodocs/CREDENTIALS: Don't write authorized_keys with executable bits
Colin Walters [Thu, 14 Dec 2023 00:58:31 +0000 (19:58 -0500)] 
docs/CREDENTIALS: Don't write authorized_keys with executable bits

No reason to make this file executable.

6 months agomount-util: make sure mount_switch_root() works as clean NOP when '/' is specified...
Lennart Poettering [Wed, 13 Dec 2023 15:48:58 +0000 (16:48 +0100)] 
mount-util: make sure mount_switch_root() works as clean NOP when '/' is specified as target

6 months agomkosi: Add testuser and tar to system image
Richard Maw [Mon, 27 Nov 2023 17:50:49 +0000 (17:50 +0000)] 
mkosi: Add testuser and tar to system image

The integration tests are installed into the image
with the intention that it should be possible to run those tests,
but those tests require the named user testuser
and tar is needed for machined-import

6 months agomkosi: Allow the output directory to be overridden
Richard Maw [Tue, 5 Dec 2023 18:06:40 +0000 (18:06 +0000)] 
mkosi: Allow the output directory to be overridden

For integration tests it would be preferable to operate on a copy
so tests can be run in parallel and avoid interfering.

6 months agotest: mount overlayfs over /usr in some tests
Richard Maw [Fri, 8 Dec 2023 18:56:25 +0000 (18:56 +0000)] 
test: mount overlayfs over /usr in some tests

Most of the integration tests have been made to not write to /usr
but some genuinely need to do so.

Because mkosi creates images with a read-only /usr
it is not normally writeable.

By mounting an overlayfs with /usr as the lower dir
and upper and working dirs in /var tests may write to /usr.

6 months agouserdbd: split out function to find listener fd 30469/head
Lennart Poettering [Wed, 13 Dec 2023 17:21:18 +0000 (18:21 +0100)] 
userdbd: split out function to find listener fd

no actual code changes, just some refactoring and modernization

6 months agouserbd: modernize process_connection() fd possession logic
Lennart Poettering [Wed, 13 Dec 2023 17:19:42 +0000 (18:19 +0100)] 
userbd: modernize process_connection() fd possession logic

6 months agouserdbd: realign table
Lennart Poettering [Wed, 13 Dec 2023 17:19:20 +0000 (18:19 +0100)] 
userdbd: realign table

6 months agouserdbd: drop redundant empty line
Lennart Poettering [Wed, 13 Dec 2023 17:19:00 +0000 (18:19 +0100)] 
userdbd: drop redundant empty line

6 months agouserdbd: properly close the listener fd on exit
Lennart Poettering [Wed, 13 Dec 2023 17:18:39 +0000 (18:18 +0100)] 
userdbd: properly close the listener fd on exit

6 months agoupdate TODO
Lennart Poettering [Mon, 4 Dec 2023 16:57:06 +0000 (17:57 +0100)] 
update TODO

6 months agouserwork: port to pidref_set_parent()
Lennart Poettering [Fri, 1 Dec 2023 16:16:25 +0000 (17:16 +0100)] 
userwork: port to pidref_set_parent()

6 months agopidref: add pidref_set_parent() for race-freely getting pidref on ppid
Lennart Poettering [Fri, 1 Dec 2023 16:14:33 +0000 (17:14 +0100)] 
pidref: add pidref_set_parent() for race-freely getting pidref on ppid

6 months agodissect-tool: hide device column if it's a short-lived loopback device 30467/head
Lennart Poettering [Mon, 4 Dec 2023 17:27:19 +0000 (18:27 +0100)] 
dissect-tool: hide device column if it's a short-lived loopback device

It's pointless showing info that isn#t going to survive the current
invocation, hence hide it.

The "partition number" column is more useful since it kinda shows the
same information, but without the device node name prefixed that is
local to the currentl invocation.

6 months agodissect-tool: show sector/image size from DissectedImage object
Lennart Poettering [Mon, 4 Dec 2023 17:25:54 +0000 (18:25 +0100)] 
dissect-tool: show sector/image size from DissectedImage object

The information is provided to us already in the structure now, hence
use it.

6 months agodissect-image: also store the image size in DissectedImage
Lennart Poettering [Mon, 4 Dec 2023 17:04:44 +0000 (18:04 +0100)] 
dissect-image: also store the image size in DissectedImage

That way we can easily access it the same way regardless if we operate
on a block device or on a regular file.

6 months agoloop-util: remember if we created the LoopDevice
Lennart Poettering [Mon, 4 Dec 2023 17:02:45 +0000 (18:02 +0100)] 
loop-util: remember if we created the LoopDevice

Let's store in a bool whether a LoopDevice object was created via
loop_device_open() or loop_device_make().

6 months agoloop-util: also store the device size in LoopDevice
Lennart Poettering [Mon, 4 Dec 2023 17:01:39 +0000 (18:01 +0100)] 
loop-util: also store the device size in LoopDevice

That makes the field easily accessible, just as the sector size.

6 months agoblockdev-util: add new helper blockdev_get_device_size()
Lennart Poettering [Mon, 4 Dec 2023 16:58:33 +0000 (17:58 +0100)] 
blockdev-util: add new helper blockdev_get_device_size()

This function is just a wrapper around the BLKGETSIZE64. Which is a
pretty simple ioctl. The only reason to wrap it, is that the headers we
need to call it are a bit messy (as "linux/fs.h" is incompatible with
certain glibc headers). Hence add the simple helper that wraps it and
allows us to do the header mess needed in one file only.

It's also nicely symmetric to blockdev_get_sector_size().

6 months agotest: install all necessary units & generators for LVM on Debian
Frantisek Sumsal [Wed, 13 Dec 2023 11:27:17 +0000 (12:27 +0100)] 
test: install all necessary units & generators for LVM on Debian

And derivates.

Replaces: #30458

6 months agoMerge pull request #30450 from poettering/cgroups-delegate-attr-update
Luca Boccassi [Wed, 13 Dec 2023 13:50:41 +0000 (13:50 +0000)] 
Merge pull request #30450 from poettering/cgroups-delegate-attr-update

cgroup: bring list of delegated cgroup attributes up-to-date with cur…

6 months agoMerge pull request #30232 from keszybz/ukify-imports
Zbigniew Jędrzejewski-Szmek [Wed, 13 Dec 2023 13:38:03 +0000 (14:38 +0100)] 
Merge pull request #30232 from keszybz/ukify-imports

Use exec() to import ukify

6 months agotest: slacken plugged -> dead test
Richard Maw [Tue, 5 Dec 2023 18:09:18 +0000 (18:09 +0000)] 
test: slacken plugged -> dead test

This test is for if devices transition from plugged -> dead -> plugged
on boot, but it is normal to see loop devices transition plugged -> dead
on first boot when systemd-repart adds the root partition.

6 months agotest: Create analyze chroot with --rbind
Richard Maw [Mon, 27 Nov 2023 17:48:24 +0000 (17:48 +0000)] 
test: Create analyze chroot with --rbind

The systemd-analyze integration test also tests chroots.
It builds its chroot by bind-mounting /,
but since /usr might be a separate mountpoint
it should create the chroot with --rbind.

6 months agocore/unit: clean up unit_log_resources 30417/head
Mike Yuan [Sun, 10 Dec 2023 17:36:22 +0000 (01:36 +0800)] 
core/unit: clean up unit_log_resources

* Use a unified struct to store accounting fields/suffixes
* Use strextendf_with_separator where appropriate
* Don't mix stack and heap allocation for one iovec array

6 months agocore/unit: raise log level for unit_log_resources on certain memory thresholds
Mike Yuan [Sun, 10 Dec 2023 17:44:13 +0000 (01:44 +0800)] 
core/unit: raise log level for unit_log_resources on certain memory thresholds

We already do this for all other types of accountings. Let's
make this nicer for memory accounting too.

6 months agomacro-fundamental: add U64_{K,M,G}B
Mike Yuan [Wed, 13 Dec 2023 11:25:40 +0000 (19:25 +0800)] 
macro-fundamental: add U64_{K,M,G}B

6 months agoiovec-util: add missing assertion
Mike Yuan [Sun, 10 Dec 2023 16:12:30 +0000 (00:12 +0800)] 
iovec-util: add missing assertion

6 months agotest: test that delegation of some newer attrs that shall be delegated work 30450/head
Lennart Poettering [Wed, 13 Dec 2023 09:10:56 +0000 (10:10 +0100)] 
test: test that delegation of some newer attrs that shall be delegated work

6 months agocgroup: bring list of delegated cgroup attributes up-to-date with current kernels
Lennart Poettering [Tue, 12 Dec 2023 09:54:55 +0000 (10:54 +0100)] 
cgroup: bring list of delegated cgroup attributes up-to-date with current kernels

THis brings the list of attributes to delegate to managers of subcgroups
to the state of kernel 6.6.

We probably should unify this list, and maybe generate it automatically
from /sys/kernel/cgroup/delegate, but let's do that another time.

6 months agovarlink: improve compat with varlink C reference implementation
Lennart Poettering [Fri, 1 Dec 2023 16:59:49 +0000 (17:59 +0100)] 
varlink: improve compat with varlink C reference implementation

The reference implementation seems to set the 'parameters' field for
method calls to 'null' if nothing is specified on its command line. We
so far only could deal if the parameters field was unset or set to the
empty object. Let's also accept the 'null' type.

6 months agotest: add basic coverity tests for bootctl 30321/head
Yu Watanabe [Tue, 5 Dec 2023 14:18:17 +0000 (23:18 +0900)] 
test: add basic coverity tests for bootctl