]> git.ipfire.org Git - thirdparty/systemd.git/log
thirdparty/systemd.git
2 years agodissect-image: probe file system via main block device fd/image file fd 25591/head
Lennart Poettering [Wed, 30 Nov 2022 22:00:37 +0000 (23:00 +0100)] 
dissect-image: probe file system via main block device fd/image file fd

let's make sure we can probe file systems also when unprivileged:
instead of probing the partition block devices for file system
signatures, let's go via the original "whole" fd.

libblkid makes this easy actually, as it allows us to specify the
offset/size of the area to probe. And we have the partition
offsets/sizes anyway, so it's trivial for us to make use of.

This thus enables fs probing also when lacking privs and operating on
naked regular files without loopback devices or anything like this.

2 years agotest-loop-block: let's explicitly flush buffer cache on whole block device
Lennart Poettering [Thu, 1 Dec 2022 16:17:46 +0000 (17:17 +0100)] 
test-loop-block: let's explicitly flush buffer cache on whole block device

Let's explicitly flush the kernel's buffer cache on the whole block
device once we ran "mkfs". This is necessary, because partition and
whole block devices maintain separate buffer caches, and thus writing
to one will not be visible on the other if cached there already, until
the latter's cache is explicitly flushed.

This is preparation for later adding support for probing file sytems
also if we have no open partition block devices, and hence want to use
the whole block device instead.

2 years agotest-loop-block: also test dissection without ADD/PIN of partition block devices
Lennart Poettering [Thu, 1 Dec 2022 16:16:18 +0000 (17:16 +0100)] 
test-loop-block: also test dissection without ADD/PIN of partition block devices

Let's extend the test further, and try the codepaths where we do not
pin/add the partition block devices (i.e. which is the codepaths we use
when running without privs)

2 years agotest-loop-block: tighten tests a bit - check fstype, too
Lennart Poettering [Thu, 1 Dec 2022 16:15:10 +0000 (17:15 +0100)] 
test-loop-block: tighten tests a bit - check fstype, too

Let's verify that we properly created the file systems once we did so.
And tets this way that our dissector works correctly.

2 years agoMerge pull request #25593 from poettering/blkid-safeprobe-enum
Lennart Poettering [Thu, 1 Dec 2022 21:07:00 +0000 (22:07 +0100)] 
Merge pull request #25593 from poettering/blkid-safeprobe-enum

define symbolic enum for blkid_do_safeprobe() return values

2 years agoupdate TODO
Lennart Poettering [Thu, 1 Dec 2022 16:35:33 +0000 (17:35 +0100)] 
update TODO

2 years agoblkid-util: define enum for blkid_do_safeprobe() return values 25593/head
Lennart Poettering [Thu, 1 Dec 2022 14:37:59 +0000 (15:37 +0100)] 
blkid-util: define enum for blkid_do_safeprobe() return values

libblkid really should define an enum for this on its own, but it
currently doesn't and returns literal numeric values. Lets make this
more readable by adding our own symbolic names via an enum.

2 years agotree-wide: use errno_or_else() more, instead of homegrown checks
Lennart Poettering [Thu, 1 Dec 2022 14:36:55 +0000 (15:36 +0100)] 
tree-wide: use errno_or_else() more, instead of homegrown checks

2 years agoMerge pull request #25579 from DaanDeMeyer/copy-graceful-symlinks
Daan De Meyer [Thu, 1 Dec 2022 12:47:14 +0000 (13:47 +0100)] 
Merge pull request #25579 from DaanDeMeyer/copy-graceful-symlinks

repart: Ignore copy failures for unsupported file types

2 years agobuild(deps): bump ninja from 1.10.2.4 to 1.11.1 in /.github/workflows
dependabot[bot] [Thu, 1 Dec 2022 10:29:40 +0000 (10:29 +0000)] 
build(deps): bump ninja from 1.10.2.4 to 1.11.1 in /.github/workflows

