]> git.ipfire.org Git - thirdparty/systemd.git/log
thirdparty/systemd.git
2 years agotest-network: extend testcase for tbf 29490/head
Yu Watanabe [Sat, 7 Oct 2023 06:06:37 +0000 (15:06 +0900)] 
test-network: extend testcase for tbf

For issue #29485.

2 years agonetwork/tc: support Parent=X:0 for qdiscs
Yu Watanabe [Sat, 7 Oct 2023 06:09:13 +0000 (15:09 +0900)] 
network/tc: support Parent=X:0 for qdiscs

When the minor part of the parent handle is zero, let's check if the
corresponding qdisc exists, rather than tc class.

2 years agonetwork/tc: allow to configure class or qdisc under foreign one
Yu Watanabe [Sat, 7 Oct 2023 05:37:31 +0000 (14:37 +0900)] 
network/tc: allow to configure class or qdisc under foreign one

Some qdiscs (e.g. tbf) implicitly create class(es) on create.
Previously, we could not create any child qdisc under the class, as the
implicit class is tagged as foreign.

2 years agonetwork/tc: re-enumerate traffic control classes when a qdisc created
Yu Watanabe [Sat, 7 Oct 2023 05:25:50 +0000 (14:25 +0900)] 
network/tc: re-enumerate traffic control classes when a qdisc created

Some kind of qdisc implicitly creates a class for the qdisc, but the
created class is not notified by the kernel. So, we need to explicitly
enumerate classes after a qdisc is created.

2 years agonetwork/tc: fix enumeration logic of traffic control classes
Yu Watanabe [Sat, 7 Oct 2023 05:24:34 +0000 (14:24 +0900)] 
network/tc: fix enumeration logic of traffic control classes

TC class can be enumerated only per link.

2 years agonetwork/tc: drop child tree of traffic control nodes on remove
Yu Watanabe [Sat, 7 Oct 2023 05:20:38 +0000 (14:20 +0900)] 
network/tc: drop child tree of traffic control nodes on remove

When a node of traffic control tree is removed, all child nodes are also
removed but their removal are not notified by the kernel.
So, previously, removed TC classes or qdiscs under the removed node were
kept in the memory of networkd, and may cause failure on reconfigure.

2 years agonetwork/tc: align vtables
Yu Watanabe [Sat, 7 Oct 2023 12:34:43 +0000 (21:34 +0900)] 
network/tc: align vtables

2 years agoMerge pull request #29491 from yuwata/varlink-follow-ups
Daan De Meyer [Sat, 7 Oct 2023 09:15:02 +0000 (11:15 +0200)] 
Merge pull request #29491 from yuwata/varlink-follow-ups

varlink: several follow-ups

2 years agotree-wide: add missing sigbus handling
Yu Watanabe [Sat, 7 Oct 2023 07:11:32 +0000 (16:11 +0900)] 
tree-wide: add missing sigbus handling

2 years agotree-wide: use path_simplify_alloc() more 29491/head
Yu Watanabe [Sat, 7 Oct 2023 06:53:44 +0000 (15:53 +0900)] 
tree-wide: use path_simplify_alloc() more

2 years agovarlink: drop unnecessary condition
Yu Watanabe [Sat, 7 Oct 2023 06:51:02 +0000 (15:51 +0900)] 
varlink: drop unnecessary condition

When 'exec' is true, 'c' is always non-NULL.

Fixes CID#1522384.

2 years agovarlink: fix typo
Yu Watanabe [Sat, 7 Oct 2023 06:48:19 +0000 (15:48 +0900)] 
varlink: fix typo

Follow-ups for #29325.

2 years agoMerge pull request #29475 from keszybz/remove-wrapper-functions
Luca Boccassi [Fri, 6 Oct 2023 21:02:09 +0000 (22:02 +0100)] 
Merge pull request #29475 from keszybz/remove-wrapper-functions

Remove unnecessary wrapper functions

2 years agoMerge pull request #29440 from evelikov/more-auto-entries
Zbigniew Jędrzejewski-Szmek [Fri, 6 Oct 2023 16:54:03 +0000 (18:54 +0200)] 
Merge pull request #29440 from evelikov/more-auto-entries

sd-boot: add auto-reboot and auto-poweroff entries

