]> git.ipfire.org Git - thirdparty/systemd.git/log
thirdparty/systemd.git
13 months agorepart: Add MakeSymlinks= 34377/head
Daan De Meyer [Wed, 11 Sep 2024 15:11:45 +0000 (17:11 +0200)] 
repart: Add MakeSymlinks=

Similar to MakeDirectories=, but creates symlinks in the filesystem.

13 months agorepart: Add missing parameter comment
Daan De Meyer [Wed, 11 Sep 2024 16:44:44 +0000 (18:44 +0200)] 
repart: Add missing parameter comment

13 months agorepart: Fix memory corruption
Daan De Meyer [Wed, 11 Sep 2024 15:51:20 +0000 (17:51 +0200)] 
repart: Fix memory corruption

13 months agorepart: Reuse partition_needs_populate() more
Daan De Meyer [Wed, 11 Sep 2024 14:36:47 +0000 (16:36 +0200)] 
repart: Reuse partition_needs_populate() more

13 months agoMerge pull request #34353 from yuwata/timesync-bus-document
Lennart Poettering [Wed, 11 Sep 2024 08:15:30 +0000 (10:15 +0200)] 
Merge pull request #34353 from yuwata/timesync-bus-document

timesync: add document for org.freedesktop.timesync1

13 months agoMerge pull request #34348 from poettering/stub-efivar-tweaks
Lennart Poettering [Wed, 11 Sep 2024 08:09:53 +0000 (10:09 +0200)] 
Merge pull request #34348 from poettering/stub-efivar-tweaks

sd-stub: report stub location in efi vars