Bumps [ninja](https://github.com/ninja-build/ninja) from 1.10.2.4 to 1.11.1.
- [Release notes](https://github.com/ninja-build/ninja/releases)
- [Commits](https://github.com/ninja-build/ninja/commits/v1.11.1)

---
updated-dependencies:
- dependency-name: ninja
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2 years agorepart: Ignore copy failures for unsupported file types 25579/head
Daan De Meyer [Wed, 30 Nov 2022 16:04:14 +0000 (17:04 +0100)] 
repart: Ignore copy failures for unsupported file types

e.g. vfat doesn't support symlinks, sockets, fifos, etc so let's ignore
any copy failures related to unsupported file types when populating
filesystems.

2 years agoMerge pull request #25554 from enr0n/follow-on-25509
Lennart Poettering [Thu, 1 Dec 2022 11:04:23 +0000 (12:04 +0100)] 
Merge pull request #25554 from enr0n/follow-on-25509

oomd: only check prefix_uid when uid != 0

2 years agodissect: rework DISSECT_IMAGE_ADD_PARTITION_DEVICES + DISSECT_IMAGE_OPEN_PARTITION_DE...
Lennart Poettering [Wed, 30 Nov 2022 16:17:20 +0000 (17:17 +0100)] 
dissect: rework DISSECT_IMAGE_ADD_PARTITION_DEVICES + DISSECT_IMAGE_OPEN_PARTITION_DEVICES

Curently, these two flags were implied by dissect_loop_device(), but
that's not right, because this means systemd-gpt-auto-generator will
dissect the root block device with these flags set and that's not
desirable: the generator should not cause the partition devices to be
created (we don't intend to use them right-away after all, but expect
udev to find/probe them first, and then mount them though .mount units).
And there's no point in opening the partition devices, since we do not
intend to mount them via fds either.

Hence, rework this: instead of implying the flags, specify them
explicitly.

While we are at it, let's also rename the flags to make them more
descriptive:

DISSECT_IMAGE_MANAGE_PARTITION_DEVICES becomes
DISSECT_IMAGE_ADD_PARTITION_DEVICES, since that's really all this does:
add the partition devices via BLKPG.

DISSECT_IMAGE_OPEN_PARTITION_DEVICES becomes
DISSECT_IMAGE_PIN_PARTITION_DEVICES, since we not only open the devices,
but keep the devices open continously (i.e. we "pin" them).

Also, drop the DISSECT_IMAGE_BLOCK_DEVICE combination flag, since it is
misleading, i.e. it suggests it was appropriate to specify on all
dissected blocking devices, but that's precisely not the case, see the
systemd-gpt-auto-generator case. My guess is that the confusion around
this was actually the cause for this bug we are addressing here.

Fixes: #25528
2 years agoterminal-util: Set OPOST when setting ONLCR
Ray Strode [Wed, 30 Nov 2022 19:07:29 +0000 (14:07 -0500)] 
terminal-util: Set OPOST when setting ONLCR

reset_terminal_fd sets certain minimum required terminal attributes
that systemd relies on.

One of those attributes is `ONLCR` which ensures that when a new line
is sent to the terminal, that the cursor not only moves to the next
line, but also moves to the very beginning of that line.

In order for `ONLCR` to work, the terminal needs to perform output
post-processing. That requires an additional attribute, `OPOST`,
which reset_terminal_fd currently fails to ensure is set.

In most cases `OPOST` (and `ONLCR` actually) are both set anyway, so
it's not an issue, but it could be a problem if, e.g., the terminal was
put in raw mode by a program and the program unexpectedly died before
restoring settings.

This commit ensures when `ONLCR` is set `OPOST` is set too, which is
the only thing that really makes sense to do.

2 years agobuild(deps): bump meson from 0.63.3 to 0.64.1 in /.github/workflows
dependabot[bot] [Thu, 1 Dec 2022 09:01:42 +0000 (09:01 +0000)] 
build(deps): bump meson from 0.63.3 to 0.64.1 in /.github/workflows

Bumps [meson](https://github.com/mesonbuild/meson) from 0.63.3 to 0.64.1.
- [Release notes](https://github.com/mesonbuild/meson/releases)
- [Commits](https://github.com/mesonbuild/meson/compare/0.63.3...0.64.1)

---
updated-dependencies:
- dependency-name: meson
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2 years agobuild(deps): bump redhat-plumbers-in-action/differential-shellcheck
dependabot[bot] [Thu, 1 Dec 2022 09:01:46 +0000 (09:01 +0000)] 
build(deps): bump redhat-plumbers-in-action/differential-shellcheck

Bumps [redhat-plumbers-in-action/differential-shellcheck](https://github.com/redhat-plumbers-in-action/differential-shellcheck) from 3.1.1 to 3.2.1.
- [Release notes](https://github.com/redhat-plumbers-in-action/differential-shellcheck/releases)
- [Changelog](https://github.com/redhat-plumbers-in-action/differential-shellcheck/blob/main/CHANGELOG.md)
- [Commits](https://github.com/redhat-plumbers-in-action/differential-shellcheck/compare/1b1b75e42f0694c1012228513b21617a748c866e...f3cd08fcf12680861615270b29494d2b87c3e1cc)

---
updated-dependencies:
- dependency-name: redhat-plumbers-in-action/differential-shellcheck
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2 years agobuild(deps): bump actions/upload-artifact from 3.1.0 to 3.1.1
dependabot[bot] [Thu, 1 Dec 2022 09:01:43 +0000 (09:01 +0000)] 
build(deps): bump actions/upload-artifact from 3.1.0 to 3.1.1

Bumps [actions/upload-artifact](https://github.com/actions/upload-artifact) from 3.1.0 to 3.1.1.
- [Release notes](https://github.com/actions/upload-artifact/releases)
- [Commits](https://github.com/actions/upload-artifact/compare/v3.1.0...83fd05a356d7e2593de66fc9913b3002723633cb)

---
updated-dependencies:
- dependency-name: actions/upload-artifact
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2 years agobuild(deps): bump redhat-plumbers-in-action/advanced-issue-labeler
dependabot[bot] [Thu, 1 Dec 2022 09:01:38 +0000 (09:01 +0000)] 
build(deps): bump redhat-plumbers-in-action/advanced-issue-labeler

Bumps [redhat-plumbers-in-action/advanced-issue-labeler](https://github.com/redhat-plumbers-in-action/advanced-issue-labeler) from 2.0.0 to 2.0.1.
- [Release notes](https://github.com/redhat-plumbers-in-action/advanced-issue-labeler/releases)
- [Commits](https://github.com/redhat-plumbers-in-action/advanced-issue-labeler/compare/fe9c43b7d77bd8bd7fbe86c2c217e74ebeea71f2...88209aef583c66312529c515d41ea6a710a4baba)

---
updated-dependencies:
- dependency-name: redhat-plumbers-in-action/advanced-issue-labeler
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2 years agoTODO: add unprivileged nspawn item
Christian Brauner [Wed, 30 Nov 2022 15:05:31 +0000 (16:05 +0100)] 
TODO: add unprivileged nspawn item

Signed-off-by: Christian Brauner (Microsoft) <brauner@kernel.org>
2 years agoTODO: add socket reduction entry for nspawn
Christian Brauner [Wed, 30 Nov 2022 15:03:42 +0000 (16:03 +0100)] 
TODO: add socket reduction entry for nspawn

Signed-off-by: Christian Brauner (Microsoft) <brauner@kernel.org>
2 years agoTODO: add CLONE_PARENT entry for nspawn
Christian Brauner [Wed, 30 Nov 2022 15:02:39 +0000 (16:02 +0100)] 
TODO: add CLONE_PARENT entry for nspawn

Signed-off-by: Christian Brauner (Microsoft) <brauner@kernel.org>
2 years agoTODO: consolidate nspawn items
Christian Brauner [Wed, 30 Nov 2022 15:01:07 +0000 (16:01 +0100)] 
TODO: consolidate nspawn items

Signed-off-by: Christian Brauner (Microsoft) <brauner@kernel.org>
2 years agocopy: Add COPY_GRACEFUL_WARN
Daan De Meyer [Wed, 30 Nov 2022 16:01:09 +0000 (17:01 +0100)] 
copy: Add COPY_GRACEFUL_WARN

When copying between filesystems, sometimes the target filesystem
might not support symlinks/fifos/sockets/... and we want to log and
ignore  any failures to copy such files when copying. Let's introduce
a new flag to enable this behavior.

2 years agoMerge pull request #25578 from mrc0mmand/test-shutdown-tweaks
Yu Watanabe [Thu, 1 Dec 2022 07:37:16 +0000 (16:37 +0900)] 
Merge pull request #25578 from mrc0mmand/test-shutdown-tweaks

test: give the container time to properly shut down on exception

2 years agoupdate TODO
Lennart Poettering [Wed, 30 Nov 2022 16:26:02 +0000 (17:26 +0100)] 
update TODO

2 years agotest: a couple of pylint-related tweaks 25578/head
Frantisek Sumsal [Wed, 30 Nov 2022 15:18:50 +0000 (16:18 +0100)] 
test: a couple of pylint-related tweaks

2 years agotest: give the container time to properly shut down on exception
Frantisek Sumsal [Wed, 30 Nov 2022 15:13:19 +0000 (16:13 +0100)] 
test: give the container time to properly shut down on exception

Otherwise the `terminate()` method sends SIGKILL rather quickly (~0.3s),
which then leaves a dangling scope on the host system, breaking further
test executions.

2 years agoMerge pull request #25574 from bluca/gh_wf
Daan De Meyer [Wed, 30 Nov 2022 13:28:05 +0000 (14:28 +0100)] 
Merge pull request #25574 from bluca/gh_wf

actions: restrict development_freeze to main repo and disable codeql on security repo

2 years agoGA: do not run codeql on systemd-security 25574/head
Luca Boccassi [Wed, 30 Nov 2022 10:28:34 +0000 (10:28 +0000)] 
GA: do not run codeql on systemd-security

Scanning is not available on private repositories

2 years agoGA: run development_freeze only on main repository
Luca Boccassi [Wed, 30 Nov 2022 10:28:13 +0000 (10:28 +0000)] 
GA: run development_freeze only on main repository

No point in running this checker on other forks

2 years agosd-netlink: fix assertion triggered by message_get_serial()
Yu Watanabe [Wed, 30 Nov 2022 00:20:12 +0000 (09:20 +0900)] 
sd-netlink: fix assertion triggered by message_get_serial()

This fixes an issue introduced by 7b34bae3b1a8726e241a56600a6edf9b3733a4f4.

Fixes https://github.com/systemd/systemd/pull/25565#issuecomment-1331353945.

2 years agomkfs-util: fix memleak
Yu Watanabe [Wed, 30 Nov 2022 00:26:13 +0000 (09:26 +0900)] 
mkfs-util: fix memleak

Fixes an issure introduced by c75cf0164cbd69104f13cbe7be42ab639953bd7d.

Fixes CID#1501073.

2 years agocgtop: Update code comments
Michal Koutný [Tue, 29 Nov 2022 12:23:51 +0000 (13:23 +0100)] 
cgtop: Update code comments

2 years agoMerge pull request #25561 from poettering/btrfs-quota-opath-fix
Yu Watanabe [Wed, 30 Nov 2022 00:30:13 +0000 (09:30 +0900)] 
Merge pull request #25561 from poettering/btrfs-quota-opath-fix

tmpfiles: fix btrfs quota logic

2 years agoMerge pull request #25565 from poettering/dissect-optimizations
Yu Watanabe [Wed, 30 Nov 2022 00:28:42 +0000 (09:28 +0900)] 
Merge pull request #25565 from poettering/dissect-optimizations

two dissect-image.c optimizations/tweaks

2 years agooomd: fix doc comment for oomd_fetch_cgroup_oom_preference 25554/head
Nick Rosbrook [Tue, 29 Nov 2022 20:49:05 +0000 (15:49 -0500)] 
oomd: fix doc comment for oomd_fetch_cgroup_oom_preference

Explicitly state that ManagedOOMPreference is always honored when the
unit's cgroup is owned by root.

2 years agoman: clarify ManagedOOMPreference documentation
Nick Rosbrook [Tue, 29 Nov 2022 20:40:22 +0000 (15:40 -0500)] 
man: clarify ManagedOOMPreference documentation

Explicitly state that ManagedOOMPreference is always honored when the
unit's cgroup is owned by root.

2 years agooomd: only check prefix_uid when uid != 0
Nick Rosbrook [Mon, 28 Nov 2022 16:13:08 +0000 (11:13 -0500)] 
oomd: only check prefix_uid when uid != 0

If the cgroup is owned by root there is no need to get prefix_uid. Only
check prefix_uid when uid != 0, and then set MANAGED_OOM_PREFERENCE_NONE
and return early if uid != prefix_uid.

2 years agodissect-image: merge handlers for 4 different partition designators into one 25565/head
Lennart Poettering [Tue, 29 Nov 2022 17:30:18 +0000 (18:30 +0100)] 
dissect-image: merge handlers for 4 different partition designators into one

These four branches execute the exact same code these days, hence merge
them into one.

2 years agodissect-image: don't probe swap partitions needlessly
Lennart Poettering [Tue, 29 Nov 2022 17:24:32 +0000 (18:24 +0100)] 
dissect-image: don't probe swap partitions needlessly

We already know it's swap, we can assume it's also fstype swap, and
don#t need to probe things later again.

2 years agohwdb: add Clevo touchpad toggle key quirks
Michał Kotyla [Thu, 24 Nov 2022 12:10:08 +0000 (13:10 +0100)] 
hwdb: add Clevo touchpad toggle key quirks

2 years agoupdate TODO
Lennart Poettering [Tue, 29 Nov 2022 15:55:48 +0000 (16:55 +0100)] 
update TODO

2 years agounits: change Requires=systemd-networkd.service → BindsTo= one more time
Lennart Poettering [Tue, 29 Nov 2022 10:18:51 +0000 (11:18 +0100)] 
units: change Requires=systemd-networkd.service → BindsTo= one more time

Follow-up for da15f8406e9aeb7908e1d92c02d2ff5147c7788a which did the
change for systemd-networkd-wait-online.service, let's also do this for
systemd-networkd-wait-online@.service

2 years agoMerge pull request #25558 from poettering/fdisk-id128
Lennart Poettering [Tue, 29 Nov 2022 15:06:10 +0000 (16:06 +0100)] 
Merge pull request #25558 from poettering/fdisk-id128

add generic uuid/id128 helpers for libfdisk too

2 years agoblkid: add helpers that get gpt partition uuid as sd_id128_t
Lennart Poettering [Tue, 25 Oct 2022 15:32:01 +0000 (17:32 +0200)] 
blkid: add helpers that get gpt partition uuid as sd_id128_t

just some refactoring to make things simpler.

2 years agobtrfs-util: convert O_PATH if necessary, in btrfs quota call 25561/head
Lennart Poettering [Tue, 29 Nov 2022 14:31:50 +0000 (15:31 +0100)] 
btrfs-util: convert O_PATH if necessary, in btrfs quota call

Fixes: #25468
2 years agoblockdev-util: move O_PATH fd conversion into btrfs_get_block_device_fd() to shorten...
Lennart Poettering [Tue, 29 Nov 2022 14:31:31 +0000 (15:31 +0100)] 
blockdev-util: move O_PATH fd conversion into btrfs_get_block_device_fd() to shorten things

And let's use a simple call to the new fd_reopen_condition() helper
there.

2 years agobtrfs-util: convert to fd_reopen_condition()
Lennart Poettering [Tue, 29 Nov 2022 14:30:55 +0000 (15:30 +0100)] 
btrfs-util: convert to fd_reopen_condition()

2 years agofd-util: add new helper fd_reopen_conditional()
Lennart Poettering [Tue, 29 Nov 2022 14:29:25 +0000 (15:29 +0100)] 
fd-util: add new helper fd_reopen_conditional()

This is a wrapper around fd_reopen() that will reopen an fd if the
F_GETFL flags indicate this is necessary, and otherwise not.

This is useful for various utility calls that shall be able to operate
on O_PATH and without it, and might need to convert between the two
depending on what's passed in.

2 years agoMerge pull request #25385 from drvink/main
Lennart Poettering [Tue, 29 Nov 2022 13:40:18 +0000 (14:40 +0100)] 
Merge pull request #25385 from drvink/main

systemd: Support OOMPolicy in scope units

2 years agofdisk-util: add fdisk_partition_get_type_as_id128() helper 25558/head
Lennart Poettering [Tue, 29 Nov 2022 11:06:35 +0000 (12:06 +0100)] 
fdisk-util: add fdisk_partition_get_type_as_id128() helper

Let's also add an easy accessor for the other per-partition UUID.

2 years agofdisk-util: add fdisk_partition_get_uuid_as_id128() helper
Lennart Poettering [Tue, 29 Nov 2022 10:54:22 +0000 (11:54 +0100)] 
fdisk-util: add fdisk_partition_get_uuid_as_id128() helper

Inspired by: #25534

2 years agokernel-install: Add uki layout
Joerg Behrmann [Wed, 23 Nov 2022 15:43:19 +0000 (16:43 +0100)] 
kernel-install: Add uki layout

Currently the kernel-install man page only documents the bls layout for use
with the boot loader spec type #1. 90-loaderentry.install uses this layout to
generate loader entries and copy the kernel image and initrd to $BOOT.

This commit documents a second layout "uki" and adds 90-uki-copy.install,
which copies a UKI "uki.efi" from the staging area or any file with the .efi
extension given on the command line to
$BOOT/EFI/Linux/$ENTRY_TOKEN-$KERNEl_VERSION(+$TRIES).efi

This allows for both locally generated and distro-provided UKIs to be handled
by kernel-install.

2 years agoupdate TODO
Lennart Poettering [Tue, 29 Nov 2022 09:47:39 +0000 (10:47 +0100)] 
update TODO

2 years agoMerge pull request #25132 from yuwata/core-device-inactivate-removed-device-on-switch...
Daan De Meyer [Tue, 29 Nov 2022 09:27:34 +0000 (10:27 +0100)] 
Merge pull request #25132 from yuwata/core-device-inactivate-removed-device-on-switching-root

core/device: inactivate removed device on switching root

2 years agoMerge pull request #25508 from enr0n/test-various-fixes
Yu Watanabe [Tue, 29 Nov 2022 04:46:39 +0000 (13:46 +0900)] 
Merge pull request #25508 from enr0n/test-various-fixes

Fix test failures found in Ubuntu autopkgtest

2 years agoMerge pull request #25536 from yuwata/sd-netlink-several-fixes
Yu Watanabe [Tue, 29 Nov 2022 01:35:07 +0000 (10:35 +0900)] 
Merge pull request #25536 from yuwata/sd-netlink-several-fixes

sd-netlink: several fixes

2 years agoMerge pull request #25552 from yuwata/network-ndisc-trivial-fixes
Yu Watanabe [Tue, 29 Nov 2022 01:33:33 +0000 (10:33 +0900)] 
Merge pull request #25552 from yuwata/network-ndisc-trivial-fixes

network: NDisc: trivial fixes

2 years agoMerge pull request #25532 from Werkov/fix-cgtop-args
Luca Boccassi [Mon, 28 Nov 2022 21:20:47 +0000 (22:20 +0100)] 
Merge pull request #25532 from Werkov/fix-cgtop-args

cgtop: Do not rewrite -P or -k options

2 years agohwdb: Add support for Elgato Stream Pedal (#25550)
Tonći Galić [Mon, 28 Nov 2022 20:15:25 +0000 (21:15 +0100)] 
hwdb: Add support for Elgato Stream Pedal (#25550)

This adds the [Elgato Stream Pedal](https://www.elgato.com/en/stream-deck-pedal)
as part of the supported family

2 years agonetwork: drop invalid and unused flag 25552/head
Yu Watanabe [Mon, 28 Nov 2022 19:30:38 +0000 (04:30 +0900)] 
network: drop invalid and unused flag

Route.flags can only take RTNH_F_ONLINK, and other flags are silently
dropped.

2 years agonetwork: fix indentation
Yu Watanabe [Mon, 28 Nov 2022 19:30:12 +0000 (04:30 +0900)] 
network: fix indentation

2 years agotest: handle Debian's /etc/default/locale in testsuite-74.firstboot.sh 25508/head
Nick Rosbrook [Tue, 22 Nov 2022 17:50:33 +0000 (12:50 -0500)] 
test: handle Debian's /etc/default/locale in testsuite-74.firstboot.sh

This handles a Debian-specific quirk where /etc/default/locale is used
instead of /etc/locale.conf. There is currently special handling for
this in testsuite-73.sh, so the quirk should be handled here too for
consistency.

2 years agotest: make sure mount point exists in testsuite-64.sh
Nick Rosbrook [Tue, 22 Nov 2022 17:43:51 +0000 (12:43 -0500)] 
test: make sure mount point exists in testsuite-64.sh

2 years agoMerge pull request #25496 from DaanDeMeyer/repart-optimize
Luca Boccassi [Mon, 28 Nov 2022 14:51:32 +0000 (15:51 +0100)] 
Merge pull request #25496 from DaanDeMeyer/repart-optimize

repart: Prefer using loop devices to populate filesystems when available

2 years agoMerge pull request #25222 from medhefgo/stub-cmdline
Luca Boccassi [Mon, 28 Nov 2022 14:49:17 +0000 (15:49 +0100)] 
Merge pull request #25222 from medhefgo/stub-cmdline

stub: Fix cmdline handling

2 years agotest: Add tests for systemd-cgtop args parsing 25532/head
Michal Koutný [Fri, 25 Nov 2022 17:14:22 +0000 (18:14 +0100)] 
test: Add tests for systemd-cgtop args parsing

2 years agocgtop: Do not rewrite -P or -k options
Michal Koutný [Fri, 25 Nov 2022 16:50:27 +0000 (17:50 +0100)] 
cgtop: Do not rewrite -P or -k options

--recursive=no will overwrite possible -P or -k option hence making the
recursive disabling impossible.

Check what counting types the system supports (encoded in the ordering
of our enum) of and pick whatever user requests but is also supported.

Fixes: #25248
2 years agorepart: Prefer using loop devices to populate filesystems when available 25496/head
Daan De Meyer [Wed, 23 Nov 2022 11:00:01 +0000 (12:00 +0100)] 
repart: Prefer using loop devices to populate filesystems when available

Let's make sure we use loop devices if we have access to them and
only fall back to regular files if we can't use loop devices. We
prefer loop devices because when using mkfs --root options, we have
to populate a temporary staging tree which means we're copying every
file twice instead of once when using loop devices.

2 years agorepart: Make sure all files in the image are owned by root
Daan De Meyer [Wed, 23 Nov 2022 11:07:27 +0000 (12:07 +0100)] 
repart: Make sure all files in the image are owned by root

2 years agorepart: Move comment
Daan De Meyer [Wed, 23 Nov 2022 09:26:33 +0000 (10:26 +0100)] 
repart: Move comment

2 years agostub: Detect empty LoadOptions when run from EFI shell 25222/head
Jan Janssen [Wed, 2 Nov 2022 09:25:32 +0000 (10:25 +0100)] 
stub: Detect empty LoadOptions when run from EFI shell

The EFI shell will pass the entire command line to the application it
starts, which includes the file path of the stub binary. This prevents
us from using the built-in cmdline if the command line is otherwise
empty.

Fortunately, the EFI shell registers a protocol on any images it starts
this way. The protocol even lets us access the args individually, making
it easy to strip the stub path off.

Fixes: #25201
2 years agosystemctl: deprecate passing positional argument to reboot completely
Mike Yuan [Wed, 23 Nov 2022 18:39:15 +0000 (02:39 +0800)] 
systemctl: deprecate passing positional argument to reboot completely
(follow-up of #15958)

In #15958 we deprecated passing positional argument to reboot by
generate a warning. It's been two years now and I believe it can
be dropped completely, as per requested in #15773.

2 years agosd-netlink: append instead of prepend multipart message 25536/head
Yu Watanabe [Sat, 26 Nov 2022 00:46:40 +0000 (09:46 +0900)] 
sd-netlink: append instead of prepend multipart message

Previously, e.g., networkd enumerated network interfaces with ifindex
in a decreasing order, as sd-netlink inverses the order of the received
multipart messages.
Let's keep the order of the multipart messages. Hopefully this changes
no behavior, as our code do not depend on the order of the received
multipart messages.

Before:
===
Nov 26 09:35:10 systemd[1]: Starting Network Configuration...
Nov 26 09:35:11 systemd-networkd[36185]: wlp59s0: Saved new link: ifindex=3, iftype=ETHER(1), kind=n/a
Nov 26 09:35:12 systemd-networkd[36185]: enp0s31f6: Saved new link: ifindex=2, iftype=ETHER(1), kind=n/a
Nov 26 09:35:12 systemd-networkd[36185]: lo: Saved new link: ifindex=1, iftype=LOOPBACK(772), kind=n/a

After:
===
Nov 26 09:45:18 systemd[1]: Starting Network Configuration...
Nov 26 09:45:19 systemd-networkd[38372]: lo: Saved new link: ifindex=1, iftype=LOOPBACK(772), kind=n/a
Nov 26 09:45:19 systemd-networkd[38372]: enp0s31f6: Saved new link: ifindex=2, iftype=ETHER(1), kind=n/a
Nov 26 09:45:19 systemd-networkd[38372]: wlp59s0: Saved new link: ifindex=3, iftype=ETHER(1), kind=n/a

2 years agosd-netlink: do not link non-multipart messages
Yu Watanabe [Sat, 26 Nov 2022 00:35:53 +0000 (09:35 +0900)] 
sd-netlink: do not link non-multipart messages

Previously, if a single packet contains multiple non-multipart messages,
then the messages were linked and saved as a single entry, especially
even if the messages has different serial numbers. Though, not sure if
the kernel sends such packet. But at least for safety, let's link only
multipart messages.

2 years agosd-netlink: split out parse_message_one() from socket_read_message()
Yu Watanabe [Sat, 26 Nov 2022 00:17:14 +0000 (09:17 +0900)] 
sd-netlink: split out parse_message_one() from socket_read_message()

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

2 years agosd-netlink: do not use serials currently queued
Yu Watanabe [Sat, 26 Nov 2022 01:14:00 +0000 (10:14 +0900)] 
sd-netlink: do not use serials currently queued

2 years agosd-netlink: also manage received messages by serial
Yu Watanabe [Sat, 26 Nov 2022 02:17:36 +0000 (11:17 +0900)] 
sd-netlink: also manage received messages by serial

Then, we can easily find the received message matching with requested
serial.

2 years agosd-netlink: reimplement received message queue
Yu Watanabe [Sat, 26 Nov 2022 01:10:58 +0000 (10:10 +0900)] 
sd-netlink: reimplement received message queue

By using OrderedSet and Hashmap, we can drop all memmove() calls.
No functional changes, just refactoring.

2 years agosd-netlink: introduce netlink_queue_received_message() and friend
Yu Watanabe [Sat, 26 Nov 2022 01:06:05 +0000 (10:06 +0900)] 
sd-netlink: introduce netlink_queue_received_message() and friend

No functional change, just refactoring.

2 years agosd-netlink: fix segfault
Yu Watanabe [Sat, 26 Nov 2022 00:57:16 +0000 (09:57 +0900)] 
sd-netlink: fix segfault

2 years agosd-netlink: fix possible use-after-free
Yu Watanabe [Thu, 24 Nov 2022 18:36:39 +0000 (03:36 +0900)] 
sd-netlink: fix possible use-after-free

When we receive a multi-part message and fail to parse it, then
the prviously received message is freed with the _cleanup_ attribute,
but still referenced by sd_netlink.rqueue_partial. That causes
use-after-free when we receive another multi-part message.

2 years agosd-netlink: return earlier when received invalid message
Yu Watanabe [Thu, 24 Nov 2022 18:33:52 +0000 (03:33 +0900)] 
sd-netlink: return earlier when received invalid message

2 years agosd-netlink: allocate read buffer when necessary
Yu Watanabe [Thu, 24 Nov 2022 17:56:42 +0000 (02:56 +0900)] 
sd-netlink: allocate read buffer when necessary

2 years agosd-netlink: check received size in socket_recv_message()
Yu Watanabe [Thu, 24 Nov 2022 17:55:32 +0000 (02:55 +0900)] 
sd-netlink: check received size in socket_recv_message()

No functional change, just refactoring and slightly shorten
socket_read_message().

2 years agosd-netlink: drop redundant 'else'
Yu Watanabe [Thu, 24 Nov 2022 17:41:57 +0000 (02:41 +0900)] 
sd-netlink: drop redundant 'else'

2 years agosd-netlink: always initialize return variable on success
Yu Watanabe [Thu, 24 Nov 2022 17:34:57 +0000 (02:34 +0900)] 
sd-netlink: always initialize return variable on success

2 years agofdisk: introduce common fdisk_new_context_fd() helper
Lennart Poettering [Wed, 23 Nov 2022 15:23:35 +0000 (16:23 +0100)] 
fdisk: introduce common fdisk_new_context_fd() helper

We do the same thing over and over again and it's a bit ugly, hence
let's unify the code for it at one common place.

2 years agoMerge pull request #25533 from keszybz/meson-fixups
Yu Watanabe [Sat, 26 Nov 2022 02:27:34 +0000 (11:27 +0900)] 
Merge pull request #25533 from keszybz/meson-fixups

Meson fixups

2 years agodissect: don't pre-open swap devices, we are not going to use them
Lennart Poettering [Tue, 25 Oct 2022 15:39:00 +0000 (17:39 +0200)] 
dissect: don't pre-open swap devices, we are not going to use them

2 years agorepart: Remove bogus check
Daan De Meyer [Fri, 25 Nov 2022 14:09:53 +0000 (15:09 +0100)] 
repart: Remove bogus check

The --empty option applies to the partition table of the block
device, not the number of definition files we've read. Also, even
if we don't find any definition files, let's not shortcut execution
so we can run repart on a device/loopback file to get information
on the partition table.

2 years agologind: Properly unescape names of lingering users
Michal Koutný [Fri, 25 Nov 2022 16:25:36 +0000 (17:25 +0100)] 
logind: Properly unescape names of lingering users

Filenames to store user linger requests are created with C-escaping.
When we enumerate the files to acquire ligering users, we use the
filenames verbatim. In the case C-escaping is not an identity map (such
as "DOMAIN\User"), we won't be able to start user instances of
such mangled users.

Unescape filenames when we treat them as usernames again.

Fixes: #25448
2 years agoMerge pull request #25530 from poettering/resolved-stub-name
Yu Watanabe [Fri, 25 Nov 2022 23:26:28 +0000 (08:26 +0900)] 
Merge pull request #25530 from poettering/resolved-stub-name

resolved: make _localdnsstub and _localdnsproxy resolve to 127.0.0.{53,54}

2 years agoFix typo
jcg [Sun, 20 Nov 2022 06:59:36 +0000 (14:59 +0800)] 
Fix typo

2 years agounits: Use BindsTo=systemd-networkd in systemd-networkd-wait-online.service
Daan De Meyer [Fri, 25 Nov 2022 13:32:20 +0000 (14:32 +0100)] 
units: Use BindsTo=systemd-networkd in systemd-networkd-wait-online.service

We don't want systemd-networkd-wait-online to start if systemd-networkd
is skipped due to condition failures. This is only guaranteed by BindsTo=
and not Requires=, so let's use BindsTo=

2 years agoMerge pull request #25498 from medhefgo/stub-splash
Luca Boccassi [Fri, 25 Nov 2022 18:38:47 +0000 (19:38 +0100)] 
Merge pull request #25498 from medhefgo/stub-splash

stub: Fix splash alpha blending

2 years agopo: Translated using Weblate (Indonesian)
Andika Triwidada [Fri, 25 Nov 2022 08:19:58 +0000 (09:19 +0100)] 
po: Translated using Weblate (Indonesian)

Currently translated at 100.0% (193 of 193 strings)

Co-authored-by: Andika Triwidada <andika@gmail.com>
Translate-URL: https://translate.fedoraproject.org/projects/systemd/master/id/
Translation: systemd/main

2 years agomeson: regenerate meson rules 25533/head
Zbigniew Jędrzejewski-Szmek [Fri, 25 Nov 2022 15:26:29 +0000 (16:26 +0100)] 
meson: regenerate meson rules

Forgotten in 85bc6b05491fb4c9f40f8a0e8615ac5321efbea0.

2 years agomeson: resort imports
Zbigniew Jędrzejewski-Szmek [Wed, 16 Nov 2022 14:52:15 +0000 (15:52 +0100)] 
meson: resort imports

2 years agoresolved: introduce common macro for 127.0.0.2 IP address 25530/head
Lennart Poettering [Fri, 25 Nov 2022 13:50:59 +0000 (14:50 +0100)] 
resolved: introduce common macro for 127.0.0.2 IP address