2 years agosd-boot: add auto-reboot and auto-poweroff entries 29440/head
Emil Velikov [Wed, 4 Oct 2023 10:51:47 +0000 (11:51 +0100)] 
sd-boot: add auto-reboot and auto-poweroff entries

Currently only an auto-reboot-to-firmware entry is available. For other
features - like reboot and power off - one needs to press the uppercase
B and O respectively.

Embedded devices may be missing a full fledged keyboard, so allow for
sd-boot to generate those entries.

v2:
 - add to the config parser/man/bootctl/sd-boot info screen
 - keep them off by default
 - add the (O)ff and re(B)oot help text if boot entries are not shown
 - drop irrelevant get_os_indications_supported() comment
 - s/ShutDown/Shutdown/

v3:
 - cast shutdown_system() reboot_system() to void

v4:
 - shutdown -> poweroff
 - add trailing ",ignoring" in parser message
 - drop explicit default state assignment to "false"

Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
2 years agosd-boot: sprinkle some ", ignoring" trailing messages
Emil Velikov [Fri, 6 Oct 2023 15:16:23 +0000 (16:16 +0100)] 
sd-boot: sprinkle some ", ignoring" trailing messages

As mentioned by Lennart:

  ... we typically suffix such messages with ", ignoring", to indicate
  that we don't consider this fatal for anything.

Update config_defaults_load_from_file() to follow that pattern.

Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
2 years agosd-boot: remove unneeded false assignment
Emil Velikov [Fri, 6 Oct 2023 15:12:43 +0000 (16:12 +0100)] 
sd-boot: remove unneeded false assignment

When the assignment is missing, the default 0/NULL/false value is used.
So drop the explicit piece in config_load_defaults()

Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
2 years agosd-boot: cast away reboot_into_firmware() return type
Emil Velikov [Fri, 6 Oct 2023 15:19:21 +0000 (16:19 +0100)] 
sd-boot: cast away reboot_into_firmware() return type

As mentioned by Lennart, in a commit where I was adding similar piece of
code:

  maybe cast this call to void, to tell static analyzers that we are
  ignoring the return value on purpose, not by accident

Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
2 years agobasic/macro: add comment explaining DEFINE_TRIVIAL_DESTRUCTOR() 29475/head
Zbigniew Jędrzejewski-Szmek [Fri, 6 Oct 2023 14:45:30 +0000 (16:45 +0200)] 
basic/macro: add comment explaining DEFINE_TRIVIAL_DESTRUCTOR()

2 years agofuzz-bus-match: drop unnecessary wrapper function
Zbigniew Jędrzejewski-Szmek [Thu, 5 Oct 2023 16:38:31 +0000 (18:38 +0200)] 
fuzz-bus-match: drop unnecessary wrapper function

Same confusion as in previous commit.

2 years agonspawn: drop unnecessary wrapper functions
Zbigniew Jędrzejewski-Szmek [Thu, 5 Oct 2023 16:58:55 +0000 (18:58 +0200)] 
nspawn: drop unnecessary wrapper functions

The naming was confused: suffix 'p' means that the function takes a pointer to
the type that the wrapped function takes. (E.g., a char**, for a wrapped function
taking a char*.)  But DEFINE_TRIVIAL_DESTRUCTOR() just changes the return type.

Also add one more assert for consistency.

2 years agocore: improve debug logs when failing to create symlinks in namespaces
Luca Boccassi [Fri, 6 Oct 2023 11:08:42 +0000 (12:08 +0100)] 
core: improve debug logs when failing to create symlinks in namespaces

I am seeing some failures and I don't know what is failing and why even
with debug logs, so add more details

2 years agoMerge pull request #29325 from poettering/varlink-introspect
Yu Watanabe [Fri, 6 Oct 2023 12:58:17 +0000 (21:58 +0900)] 
Merge pull request #29325 from poettering/varlink-introspect

varlink: add introspection support + varlinkctl + varlinkify one first command line tool (systemd-pcrextend)

2 years agoMerge pull request #29470 from yuwata/network-test-mode
Luca Boccassi [Fri, 6 Oct 2023 12:41:34 +0000 (13:41 +0100)] 
Merge pull request #29470 from yuwata/network-test-mode

network: introduce test mode

2 years agoupdate TODO 29325/head
Lennart Poettering [Fri, 22 Sep 2023 20:47:45 +0000 (22:47 +0200)] 
update TODO