13 months agoChange OS X to macOS in BOOT.md (#34358)
Skye Chappelle [Wed, 11 Sep 2024 07:15:39 +0000 (03:15 -0400)] 
Change OS X to macOS in BOOT.md (#34358)

13 months agostub: add StubDevicePartUUID/StubImageIdentifier 34348/head
Lennart Poettering [Mon, 15 Jul 2024 14:11:31 +0000 (16:11 +0200)] 
stub: add StubDevicePartUUID/StubImageIdentifier

These variables closely mirror the existing
LoaderDevicePartUUID/LoaderImageIdentifier variables. But the Stub…
variables indicate the location of the stub/UKI (i.e. of systemd-stub),
while the Loader… variables indicate the location of the boot loader
(i.e. of systemd-boot). (Except of course, there is no boot loader used,
in which case both sets point to the stub/UKI, as a special case).

This actually matters, as we support that sd-boot runs off the ESP,
while a UKI then runs off XBOOTLDR, i.e. two distinct partitions.

13 months agostub: tweak setting of common Loader* EFI vars
Lennart Poettering [Mon, 15 Jul 2024 14:07:51 +0000 (16:07 +0200)] 
stub: tweak setting of common Loader* EFI vars

Let's always check if we have data to set *first*, and only then check
if an EFI var is already set.

Checking for the EFI var is more expensive after all.

13 months agoman: fix documentation for LoaderDevicePathUUID + LoaderImageIdentifier, in systemd...
Lennart Poettering [Mon, 15 Jul 2024 14:06:40 +0000 (16:06 +0200)] 
man: fix documentation for LoaderDevicePathUUID + LoaderImageIdentifier, in systemd-stub man page too

Let's fix the version here too, and also clarify that this is usually
not necessarily the ESP.

13 months agoman: fix LoaderDevicePathUUID + LoaderImageIdentifier descriptions
Lennart Poettering [Mon, 15 Jul 2024 13:48:42 +0000 (15:48 +0200)] 
man: fix LoaderDevicePathUUID + LoaderImageIdentifier descriptions

First of all, these were always set, i.e. since sd-boot was merged into
our tree, i.e. v220. Let's say so explicitly.

Also, let's be more accurate, regarding which partition this referes to:
it's usually "the" ESP, but given that you can make firmware boot from
arbitrary disks, it could be any other partition too. Hence, be
explicit on this.

Also, clarify tha sd-stub will set this too, if sd-boot never set it.

13 months agobootctl: show new sd-boot/sd-stub feature flags
Lennart Poettering [Tue, 2 Jul 2024 08:49:35 +0000 (10:49 +0200)] 
bootctl: show new sd-boot/sd-stub feature flags

13 months agosrc/sysext: Use versioned names when logging extensions used for merge operation
Maanya Goenka [Mon, 9 Sep 2024 16:25:32 +0000 (16:25 +0000)] 
src/sysext: Use versioned names when logging extensions used for merge operation

If this is not done, and there are two images, image_1.raw and image_2.raw under
an image.raw.v folder, then the log will say "Using extensions image" instead of
using "Using extensions image_2.raw" which is the desired behavior for v-picked extensions.

13 months agotmpfiles: add separate fragment for stuff we copy from .extra/ into /run/systemd
Lennart Poettering [Tue, 2 Jul 2024 14:01:47 +0000 (16:01 +0200)] 
tmpfiles: add separate fragment for stuff we copy from .extra/ into /run/systemd

Let's move copying out the PCR signature/key into its own tmpfiles
snippet.

And then let's add support for copying out the profile + os-release
information systemd-stub now places in the invoked initrd.

That way these four pieces of information are available even after the
initrd→host transition.

13 months agomeson: increase default number of available sections for the stub
Lennart Poettering [Wed, 10 Jul 2024 08:46:39 +0000 (10:46 +0200)] 
meson: increase default number of available sections for the stub

Now that we have multi-profile UKIs people likely want to stick more PE
sections into them than before. Hence, bump the number of available PE
section slots to 30 (up from 15). Also, make this configurable at build
time since some folks probably want even more, and others don't want
this at all.

(pre-allocating too many shouldn't matter too much btw, I'd advise
everyone to overshoot, except maybe on the tiniest of embedded boards)

13 months agoman: add basic documents for org.freedesktop.timesync1 34353/head
Yu Watanabe [Tue, 10 Sep 2024 19:42:50 +0000 (04:42 +0900)] 
man: add basic documents for org.freedesktop.timesync1

Closes #34352.

13 months agotimesync: add support of basic command line options
Yu Watanabe [Tue, 10 Sep 2024 19:05:31 +0000 (04:05 +0900)] 
timesync: add support of basic command line options

13 months agotimesync: use BusObjectImplementation
Yu Watanabe [Tue, 10 Sep 2024 19:03:57 +0000 (04:03 +0900)] 
timesync: use BusObjectImplementation

13 months agodoc-sync: strip point release from version before uploading
Luca Boccassi [Tue, 10 Sep 2024 15:37:04 +0000 (17:37 +0200)] 
doc-sync: strip point release from version before uploading

We create subdirectories for each major release, but not for point releases
so strip the suffix if it is present

13 months agocryptsetup: use the new crypt_token_set_external_path() API if available
Lennart Poettering [Tue, 10 Sep 2024 13:40:12 +0000 (15:40 +0200)] 
cryptsetup: use the new crypt_token_set_external_path() API if available

Let's make use of libcryptsetup's new crypt_token_set_external_path()
API in place of the interposition stuff we have been doing before. Let's
kill it entirely, given that this was a developer feature only anyway
(and guarded by an appropriate ifdef).

Fixes: #30098
13 months agohomectl: when chainloading a shell, prefix "-" rather than overriding first char
Lennart Poettering [Tue, 10 Sep 2024 13:30:44 +0000 (15:30 +0200)] 
homectl: when chainloading a shell, prefix "-" rather than overriding first char

Login shells are supposed to marked via a dash as first char. We follow
that logic, but right now we simply overwrite the first char of the
shell. That might not be the right choice, given that this turns
"zsh" into "-sh", which suggests some bourne shell process.

Hence, let's correct things, and instead prefix a dash, which should be
safer.

Inspired by findings on https://github.com/systemd/systemd/issues/34153#issuecomment-2338104907

13 months agoMerge pull request #34339 from poettering/uki-with-many-boot
Lennart Poettering [Tue, 10 Sep 2024 14:25:34 +0000 (16:25 +0200)] 
Merge pull request #34339 from poettering/uki-with-many-boot

sd-boot: synthesize one menu entry for each profile of multi-profile UKIs

13 months agohwdb: death to tabs!
Lennart Poettering [Tue, 10 Sep 2024 08:09:24 +0000 (10:09 +0200)] 
hwdb: death to tabs!

Some tabs snuck in here, but we don't like tabs in our codebase. Fix
them.

13 months agoMerge pull request #34331 from yuwata/network-netdev-cleanups
Yu Watanabe [Tue, 10 Sep 2024 13:05:55 +0000 (22:05 +0900)] 
Merge pull request #34331 from yuwata/network-netdev-cleanups

network/netdev: several cleanups for attaching/detaching netdev, and setting/getting ifindex from netdev

13 months agoudev/ata_id: export read look-ahead values
Tomas Bzatek [Tue, 10 Sep 2024 10:26:02 +0000 (12:26 +0200)] 
udev/ata_id: export read look-ahead values

Indicates whether the ATA read look-ahead feature is supported
and enabled.

Signed-off-by: Tomas Bzatek <tbzatek@redhat.com>
13 months agoboot: don't hardcode drop-in paths at multiple places 34339/head
Lennart Poettering [Thu, 4 Jul 2024 15:09:06 +0000 (17:09 +0200)] 
boot: don't hardcode drop-in paths at multiple places

Instead, let's define them once, and pass them through as parameters
everywhere.

13 months agoboot: synthesize a separate menu entry from each .profile section
Lennart Poettering [Fri, 28 Jun 2024 18:12:39 +0000 (20:12 +0200)] 
boot: synthesize a separate menu entry from each .profile section

This iterates through the .profile sections a UKI provides and uses it
to generate multiple menu entries from them, one for each .profile
section.

13 months agotest-network: add test more cases for assigned units for each interface 34331/head
Yu Watanabe [Tue, 10 Sep 2024 07:37:55 +0000 (16:37 +0900)] 
test-network: add test more cases for assigned units for each interface

13 months agonetwork/state-file: save assigned .netdev file even if the interface is unmanaged
Yu Watanabe [Tue, 10 Sep 2024 07:35:27 +0000 (16:35 +0900)] 
network/state-file: save assigned .netdev file even if the interface is unmanaged

Follow-up for 2cf9b1a0eed7bcd85543e19ba6f0d26767fe1163.

13 months agonetwork/vxcan: also manage peer interface name by manager
Yu Watanabe [Mon, 9 Sep 2024 09:00:28 +0000 (18:00 +0900)] 
network/vxcan: also manage peer interface name by manager

Then, the Link object for the peer interface can have a reference to the
corresponding NetDev object.

13 months agonetwork/vxcan: refuse when peer and the main interface names are equivalent
Yu Watanabe [Mon, 9 Sep 2024 18:01:14 +0000 (03:01 +0900)] 
network/vxcan: refuse when peer and the main interface names are equivalent

13 months agonetwork/l2tp: manage l2tp session name by Manager
Yu Watanabe [Mon, 9 Sep 2024 08:54:01 +0000 (17:54 +0900)] 
network/l2tp: manage l2tp session name by Manager

Then, Link object for an L2TP session can have reference to the
corresponding NetDev object.

13 months agonetwork/l2tp: refuse duplicated session name
Yu Watanabe [Mon, 9 Sep 2024 18:18:19 +0000 (03:18 +0900)] 
network/l2tp: refuse duplicated session name

13 months agonetwork/l2tp: downgrade log level of several messages
Yu Watanabe [Mon, 9 Sep 2024 18:05:18 +0000 (03:05 +0900)] 
network/l2tp: downgrade log level of several messages

Also, use log_section_warning_errno() where applicable.

13 months agonetwork/veth: also manage peer name by Manager
Yu Watanabe [Mon, 9 Sep 2024 08:38:16 +0000 (17:38 +0900)] 
network/veth: also manage peer name by Manager

Then, the Link object for the peer interface can have a reference to the
corresponding NetDev object.

13 months agonetwork/veth: refuse when peer and the main interface names are equivalent
Yu Watanabe [Mon, 9 Sep 2024 18:00:09 +0000 (03:00 +0900)] 
network/veth: refuse when peer and the main interface names are equivalent

13 months agonetwork/netdev: add attach(), detach(), set_ifindex(), and get_ifindex() to netdev...
Yu Watanabe [Mon, 9 Sep 2024 08:37:42 +0000 (17:37 +0900)] 
network/netdev: add attach(), detach(), set_ifindex(), and get_ifindex() to netdev vtable

Currently no vtable sets these functions, but will be used later.

13 months agonetwork/netdev: allow to register the same NetDev object with multiple names
Yu Watanabe [Mon, 9 Sep 2024 14:55:46 +0000 (23:55 +0900)] 
network/netdev: allow to register the same NetDev object with multiple names

Preparation for later commits.

13 months agonetwork/netdev: split out netdev_set_ifindex_internal() and _impl()
Yu Watanabe [Mon, 9 Sep 2024 15:57:25 +0000 (00:57 +0900)] 
network/netdev: split out netdev_set_ifindex_internal() and _impl()

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

13 months agonetwork/netdev: split out netdev_attach() and netdev_attach_name() from netdev_load_one()
Yu Watanabe [Mon, 9 Sep 2024 08:41:00 +0000 (17:41 +0900)] 
network/netdev: split out netdev_attach() and netdev_attach_name() from netdev_load_one()

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

13 months agonetwork/netdev: use hashmap_remove_value() on detaching NetDev from manager
Yu Watanabe [Mon, 9 Sep 2024 06:17:54 +0000 (15:17 +0900)] 
network/netdev: use hashmap_remove_value() on detaching NetDev from manager

Then, it is not necessary to free NetDev.ifname when a conflicting
.netdev file is already loaded.

This also split out netdev_detach_name() and netdev_detach_impl().

No functional change, just refactoring.

13 months agonetwork/netdev: downgrade log level in netdev_set_ifindex()
Yu Watanabe [Mon, 9 Sep 2024 13:39:50 +0000 (22:39 +0900)] 
network/netdev: downgrade log level in netdev_set_ifindex()

This also makes netdev_enter_failed() called on caller side.

No functional change, just refactoring.

13 months agonetwork/netdev: check family of received NEWLINK message
Yu Watanabe [Mon, 9 Sep 2024 13:46:27 +0000 (22:46 +0900)] 
network/netdev: check family of received NEWLINK message

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

13 months agonetwork/route: use NetDev object assigned to Link
Yu Watanabe [Mon, 9 Sep 2024 15:17:11 +0000 (00:17 +0900)] 
network/route: use NetDev object assigned to Link

13 months agonetwork/netdev: also check ifindex, iftype, and kind when assigning NetDev to Link
Yu Watanabe [Mon, 9 Sep 2024 15:12:41 +0000 (00:12 +0900)] 
network/netdev: also check ifindex, iftype, and kind when assigning NetDev to Link

Even when a NetDev object with the same name found, its iftype or kind
may be different. For safety, let's also check them.

13 months agoboot: only open type2 ukis once when parsing
Lennart Poettering [Mon, 1 Jul 2024 15:50:56 +0000 (17:50 +0200)] 
boot: only open type2 ukis once when parsing

13 months agoMerge pull request #34294 from poettering/uki-with-many-core
Lennart Poettering [Tue, 10 Sep 2024 06:59:53 +0000 (08:59 +0200)] 
Merge pull request #34294 from poettering/uki-with-many-core

multi-profile UKIs (systemd-stub hookup)

13 months agoMerge pull request #34318 from YHNdnzj/networkctl-edit-if-netdev
Yu Watanabe [Tue, 10 Sep 2024 05:32:28 +0000 (14:32 +0900)] 
Merge pull request #34318 from YHNdnzj/networkctl-edit-if-netdev

networkctl: support editing netdev files by link and cat ":all"

13 months agoMerge pull request #34336 from yuwata/nspawn-fuse-follow-ups
Yu Watanabe [Tue, 10 Sep 2024 05:32:09 +0000 (14:32 +0900)] 
Merge pull request #34336 from yuwata/nspawn-fuse-follow-ups

nspawn: follow-ups for FUSE support

13 months agostub: add ability to place multiple alternative PE sections of a specific type in... 34294/head
Lennart Poettering [Thu, 27 Jun 2024 20:21:58 +0000 (22:21 +0200)] 
stub: add ability to place multiple alternative PE sections of a specific type in the same UKI ("Multi-Profile UKIs")

This adds a ability to add alternative sections of a specific type in
the same UKI. The primary usecase is for supporting multiple different
kernel cmdlines that are baked into a UKI.

The mechanism is relatively simple (I think), in order to make it robust.

1. A new PE section ".profile" is introduced, that is a lot like
   ".osrel", but contains information about a specific "profile" to
   boot. The ".profile" section can appear multiple times in the same
   PE, and acts as delimiter indicating where a new profile starts.
   Everything before the first ".profile" is called the "base profile",
   and is shared among all other profiles, which can then override or
   add addition PE sections on top.

2. An UKI's command line can be prefixed with an argument such as "@0" or
   "@1" or "@2" which indicates the "profile" to boot. If no argument is
   specified the default is profile 0. Also, a UKI that lacks any
   .profile section is treated like one with only a profile 0, but with
   no data in that profile section.

3. The stub will first search for its usual set of PE sections
   (hereafter called "base sections"), and stop at the first .profile PE
   section if any. It will then find the .profile matching the selected
   profile by its index, and any sections found as part of that profile
   on top of the base sections.

And that's already it.

Example: let's say a distro wants to provide a single UKI that can be
invoked in one of three ways:

1. The regular profile that just boots the system
2. A profile that boots into storagetm
3. A profile that initiates factory reset and reboots.

For this it would define a classic UKI with sections .linux, .initrd,
.cmdline, and whatever else it needs. The .cmdline section would contain
the kernel command line for the regular profile.

It would then insert one ".profile" section, with a contents like the
following:

    ID=regular

This is the profile for profile 0. It would immediately afterwards add
another ".profile" section:

    ID=storagetm
    TITLE=Boot into Storage Target Mode

This would then followed with a .cmdline section that is just like the
basic one, but with "rd.systemd.unit=storage-target-mode.target"
suffixed. Then, another .profile section would be added:

    ID=factory-reset
    TITLE=Factory Reset

Which is then followed by one last PE section: a .cmdline one with
"systemd.unit=factory-reset.target" suffixed to te regular command line.

i.e. expressed in tabular form the above would be:

    The base profile:
          .linux
          .initrd
          .cmdline
          .osrel
    The regular boot profile:
          .profile
    The storagetm profile:
          .profile
          .cmdline
    The factory reset profile:
          .profile
          .cmdline

You might wonder why the first .cmdline in the list above is placed in
the base profile rather than in the regular boot profile, given that it
is overriden in all other profiles anyway. And you are right. The only
reason I'd place it in the base profile is that it makes the UKI more
nicely extensible if later profiles are added that want to replace
something else instead of the .cmdline, for example .ucode or so. But it
really doesn't matter much.

While the primary usecase is of course multiple alternative command
lines, the concept is more powerful than that: for various usecases it
might be valuable to offer multiple choices of devicetree, ucode or
initrds.

The .profile contents is also passed to the invoked kernel as a file in
/.extra/profile (via a synthetic initrd). Thus, this functionality can
even be useful without overriding any section at all, simply by means of
reading that file from userspace.

Design choices:

1. On purposes I used a special command line marker (i.e. the "@" thing,
   which maybe we should call the "profile selector"), that doesn't look
   like a regular kernel command line option.  This is because this is
   really not a regular kernel command line option – we process it in
   the stub, then remove it as prefix, and measure the unprefixed
   command line only after that. The kernel will not see the profile
   selector either. I think these special semantics are best
   communicated by making it look substantially different from regular
   options.

2. This moves around measurements a bit. Previously we measured our UKI
   sections right after finding them. Now we first parse the profile
   number from the command line, then search for the profile's sections,
   and only then measure the sections we actually end up using for this
   profile. I think that this logic makes most sense: measure what we
   are using, not what we are overriding. Or in other words, if you boot
   profile @3, then we'll measure .cmdline (assuming it exists) of
   profile 3, and *not* measure .cmdline of the base profile. Also note
   that if the user passes in a custom kernel command line via command
   line arguments we'll strip off the profile selector (i.e. the initial
   "@X" thing) before we pass it on.

3. The .profile stuff is supposed to be generic and extensible. For
   example we could use it in future to mark "dangerous" options such as
   factory reset, so that boot menus can ask for confirmation before
   booting into it. Or we could introduce match expressions against
   SMBIOS or other system identifiers, to filter out profiles on
   specific hw.

Note btw, that PE allows defining multiple sections that point to the
same offsets in the file. This allows sharing payload under different
names. For example, if profile @4 and @7 shall carry the same .ucode
section, they can define .ucode in each profile and then make it point to
the same offset.

Also note that that one can even "mask" a base section in a profile, by
inserting an empty section. For example, if the base .dtb section should
not be used for profile @4, then add a section .dtb right after the
fourth .profile with a zero size to the UKI, and you will get your wish
fulfilled.

This code only contains changes to sd-stub. A follow-up commit will
teach sd-boot to also find this profile PE sections to synthesize
additional menu entries from a single UKI.

A later commit will add support for gnerating this via ukify.

Fixes: #24539
13 months agoefi: teach PE parsing support for ".profile" sections
Lennart Poettering [Fri, 28 Jun 2024 17:54:46 +0000 (19:54 +0200)] 
efi: teach PE parsing support for ".profile" sections

This adds helpers for:

1. Returning the PE section table of open PE files or memory

2. Scanning PE section tables for the sections that belong to a specific
   profile

13 months agoefi: add free_and_xstrdup16() helper modelled after free_and_strdup() in userspace
Lennart Poettering [Mon, 9 Sep 2024 13:46:52 +0000 (15:46 +0200)] 
efi: add free_and_xstrdup16() helper modelled after free_and_strdup() in userspace

13 months agoMerge pull request #34297 from poettering/shell-prompt-extra
Lennart Poettering [Tue, 10 Sep 2024 04:42:31 +0000 (06:42 +0200)] 
Merge pull request #34297 from poettering/shell-prompt-extra

shell: define three system credentials we can propagate into shell prompts and welcome msgs

13 months agoMerge pull request #34328 from poettering/analyze-help-text
Lennart Poettering [Tue, 10 Sep 2024 04:42:03 +0000 (06:42 +0200)] 
Merge pull request #34328 from poettering/analyze-help-text

analyze: --help text improvements

13 months agoMerge pull request #34330 from poettering/shutdown-async-sync
Lennart Poettering [Tue, 10 Sep 2024 04:41:46 +0000 (06:41 +0200)] 
Merge pull request #34330 from poettering/shutdown-async-sync

shutdown: make all fsync()s asynchronous and apply timeout

13 months agonetworkctl: support editing netdev files by link and cat ":all" 34318/head
Mike Yuan [Sun, 8 Sep 2024 16:09:35 +0000 (18:09 +0200)] 
networkctl: support editing netdev files by link and cat ":all"

Also, don't abuse RET_GATHER in verb_cat(), where the failures
are most likely unrelated to each other.

Closes #34281

13 months agonetworkctl-status-link: show netdev files associated with link
Mike Yuan [Sat, 7 Sep 2024 18:12:04 +0000 (20:12 +0200)] 
networkctl-status-link: show netdev files associated with link

13 months agosd-network: introduce sd_network_link_get_netdev_file{,_dropins}
Mike Yuan [Sat, 7 Sep 2024 17:59:36 +0000 (19:59 +0200)] 
sd-network: introduce sd_network_link_get_netdev_file{,_dropins}

13 months agonetwork: store netdev drop-in paths and dump into state file
Mike Yuan [Sat, 7 Sep 2024 17:51:55 +0000 (19:51 +0200)] 
network: store netdev drop-in paths and dump into state file

13 months agonetworkd-state-file: use ASSERT_PTR where appropriate
Mike Yuan [Sat, 7 Sep 2024 17:49:11 +0000 (19:49 +0200)] 
networkd-state-file: use ASSERT_PTR where appropriate

13 months agonspawn: use ERRNO_IS_NEG_NOT_SUPPORTED() at one more place 34336/head
Yu Watanabe [Mon, 9 Sep 2024 18:44:50 +0000 (03:44 +0900)] 
nspawn: use ERRNO_IS_NEG_NOT_SUPPORTED() at one more place

Follow-up for dc3223919f663b7c8b8d8d1d6072b4487df7709b.
Addresses https://github.com/systemd/systemd/pull/34067#discussion_r1748061156.

Error codes other than ENOSYS may not come here, but if it comes, still
there is nothing we can do here, so let's not log the failure loudly.

13 months agonspawn: sync DeviceAllow= setting with systemd-nspawn@.service
Yu Watanabe [Mon, 9 Sep 2024 18:38:13 +0000 (03:38 +0900)] 
nspawn: sync DeviceAllow= setting with systemd-nspawn@.service

Follow-up for dc3223919f663b7c8b8d8d1d6072b4487df7709b.
Addresses https://github.com/systemd/systemd/pull/34067#discussion_r1748592958.

Otherwise, containers started with and without --keep-unit option run in
different device policies.

13 months agoshutdown: replace unbounded fsync() with bounded sync_with_progress() 34330/head
Lennart Poettering [Mon, 9 Sep 2024 15:53:03 +0000 (17:53 +0200)] 
shutdown: replace unbounded fsync() with bounded sync_with_progress()

Let's put a time-out on this syncing.

Inspired-by: #34289 #34283
13 months agoshutdown: teach sync_with_progress() to optionally sync a specific fd only
Lennart Poettering [Mon, 9 Sep 2024 15:49:33 +0000 (17:49 +0200)] 
shutdown: teach sync_with_progress() to optionally sync a specific fd only

This is preparation for reusing the logic for syncing DM and other
devices with a timeout applied.

13 months agomeson: tweak meson conditionalization for ssh{d,}_config drop-ins 34297/head
Lennart Poettering [Mon, 9 Sep 2024 11:59:10 +0000 (13:59 +0200)] 
meson: tweak meson conditionalization for ssh{d,}_config drop-ins

Let's make sure "no" is an acceptable setting for these paths.

13 months agoshell: define three system credentials we can propagate into shell prompts and welcom...
Lennart Poettering [Fri, 6 Sep 2024 14:30:54 +0000 (16:30 +0200)] 
shell: define three system credentials we can propagate into shell prompts and welcome messages

13 months agomachinectl: suppress redirection notice if --quiet is specified
Lennart Poettering [Fri, 31 May 2024 10:12:24 +0000 (12:12 +0200)] 
machinectl: suppress redirection notice if --quiet is specified

13 months agocore: Add support for PrivateUsers=identity
Daan De Meyer [Mon, 9 Sep 2024 10:25:28 +0000 (12:25 +0200)] 
core: Add support for PrivateUsers=identity

This configures an indentity mapping similar to
systemd-nspawn --private-users=identity.

13 months agoupdate keyboard hwdb to add acer Predator PHN16-72
Yanqing Jing [Mon, 9 Sep 2024 12:18:40 +0000 (20:18 +0800)] 
update keyboard hwdb to add acer Predator PHN16-72

13 months agoMerge pull request #34258 from yuwata/nspawn-volatile-u
Lennart Poettering [Mon, 9 Sep 2024 15:11:11 +0000 (17:11 +0200)] 
Merge pull request #34258 from yuwata/nspawn-volatile-u

nspawn: make --volatile work with -U

13 months agoanalyze: add some roughly useful subsections to --help text 34328/head
Lennart Poettering [Fri, 31 May 2024 10:42:02 +0000 (12:42 +0200)] 
analyze: add some roughly useful subsections to --help text

It's a long long list of verbs we support now, let's make it easier to
digest, like we did in systemctl --help and elsewhere.

13 months agoanalyze: add section underlining to --help text
Lennart Poettering [Fri, 31 May 2024 10:19:22 +0000 (12:19 +0200)] 
analyze: add section underlining to --help text

Do this like we usually do these days.

13 months agosysupdate: Add --transfer-source=
Daan De Meyer [Sun, 8 Sep 2024 14:09:19 +0000 (16:09 +0200)] 
sysupdate: Add --transfer-source=

In mkosi, I want to add a sysupdate verb to wrap systemd-sysupdate.
The definitions will be picked up from mkosi.sysupdate/ and passed
to systemd-sysupdate. I want users to be able to write transfer
definitions that are independent of the output directory used by
mkosi. To make this possible, it should be possible to specify the
directory that transfer sources should be looked up in on the sysupdate
command line. Let's allow this via a new --transfer-source= option.

Additionally, transfer sources that want to take advantage of this
feature should specify PathRelativeTo=directory to indicate the configured
Path= is interpreted relative to the tranfer source directory specified
on the CLI.

This allows for the following transfer definition to be put in
mkosi.sysupdate:

"""
[Transfer]
ProtectVersion=%A

[Source]
Type=regular-file
Path=/
PathRelativeTo=directory
MatchPattern=ParticleOS_@v.usr-%a.@u.raw

[Target]
Type=partition
Path=auto
MatchPattern=ParticleOS_@v
MatchPartitionType=usr
PartitionFlags=0
ReadOnly=1
"""

13 months agoMerge pull request #33833 from YHNdnzj/manager-reload-assert
Mike Yuan [Mon, 9 Sep 2024 12:21:57 +0000 (14:21 +0200)] 
Merge pull request #33833 from YHNdnzj/manager-reload-assert

core/manager: do not re-init Manager.lookup_paths when manager_reload(), minor assorted cleanups

13 months agorepart: Initialize split_name_format in copy_from_one()
Daan De Meyer [Sun, 8 Sep 2024 08:27:55 +0000 (10:27 +0200)] 
repart: Initialize split_name_format in copy_from_one()

Let's allow splitting the partitions from an existing disk image
by initializing split_name_format when using --copy-from=.

13 months agoMerge pull request #34307 from yuwata/linux-more-network-headers
Yu Watanabe [Mon, 9 Sep 2024 10:33:14 +0000 (19:33 +0900)] 
Merge pull request #34307 from yuwata/linux-more-network-headers

linux: import more network headers

13 months agoMerge pull request #34067 from LukeShu/lukeshu/nspawn-fuse
Yu Watanabe [Mon, 9 Sep 2024 10:32:16 +0000 (19:32 +0900)] 
Merge pull request #34067 from LukeShu/lukeshu/nspawn-fuse

nspawn: enable FUSE in containers

13 months agomissing_socket: drop unnecessary definitions 34307/head
Yu Watanabe [Sat, 7 Sep 2024 15:15:38 +0000 (00:15 +0900)] 
missing_socket: drop unnecessary definitions

Now, we have copy of vm_sockets.h, hence these definitions are not
necessary anymore.

13 months agomissing_network: drop unnecessary definition
Yu Watanabe [Sat, 7 Sep 2024 15:19:20 +0000 (00:19 +0900)] 
missing_network: drop unnecessary definition

Now we have ipv6.h, hence the definition is not necessary anymore.

13 months agoarphrd-list: use imported linux/if_arp.h
Yu Watanabe [Sat, 7 Sep 2024 14:36:06 +0000 (23:36 +0900)] 
arphrd-list: use imported linux/if_arp.h

13 months agolinux: import more network related headers from v6.11-rc6
Yu Watanabe [Sat, 7 Sep 2024 14:25:41 +0000 (23:25 +0900)] 
linux: import more network related headers from v6.11-rc6

Hopefully, no effective change.

13 months agoterminal-util: correct fd validity check
Mike Yuan [Sat, 7 Sep 2024 19:27:20 +0000 (21:27 +0200)] 
terminal-util: correct fd validity check

Follow-up for 14f594b995bbaea85456a4c26e5c07446a4c446e

13 months agoFix typo in escape.c
samuelvw01 [Sun, 8 Sep 2024 08:46:30 +0000 (10:46 +0200)] 
Fix typo in escape.c

13 months agoTODO: fix typo
Erik Sjölund [Sun, 8 Sep 2024 06:40:23 +0000 (08:40 +0200)] 
TODO: fix typo

14 months agoFix grammar in udevadm settle timeout message
marginaldev [Sun, 8 Sep 2024 02:35:11 +0000 (22:35 -0400)] 
Fix grammar in udevadm settle timeout message

14 months agonspawn: enable FUSE in containers 34067/head
Luke T. Shumaker [Wed, 21 Aug 2024 23:29:10 +0000 (17:29 -0600)] 
nspawn: enable FUSE in containers

Linux kernel v4.18 (2018-08-12) added user-namespace support to FUSE, and
bumped the FUSE version to 7.27 (see: da315f6e0398 (Merge tag
'fuse-update-4.18' of
git://git.kernel.org/pub/scm/linux/kernel/git/mszeredi/fuse, Linus Torvalds,
2018-06-07).  This means that on such kernels it is safe to enable FUSE in
nspawn containers.

In outer_child(), before calling copy_devnodes(), check the FUSE version to
decide whether enable (>=7.27) or disable (<7.27) FUSE in the container.  We
look at the FUSE version instead of the kernel version in order to enable FUSE
support on older-versioned kernels that may have the mentioned patchset
backported ([as requested by @poettering][1]).  However, I am not sure that
this is safe; user-namespace support is not a documented part of the FUSE
protocol, which is what FUSE_KERNEL_VERSION/FUSE_KERNEL_MINOR_VERSION are meant
to capture.  While the same patchset
 - added FUSE_ABORT_ERROR (which is all that the 7.27 version bump
   is documented as including),
 - bumped FUSE_KERNEL_MINOR_VERSION from 26 to 27, and
 - added user-namespace support
these 3 things are not inseparable; it is conceivable to me that a backport
could include the first 2 of those things and exclude the 3rd; perhaps it would
be safer to check the kernel version.

Do note that our get_fuse_version() function uses the fsopen() family of
syscalls, which were not added until Linux kernel v5.2 (2019-07-07); so if
nothing has been backported, then the minimum kernel version for FUSE-in-nspawn
is actually v5.2, not v4.18.

Pass whether or not to enable FUSE to copy_devnodes(); have copy_devnodes()
copy in /dev/fuse if enabled.

Pass whether or not to enable FUSE back over fd_outer_socket to run_container()
so that it can pass that to append_machine_properties() (via either
register_machine() or allocate_scope()); have append_machine_properties()
append "DeviceAllow=/dev/fuse rw" if enabled.

For testing, simply check that /dev/fuse can be opened for reading and writing,
but that actually reading from it fails with EPERM.  The test assumes that if
FUSE is supported (/dev/fuse exists), then the testsuite is running on a kernel
with FUSE >= 7.27; I am unsure how to go about writing a test that validates
that the version check disables FUSE on old kernels.

[1]: https://github.com/systemd/systemd/issues/17607#issuecomment-745418835

Closes #17607

14 months agoNEWS: fix typo
Yu Watanabe [Sat, 7 Sep 2024 13:26:21 +0000 (22:26 +0900)] 
NEWS: fix typo

Follow-up for 7a3a49386cc49d3971531ea24efb84232c05cc86.

14 months agoman/varlinkctl: fix typo
Yu Watanabe [Sat, 7 Sep 2024 13:23:38 +0000 (22:23 +0900)] 
man/varlinkctl: fix typo

Follow-up for 39ce86d19c7c3ac46b4afb546879ca8dcad1bdb2.

14 months agonetwork/route: fix typo
Yu Watanabe [Sat, 7 Sep 2024 13:22:41 +0000 (22:22 +0900)] 
network/route: fix typo

Follow-up for 195bb6f97ebc5cd5e9932c62aa80df5427c30d67.

14 months agocore/manager: do not re-init Manager.lookup_paths when manager_reload() 33833/head
Mike Yuan [Wed, 24 Jul 2024 19:24:13 +0000 (21:24 +0200)] 
core/manager: do not re-init Manager.lookup_paths when manager_reload()

Follow-up for 99aad9a2b9e2c06023a2043976fd9395332ff097

The commit changed lookup_paths_init_or_warn() call to
be fatal to manager_reload(), but invoke_main_loop()
assumes that manager_reload() would only return
recoverable error, and put the manager back to
MANAGER_OK in that case, which is spurious.

Looking at it more, it appears to be utterly unnecessary
to reinitialize LookupPaths here, given that nothing during
the reload process would change the search dirs. Let's drop
the path altogether hence.

14 months agocore/manager: rename NOTIFY_RCVBUF_SIZE to MANAGER_SOCKET_RCVBUF_SIZE
Mike Yuan [Thu, 5 Sep 2024 18:23:17 +0000 (20:23 +0200)] 
core/manager: rename NOTIFY_RCVBUF_SIZE to MANAGER_SOCKET_RCVBUF_SIZE

This is used for all our sockets, hence rename as so.

14 months agovarlinkctl: downgrade ignored error msg to LOG_WARNING
Mike Yuan [Sat, 7 Sep 2024 00:28:41 +0000 (02:28 +0200)] 
varlinkctl: downgrade ignored error msg to LOG_WARNING

Follow-up for 39ce86d19c7c3ac46b4afb546879ca8dcad1bdb2

14 months agochattr-util: use BIT_FOREACH where appropriate
Mike Yuan [Sat, 7 Sep 2024 00:44:24 +0000 (02:44 +0200)] 
chattr-util: use BIT_FOREACH where appropriate

14 months agochattr-util: set O_NOCTTY when reopening O_PATH fd
Mike Yuan [Sat, 7 Sep 2024 00:32:01 +0000 (02:32 +0200)] 
chattr-util: set O_NOCTTY when reopening O_PATH fd

Follow-up for 07862c9fc2becdc4bbe112b023591d2ab2dd032b

14 months agomkosi: Drop _fixperms workaround
Daan De Meyer [Sat, 7 Sep 2024 10:13:58 +0000 (12:13 +0200)] 
mkosi: Drop _fixperms workaround

This was added to deal with a bug in the rpm 4.20 rc in Rawhide
but since that's been fixed, let's drop the workaround.

14 months agodocs: use actual docs/HACKING.md URL
Michal Sekletar [Sat, 7 Sep 2024 10:05:09 +0000 (12:05 +0200)] 
docs: use actual docs/HACKING.md URL

14 months agonspawn: register_machine() and allocate_scope() bools to flags
Luke T. Shumaker [Thu, 29 Aug 2024 17:00:18 +0000 (11:00 -0600)] 
nspawn: register_machine() and allocate_scope() bools to flags

14 months agonspawn: re-flow comments that are wrapped weird
Luke T. Shumaker [Fri, 6 Sep 2024 07:15:35 +0000 (01:15 -0600)] 
nspawn: re-flow comments that are wrapped weird

14 months agotest: add a testcase for unprivileged nspawn
Luke T. Shumaker [Wed, 21 Aug 2024 23:29:10 +0000 (17:29 -0600)] 
test: add a testcase for unprivileged nspawn

Right now it mostly duplicates a test that already exists in
TEST-50-DISSECT.mountfsd.sh, but it serves as a template for more unprivileged
nspawn tests.

14 months agonspawn: convert copy_devnodes():devnodes from nulstr to strv
Luke T. Shumaker [Wed, 21 Aug 2024 23:17:02 +0000 (17:17 -0600)] 
nspawn: convert copy_devnodes():devnodes from nulstr to strv