2 years agotest: extend some existing tests with varlinkctl lines, to test varlinkctl + new...
Lennart Poettering [Tue, 26 Sep 2023 09:44:28 +0000 (11:44 +0200)] 
test: extend some existing tests with varlinkctl lines, to test varlinkctl + new PCRExtend service

2 years agopcrextend: make pcrextend tool acccessible via varlink
Lennart Poettering [Mon, 25 Sep 2023 14:28:24 +0000 (16:28 +0200)] 
pcrextend: make pcrextend tool acccessible via varlink

This is primarily supposed to be a 1st step with varlinkifying our
various command line tools, and excercise in how this might look like
across our codebase one day. However, at AllSystemsGo! 2023 it was
requested that we provide an API to do a PCR measurement along with a
matching event log record, and this provides that.

2 years agovarlinkctl: add new varlinkctl tool
Lennart Poettering [Fri, 22 Sep 2023 20:44:28 +0000 (22:44 +0200)] 
varlinkctl: add new varlinkctl tool

2 years agovarlink: add varlink_invocation() call
Lennart Poettering [Mon, 25 Sep 2023 14:00:00 +0000 (16:00 +0200)] 
varlink: add varlink_invocation() call

This call checks if we are invoked in a socket-activation Varlink server
context. It's useful for commands that can be run from the command line
or as Varlink service and then either serve commands from the cmdline or
those from Varlink.

2 years agovarlink: add new call varlink_server_loop_auto()
Lennart Poettering [Mon, 25 Sep 2023 13:57:39 +0000 (15:57 +0200)] 
varlink: add new call varlink_server_loop_auto()

This is a helper call that runs the specified VarlinkServer object in an
event loop, and exits once no more connections exist.

This is useful for pure varlink servers (i.e. those which only server
varlink requests and do nothing else), to run as long as there's
something to do and exit right after.

2 years agovarlink: add varlink_server_listen_auto() helper
Lennart Poettering [Mon, 25 Sep 2023 13:51:26 +0000 (15:51 +0200)] 
varlink: add varlink_server_listen_auto() helper

This new helper will automatically take listening fds passed in from the
service manager and processes varlink on them. It's useful for Varlink
services that shall be socket activatable.

2 years agovarlink: add exit-on-idle logic for Varlink server
Lennart Poettering [Mon, 25 Sep 2023 13:49:06 +0000 (15:49 +0200)] 
varlink: add exit-on-idle logic for Varlink server

This adds a logic that if enabled ensures sd_event_exit() is called
whenever the varlink connection count hits zero.

This is useful for implementing pure Varlink services (i.e. services
whose only job is to serve Varlink requests), that shall run only as
long as needed, i.e. as long as at least one request is being served.

2 years agotest: add test for varlink introspection logic
Lennart Poettering [Fri, 22 Sep 2023 20:44:09 +0000 (22:44 +0200)] 
test: add test for varlink introspection logic

2 years agooomd: move SubscriptionTaken Varlink error out of generic Varlink code
Lennart Poettering [Mon, 25 Sep 2023 09:49:38 +0000 (11:49 +0200)] 
oomd: move SubscriptionTaken Varlink error out of generic Varlink code

This error is a private error returned by PID 1 to oomd. It's internal,
and very specific to the use-case. Hence it should not be part of the
org.varlink.service interface (which isn't really our namespace anyway).

Hence, let's clean this up and move it over to the ManagedOOM varlink
interface of PID, where it belongs.

Since this is a private protocol of our two daemons, and the client
(i.e. oomd) doesn't explicitly test for this error anyway we can just
move it over without ill effects.

2 years agotree-wide: make all our Varlink APIs introspectable
Lennart Poettering [Fri, 22 Sep 2023 20:41:56 +0000 (22:41 +0200)] 
tree-wide: make all our Varlink APIs introspectable

2 years agovarlink: add varlink_connect_url() and varlink_connect_exec() calls
Lennart Poettering [Fri, 22 Sep 2023 20:40:35 +0000 (22:40 +0200)] 
varlink: add varlink_connect_url() and varlink_connect_exec() calls

2 years agovarlink: implement the org.varlink.service introspection interface by default + hook...
Lennart Poettering [Fri, 22 Sep 2023 20:39:25 +0000 (22:39 +0200)] 
varlink: implement the org.varlink.service introspection interface by default + hook up validator

Fixes: #23874
2 years agovarlink: add introspection data for the org.varlink.service and io.systemd interfaces
Lennart Poettering [Fri, 22 Sep 2023 20:35:18 +0000 (22:35 +0200)] 
varlink: add introspection data for the org.varlink.service and io.systemd interfaces

The official org.varlink.service interface definition, as per:

https://varlink.org/Service

And the io.systemd service where we carry some super generic errors our
Varlink implementation generates.

2 years agovarlink: allow associating Varlink IDL information with a VarlinkServer
Lennart Poettering [Fri, 22 Sep 2023 20:31:01 +0000 (22:31 +0200)] 
varlink: allow associating Varlink IDL information with a VarlinkServer

The data is not used for anything yet, but this will be added in later
commits.

2 years agovarlink: add IDL/introspection logic
Lennart Poettering [Fri, 22 Sep 2023 20:29:41 +0000 (22:29 +0200)] 
varlink: add IDL/introspection logic

2 years agotest-network: move get_dbus_dhcp_client_state() and friends to global
Yu Watanabe [Fri, 6 Oct 2023 05:10:18 +0000 (14:10 +0900)] 
test-network: move get_dbus_dhcp_client_state() and friends to global

2 years agoMerge pull request #29456 from yuwata/journal-replace-truncating-with-punching-holes
Daan De Meyer [Fri, 6 Oct 2023 07:18:06 +0000 (09:18 +0200)] 
Merge pull request #29456 from yuwata/journal-replace-truncating-with-punching-holes

journal: replace truncating with punching holes

2 years agoUpdate HACKING instructions
Daan De Meyer [Thu, 5 Oct 2023 15:04:53 +0000 (17:04 +0200)] 
Update HACKING instructions

Let's mention that we just need the latest stable release of mkosi,
not the latest git commit. We also split the instructions for building
on the host and the instructions for building with mkosi into two blocks,
as it's not required to build on the host anymore to build with mkosi.

2 years agoFix a typo in `systemctl-enable.c`
G2-Games [Fri, 6 Oct 2023 06:03:18 +0000 (01:03 -0500)] 
Fix a typo in `systemctl-enable.c`

2 years agovarlink: add new helper that reports whether connection is idle
Lennart Poettering [Fri, 22 Sep 2023 20:23:58 +0000 (22:23 +0200)] 
varlink: add new helper that reports whether connection is idle

This is useful to allow event loops to run exactly as long as there's
something to do but not longer.

2 years agoalloc-util: add realloc0() helper than is like realloc() but zero-initializes appende...
Lennart Poettering [Fri, 22 Sep 2023 20:22:12 +0000 (22:22 +0200)] 
alloc-util: add realloc0() helper than is like realloc() but zero-initializes appended space

2 years agofuzz: suppress log messages 29470/head
Yu Watanabe [Fri, 6 Oct 2023 04:26:16 +0000 (13:26 +0900)] 
fuzz: suppress log messages

2 years agolibsystemd-network: introduce $SYSTEMD_NETWORK_TEST_MODE environment variable
Yu Watanabe [Fri, 6 Oct 2023 04:22:04 +0000 (13:22 +0900)] 
libsystemd-network: introduce $SYSTEMD_NETWORK_TEST_MODE environment variable

Then, drop dhcp_client_set_test_mode() and friends.

2 years agojournalctl: verify that old entries are not sealed with too recent key (#28885)
felixdoerre [Fri, 6 Oct 2023 03:18:21 +0000 (05:18 +0200)] 
journalctl: verify that old entries are not sealed with too recent key (#28885)

When verifying seals produced with forward secure sealing, the verification
currently does not check that old entries are only sealed with the key for
their epoch and not a more recent one. This missing check allows an attacker
to remove seals, and create new ones with the currently available key, and
verify will claim everything is in order, although all entries could have
been modified.

This resolves CVE-2023-31439.

Co-authored-by: Felix Dörre <felix.doerre@kit.edu>
2 years agobacklight: support to specify percentage of minimum brightness
Yu Watanabe [Wed, 4 Oct 2023 12:46:26 +0000 (21:46 +0900)] 
backlight: support to specify percentage of minimum brightness

Closes #29328.

2 years agoman: fix typo
Yu Watanabe [Fri, 6 Oct 2023 02:18:07 +0000 (11:18 +0900)] 
man: fix typo

Follow-up for a121b331e37682341152b51269cf8ce00e68d755.

2 years agocore: fix typo
Yu Watanabe [Fri, 6 Oct 2023 02:15:30 +0000 (11:15 +0900)] 
core: fix typo

2 years agoMerge pull request #29417 from yuwata/sd-journal-cleanups-for-generic-array-bisect...
Yu Watanabe [Fri, 6 Oct 2023 02:04:07 +0000 (11:04 +0900)] 
Merge pull request #29417 from yuwata/sd-journal-cleanups-for-generic-array-bisect-plus-one

sd-journal: cleanups for generic_array_bisect_plus_one()

2 years agosd-journal: make journal_file_next_entry() always return the nearest entry object 29417/head
Yu Watanabe [Wed, 27 Sep 2023 19:55:21 +0000 (04:55 +0900)] 
sd-journal: make journal_file_next_entry() always return the nearest entry object

Previously, if the input offset 'p' does not point to an entry object,
the function returns the next of the nearest entry object on
DIRECTION_DOWN, as generic_array_bisect() already returns the nearest
entry object.

2 years agosd-journal: reduce number of calls generic_array_bisect_plus_one()
Yu Watanabe [Wed, 27 Sep 2023 19:15:04 +0000 (04:15 +0900)] 
sd-journal: reduce number of calls generic_array_bisect_plus_one()

If the first call of generic_array_bisect_plus_one() provides the same
offset, then it is not necessary to call the next one, as we already
know the entry object is also liked to the input data object.

Also, this make the function reuse the object returned by
generic_array_bisect_plus_one().

No functional change, just optimization.

2 years agosd-journal: drop unnecessary re-read of data object
Yu Watanabe [Wed, 27 Sep 2023 17:42:00 +0000 (02:42 +0900)] 
sd-journal: drop unnecessary re-read of data object

Follow-up for ec50313d4e329de276240883d86d05168a4cf09f.

The function generic_array_bisect_plus_one() does not read any new data
objects, so the data object is still valid, and not necessary to re-read it.

2 years agosd-journal: rewrite conditions for test result and direction
Yu Watanabe [Wed, 27 Sep 2023 03:47:35 +0000 (12:47 +0900)] 
sd-journal: rewrite conditions for test result and direction

No functional change, just refactoring. Hopefully the condition is more
descriptive now.

2 years agotest: add reproducer for SIGBUS issue caused by journal truncation 29456/head
Yu Watanabe [Thu, 5 Oct 2023 09:02:24 +0000 (18:02 +0900)] 
test: add reproducer for SIGBUS issue caused by journal truncation

The added code fails without the previous commit.

For issue #24320.

2 years agoMerge pull request #29438 from evelikov/document-rm-extra-uefi-vars
Luca Boccassi [Thu, 5 Oct 2023 23:12:49 +0000 (00:12 +0100)] 
Merge pull request #29438 from evelikov/document-rm-extra-uefi-vars

Document and purge LoaderConfigConsoleMode and LoaderEntryLastBooted

2 years agomachinectl: align UID shift status field properly
Lennart Poettering [Thu, 5 Oct 2023 20:44:23 +0000 (22:44 +0200)] 
machinectl: align UID shift status field properly

2 years agoimage-discover: skip properly over files that cannot be recognized as image files
Lennart Poettering [Thu, 5 Oct 2023 20:44:50 +0000 (22:44 +0200)] 
image-discover: skip properly over files that cannot be recognized as image files

Follow-up for: #29364

2 years agoMerge pull request #29364 from poettering/make-ddi-easy
Lennart Poettering [Thu, 5 Oct 2023 19:13:13 +0000 (21:13 +0200)] 
Merge pull request #29364 from poettering/make-ddi-easy

repart: make building DDIs easier (and other fixes)

2 years agosystemctl-show: align "Cntrl PID" correctly
Mike Yuan [Thu, 5 Oct 2023 16:49:45 +0000 (00:49 +0800)] 
systemctl-show: align "Cntrl PID" correctly

2 years agorepart: make arg_empty a proper enum with a string table 29364/head
Lennart Poettering [Wed, 4 Oct 2023 15:10:31 +0000 (17:10 +0200)] 
repart: make arg_empty a proper enum with a string table

Now that we translate in both directions (from enum to string, and
string to enum) let's just make the thing a proper enum with a proper
string table, like we generally do.

2 years agotest: test the new --make-ddi= logic
Lennart Poettering [Fri, 29 Sep 2023 16:02:18 +0000 (18:02 +0200)] 
test: test the new --make-ddi= logic

2 years agorepart: add simple mechanism to override fstype choices
Lennart Poettering [Thu, 5 Oct 2023 16:54:43 +0000 (18:54 +0200)] 
repart: add simple mechanism to override fstype choices

This is very useful for quickly testing things when building DDIs, in
particular in the CI, and trivial to add.

2 years agorepart: relax rules on CopyFiles= a bit
Lennart Poettering [Fri, 29 Sep 2023 14:44:45 +0000 (16:44 +0200)] 
repart: relax rules on CopyFiles= a bit

If a source dir doesn't exist, mention this, but continue.

This is useful to permit generic definitions that apply to all kinds of
trees, where some parts might remain unpopulated.

2 years agorepart: say image file instead of loopback file
Lennart Poettering [Thu, 28 Sep 2023 16:57:39 +0000 (18:57 +0200)] 
repart: say image file instead of loopback file

After all we can now operate without loopback device, so it might be a
big misleading.

2 years agosysext: fix some sysextisms in confext mode
Lennart Poettering [Thu, 28 Sep 2023 16:24:11 +0000 (18:24 +0200)] 
sysext: fix some sysextisms in confext mode

Nothing earth-shattering. Just make sure we never expose the string
"sysext" in "confext" mode.

2 years agodiscover-image: nicely support .sysext.raw + .confext.raw suffix for DDIs
Lennart Poettering [Thu, 28 Sep 2023 16:22:24 +0000 (18:22 +0200)] 
discover-image: nicely support .sysext.raw + .confext.raw suffix for DDIs

Back at Plumbers 2022 we discussed that we should push people towards
using the .sysext.raw and .confext.raw for their DDIs if they are
extension images. Let's actually support that, by chopping off these
suffixes when turning file names into "pretty image names".

2 years agorepart: make it easy to generate DDIs
Lennart Poettering [Thu, 28 Sep 2023 16:16:59 +0000 (18:16 +0200)] 
repart: make it easy to generate DDIs

This adds --make-ddi=confext, --make-ddi=sysext, --make-ddi=portable, to
make it really easiy to generate DDIs of the specified class. It
it's ultimately just a fancy wrapper around some defaults and in
particular --definitions=.

This makes it very easy to generate a confext:

 $ systemd-repart -C --private-key=privkey.pem --certificate=cert.crt -s mytree/ mytree.confext.raw

2 years agorepart: add new --copy-source= switch
Lennart Poettering [Fri, 29 Sep 2023 14:24:48 +0000 (16:24 +0200)] 
repart: add new --copy-source= switch

This specifies a directory to which CopyFiles= is considered relative.
If unset defaults to the --root=/--image= setting, or host / otherwise.

This is very similar to --root= but is much more focussed: it is really
and exclusively about CopyFiles= (and related settings such as
ExcludeFiles=) and does not affect any of the settings, i.e. it doesn't
affect CopyBlocks=, the machine ID/seed handling, or where definitions
are read from.

In fact, --root= and --copy-source= may be combined for example to
use the machine ID and similar from one tree, but the copy the files
from another.

2 years agorepart: drop redundant ()
Lennart Poettering [Fri, 29 Sep 2023 14:18:22 +0000 (16:18 +0200)] 
repart: drop redundant ()

2 years agorepart: get rid of redundant variable 'dry_run'
Lennart Poettering [Fri, 29 Sep 2023 14:16:03 +0000 (16:16 +0200)] 
repart: get rid of redundant variable 'dry_run'

There's only one case where we set 'dry_run', which is when
--empty=create is set. Hence simplify things and directly check for
that.

2 years agorepart: rework --empty= handling a bit
Lennart Poettering [Fri, 29 Sep 2023 14:09:50 +0000 (16:09 +0200)] 
repart: rework --empty= handling a bit

Introduce a new enum value EMPTY_UNSET to which arg_empty now is set
initially. Only after we finished parsing the command line we'll now set
this to EMPTY_REFUSE as before.

This prepares ground for later changes, where we then can make different
decisions after havig all input from the command line.

As of now this doesn't change behaviour of systemd-repart, it just
rearranges things a bit.

2 years agorepart: disable pager in --dry-run=no mode
Lennart Poettering [Thu, 28 Sep 2023 16:20:41 +0000 (18:20 +0200)] 
repart: disable pager in --dry-run=no mode

When --dry-run=yes is used it makes sense to spawn a pager to look at
the report it provides you with about what it is about to do. Hoewver,
when we are actually doing it, then the output is more in the category
of "logs" than "review material", and logs we generally don't page when
we generate them.

2 years agorepart: don't wipe the disk image if we just created it fresh
Lennart Poettering [Thu, 28 Sep 2023 16:08:48 +0000 (18:08 +0200)] 
repart: don't wipe the disk image if we just created it fresh

Let's avoid some unnecessary work if we the image is freshly created
anyway.

2 years agofileio: revamp search_and_fopen()
Lennart Poettering [Fri, 29 Sep 2023 13:37:58 +0000 (15:37 +0200)] 
fileio: revamp search_and_fopen()

Let's modernize and clean up search_and_fopen a bit: let's add support
for regular open() (instead of fopen()), as well as access() (if caller
just wants to check if a file exists without opening it.

This unifies much of the code involved, which previously was duplicated
in search_and_fopen() and search_and_fopen_nulstr()

2 years agoMerge pull request #29455 from poettering/scope-pidref
Lennart Poettering [Thu, 5 Oct 2023 16:40:32 +0000 (18:40 +0200)] 
Merge pull request #29455 from poettering/scope-pidref

pid1: allow creating scope units based on pidfds (as opposed to numeric pids)

2 years agodocs/HACKING: Arch has dropped asp in favor of pkgctl
Mike Yuan [Thu, 5 Oct 2023 15:21:01 +0000 (23:21 +0800)] 
docs/HACKING: Arch has dropped asp in favor of pkgctl

Prompted by #29461

See also: https://wiki.archlinux.org/title/Arch_build_system#Using_the_pkgctl_tool

2 years agoupdate TODO 29455/head
Lennart Poettering [Thu, 5 Oct 2023 07:56:29 +0000 (09:56 +0200)] 
update TODO

2 years agotree-wide: prefer sending pifds over pids when creating scope units
Lennart Poettering [Thu, 5 Oct 2023 07:55:28 +0000 (09:55 +0200)] 
tree-wide: prefer sending pifds over pids when creating scope units

2 years agopidref: add trivial helper pidref_set_self() to set pidref to our handle to our own...
Lennart Poettering [Thu, 5 Oct 2023 07:47:42 +0000 (09:47 +0200)] 
pidref: add trivial helper pidref_set_self() to set pidref to our handle to our own process

2 years agopid1: allow creating scope units based in pidfds instead of plain pids
Lennart Poettering [Thu, 5 Oct 2023 07:46:40 +0000 (09:46 +0200)] 
pid1: allow creating scope units based in pidfds instead of plain pids

2 years agomkosi: Update to latest
Daan De Meyer [Thu, 5 Oct 2023 13:17:01 +0000 (15:17 +0200)] 
mkosi: Update to latest

We have to set the image runtime size explicitly now so that's it's
grown a bit when we boot in nspawn or qemu.

2 years agomountpoint-util: Check hardcoded list before asking kernel if option is supported
Daan De Meyer [Thu, 5 Oct 2023 10:49:07 +0000 (12:49 +0200)] 
mountpoint-util: Check hardcoded list before asking kernel if option is supported

mount_option_supported() will call fsopen() which will probe the
kernel filesystem module. This means that we'll suddenly start
probing filesystem modules when running generators as those determine
which mount options to use. To prevent generators from loading kernel
filesystem modules as much as possible, let's always first check the
hardcoded list of filesystem which we know support a feature before
falling back to asking the kernel.

2 years agoMerge pull request #29454 from poettering/cg-pidref-get-path
Lennart Poettering [Thu, 5 Oct 2023 13:44:25 +0000 (15:44 +0200)] 
Merge pull request #29454 from poettering/cg-pidref-get-path

cgroup-util: add cg_pidref_get_path() helper and use it

2 years agoMerge pull request #29458 from poettering/serialize-pidref
Lennart Poettering [Thu, 5 Oct 2023 13:43:02 +0000 (15:43 +0200)] 
Merge pull request #29458 from poettering/serialize-pidref

pid1: serialize pidref as pidfd if possible

2 years agoMerge pull request #29439 from yuwata/mmap-cache-cleanups-part2
Daan De Meyer [Thu, 5 Oct 2023 12:49:48 +0000 (14:49 +0200)] 
Merge pull request #29439 from yuwata/mmap-cache-cleanups-part2

mmap-cache: several cleanups (part2)

2 years agoman: document LoaderEntryLastBooted 29438/head
Emil Velikov [Mon, 2 Oct 2023 16:56:42 +0000 (17:56 +0100)] 
man: document LoaderEntryLastBooted

The option was introduced with systemd v250 although it went
undocumented. It effectively sits between Default and OneShot, in term
of priority.

It is repeatedly updated as long as loader.conf default is "@saved" and
the OneShot is not set.

v2:
 - squash some typos

v3:
 - special mention to default @saved + loader.conf reference
 - reword update side, to avoid misleading that it's needlessly
   overwritten

Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
2 years agoMerge pull request #29453 from poettering/cgroup-no-controller
Lennart Poettering [Thu, 5 Oct 2023 11:31:02 +0000 (13:31 +0200)] 
Merge pull request #29453 from poettering/cgroup-no-controller

cgroup-util: drop "controller" argument from various cgroup helper calls

2 years agoupdate TODO 29454/head
Lennart Poettering [Thu, 5 Oct 2023 09:49:14 +0000 (11:49 +0200)] 
update TODO

2 years agocgroup-util: add cg_pidref_get_path() helper and use it
Lennart Poettering [Thu, 5 Oct 2023 09:49:07 +0000 (11:49 +0200)] 
cgroup-util: add cg_pidref_get_path() helper and use it

2 years agoMerge pull request #29442 from yuwata/network-dhcp4-preferred-address
Luca Boccassi [Thu, 5 Oct 2023 11:25:42 +0000 (12:25 +0100)] 
Merge pull request #29442 from yuwata/network-dhcp4-preferred-address

network: introduce [DHCPv4] PreferredAddress= setting

2 years agoupdate TODO 29458/head
Lennart Poettering [Thu, 5 Oct 2023 10:46:13 +0000 (12:46 +0200)] 
update TODO

2 years agopid1: serialize pidrefs as pidfds if possible
Lennart Poettering [Thu, 5 Oct 2023 10:45:38 +0000 (12:45 +0200)] 
pid1: serialize pidrefs as pidfds if possible

One major step towards total pidfdification of systemd.

2 years agorepart: Mention that xattrs are not copied when populating XFS with protofile
Daan De Meyer [Thu, 5 Oct 2023 08:42:26 +0000 (10:42 +0200)] 
repart: Mention that xattrs are not copied when populating XFS with protofile

2 years agoman: document LoaderConfigConsoleMode
Emil Velikov [Mon, 2 Oct 2023 16:31:36 +0000 (17:31 +0100)] 
man: document LoaderConfigConsoleMode

The variable was introduced with systemd v250 although it went
completely undocumented, even though sd-boot will honour and print it
separately (from the loader.conf one) in the boot help screen.

Document it in the systemd-boot and hint about it in loader.conf manual
pages.

Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
2 years agobootctl: remove all our non-volatile variables on uninstall
Emil Velikov [Mon, 2 Oct 2023 16:09:29 +0000 (17:09 +0100)] 
bootctl: remove all our non-volatile variables on uninstall

Grepping around showed a few extra entries that are not listed in the
remove_loader_variables() function. Namely:
 - BootNext
 - OsIndications
 - LoaderConfigConsoleMode
 - LoaderEntryLastBooted

Of which the latter two are systemd specific, even though they are
undocumented. Ensure they're removed - follow-up commits will add
documentation references.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2 years agojournal-file-util: Prefer punching holes instead of truncating
Daan De Meyer [Wed, 4 Oct 2023 07:27:18 +0000 (09:27 +0200)] 
journal-file-util: Prefer punching holes instead of truncating

It seems truncating might cause SIGBUS (#24320). Let's play it safe
and always prefer punching holes over truncating.