]> git.ipfire.org Git - thirdparty/systemd.git/log
thirdparty/systemd.git
2 years agoshared/install: rework an assert to appease gcc-13 26147/head
Zbigniew Jędrzejewski-Szmek [Sun, 22 Jan 2023 17:21:13 +0000 (18:21 +0100)] 
shared/install: rework an assert to appease gcc-13

With the previous form, gcc is confused and thinks that .type might be unset.

Fixes #26118.

2 years agoshared/install: rework InstallChange to always have .path set
Zbigniew Jędrzejewski-Szmek [Sun, 22 Jan 2023 17:20:22 +0000 (18:20 +0100)] 
shared/install: rework InstallChange to always have .path set

We would set .path in all cases except INSTALL_CHANGE_AUXILIARY_FAILED, where
we would just just .source. This special case is just not worth it, because
we can't easily assert that .path is set. Let's remove this special case to
help the compiler know that .path is actually set.

Avoids a warning with gcc-13.0.1-0.1.fc38.x86_64.

2 years agosd-path: export env. generators paths
David Tardon [Fri, 20 Jan 2023 14:17:50 +0000 (15:17 +0100)] 
sd-path: export env. generators paths

2 years agoMerge pull request #26139 from yuwata/test-load-fragment-fix-memleak
Lennart Poettering [Sat, 21 Jan 2023 09:50:07 +0000 (10:50 +0100)] 
Merge pull request #26139 from yuwata/test-load-fragment-fix-memleak

test-load-fragment: fix memleak

2 years agosystemctl,test: -EBADF instead of -EBADFD
Yu Watanabe [Sat, 21 Jan 2023 06:25:30 +0000 (15:25 +0900)] 
systemctl,test: -EBADF instead of -EBADFD

Follow-up for da20baaeccbcca78350bf64bdc069dec685c95bc.

2 years agoMerge pull request #26137 from poettering/timesyncd-touch-file-tweaks
Lennart Poettering [Sat, 21 Jan 2023 09:46:54 +0000 (10:46 +0100)] 
Merge pull request #26137 from poettering/timesyncd-touch-file-tweaks

timesync: some tweaks to saved timestamp file handling

2 years agologs-show: add a splash of colour to verbose output
Lennart Poettering [Thu, 19 Jan 2023 21:43:37 +0000 (22:43 +0100)] 
logs-show: add a splash of colour to verbose output

2 years agologs-show: minor modernizations
Lennart Poettering [Thu, 19 Jan 2023 10:37:06 +0000 (11:37 +0100)] 
logs-show: minor modernizations

2 years agosd-journal: validate monotonic timestamp before returning it
Lennart Poettering [Thu, 19 Jan 2023 19:28:34 +0000 (20:28 +0100)] 
sd-journal: validate monotonic timestamp before returning it

2 years agostring-util: add common implementation of function that converts sized character...
Lennart Poettering [Fri, 20 Jan 2023 14:36:09 +0000 (15:36 +0100)] 
string-util: add common implementation of function that converts sized character buffers to NUL terminated C strings

2 years agotest-load-fragment: shorten code a bit 26139/head
Yu Watanabe [Sat, 21 Jan 2023 06:08:04 +0000 (15:08 +0900)] 
test-load-fragment: shorten code a bit

2 years agotest-load-fragment: fix memleak
Yu Watanabe [Sat, 21 Jan 2023 06:03:45 +0000 (15:03 +0900)] 
test-load-fragment: fix memleak

Fixes a leak reported at https://github.com/systemd/systemd/pull/26115#issuecomment-1398026085.

2 years agohwdb: Add touchpad toggle mapping for System76 Pangolin 12
13r0ck [Fri, 20 Jan 2023 18:32:27 +0000 (11:32 -0700)] 
hwdb: Add touchpad toggle mapping for System76 Pangolin 12

2 years agologs-show: move strlen() handling into update_json_data() so that we can use SD_ID128...
Lennart Poettering [Thu, 19 Jan 2023 19:34:36 +0000 (20:34 +0100)] 
logs-show: move strlen() handling into update_json_data() so that we can use SD_ID128_TO_STRING()

2 years agotimesyncd: make sure to update mtime of clock file on each boot 26137/head
Lennart Poettering [Thu, 19 Jan 2023 19:41:25 +0000 (20:41 +0100)] 
timesyncd: make sure to update mtime of clock file on each boot

Let's make sure the timestamp file's mtime is guaranteed to change for
each boot, so that it is a useful indicator of time. Or in other words
this gurantees that systemd-timesyncd.service acts as a new kind of
milestone: that time definitely progressed on this boot even the machine
died abnormally imediately after.

2 years agotimesyncd: modernize load_clock_timestamp() a bit
Lennart Poettering [Thu, 19 Jan 2023 19:36:49 +0000 (20:36 +0100)] 
timesyncd: modernize load_clock_timestamp() a bit

Let's log more.

2 years agotimesyncd: write structured log messages whenever we bump the clock based on disk...
Lennart Poettering [Thu, 19 Jan 2023 19:23:11 +0000 (20:23 +0100)] 
timesyncd: write structured log messages whenever we bump the clock based on disk timestamp

It's useful being able to easily detect if a disk-based clock bump was
done, let's make it a structure message, the same way as acquiring an
NTP fix already is.

Also, set the clock to 1 µs further than the timestamp from the disk,
after all we know that that timestamp was current when it was written,
hence it can't be the right one right now anymore.

2 years agoMerge pull request #26131 from poettering/bootctl-help-text-fix
Lennart Poettering [Fri, 20 Jan 2023 21:21:17 +0000 (22:21 +0100)] 
Merge pull request #26131 from poettering/bootctl-help-text-fix

bootctl --help fixes

2 years agojournal: use compound initializors at one more place
Lennart Poettering [Mon, 16 Jan 2023 13:06:23 +0000 (14:06 +0100)] 
journal: use compound initializors at one more place

2 years agojournal: modernize match_make_string()
Lennart Poettering [Thu, 19 Jan 2023 19:27:26 +0000 (20:27 +0100)] 
journal: modernize match_make_string()

2 years agojournalctl: don't convert between strv/Set for each log line
Lennart Poettering [Thu, 19 Jan 2023 10:35:36 +0000 (11:35 +0100)] 
journalctl: don't convert between strv/Set for each log line

If output fields are specified, let's store this in a Set right-away,
instead of converting between strv and Set again and again for each
line.

This is not only faster, but also simpler and shorter.

2 years agologs-show: use json_variant_unref_many() where appropriate
Lennart Poettering [Thu, 19 Jan 2023 21:44:11 +0000 (22:44 +0100)] 
logs-show: use json_variant_unref_many() where appropriate

2 years agoMerge pull request #26126 from poettering/format-table-date
Lennart Poettering [Fri, 20 Jan 2023 20:45:28 +0000 (21:45 +0100)] 
Merge pull request #26126 from poettering/format-table-date

hostnamectl: show firmware date as date only, with now time

2 years agobootctl: remove space that should not be there 26131/head
Lennart Poettering [Fri, 20 Jan 2023 17:40:57 +0000 (18:40 +0100)] 
bootctl: remove space that should not be there

2 years agobootctl: split out boot loader spec + boot loader interface commands in --help text
Lennart Poettering [Fri, 20 Jan 2023 17:36:31 +0000 (18:36 +0100)] 
bootctl: split out boot loader spec + boot loader interface commands in --help text

grub (at least on fedora) nowadays implements the boot loader spec, but
not the boot loader interface. Hence let's split out the commands
specific to each in two groups in the --help text. This way the first
group just covers boot lodaer spec stuff (i.e. stuff on disk in the
ESP/XBOOTLDR partition). And the other covers talking to the boot loader
via EFI var.

2 years agobootctl: realign column in --help text
Lennart Poettering [Fri, 20 Jan 2023 17:30:47 +0000 (18:30 +0100)] 
bootctl: realign column in --help text

for some reason the descriptions of the switches and the commands
weren't aligned, one space off. Fix that.

2 years agobootctl: change section title for kernel image commands
Lennart Poettering [Fri, 20 Jan 2023 17:30:06 +0000 (18:30 +0100)] 
bootctl: change section title for kernel image commands

Let's call them kernel *images*, not just *kernels*.

2 years agobootctl: drop full stop at end of --help texts
Lennart Poettering [Fri, 20 Jan 2023 17:29:13 +0000 (18:29 +0100)] 
bootctl: drop full stop at end of --help texts

We never do that, don't do so here either.

2 years agohostnamectl: show firmware date with date only, without time 26126/head
Lennart Poettering [Fri, 20 Jan 2023 15:52:39 +0000 (16:52 +0100)] 
hostnamectl: show firmware date with date only, without time

The source (usually DMI/SMBIOS) only has 24h granularity, hence don't
show time as well, it's useless.

2 years agoformat-table: add cell type for showing date only timestamps
Lennart Poettering [Fri, 20 Jan 2023 12:47:48 +0000 (13:47 +0100)] 
format-table: add cell type for showing date only timestamps

2 years agotime-util: add timestamp output style that shows dates only, no times
Lennart Poettering [Fri, 20 Jan 2023 12:47:11 +0000 (13:47 +0100)] 
time-util: add timestamp output style that shows dates only, no times

2 years agotime-util: condition size check based on utc mode
Lennart Poettering [Fri, 20 Jan 2023 15:54:22 +0000 (16:54 +0100)] 
time-util: condition size check based on utc mode

2 years agotime-util: simplify formatting of UNIX timestamps
Lennart Poettering [Fri, 20 Jan 2023 12:46:40 +0000 (13:46 +0100)] 
time-util: simplify formatting of UNIX timestamps

2 years agotime-util: move buffer size check after handling of UNIX timestamp style
Lennart Poettering [Fri, 20 Jan 2023 12:45:38 +0000 (13:45 +0100)] 
time-util: move buffer size check after handling of UNIX timestamp style

2 years agotime-util: if a date is unrepresentable, honour style to generate XXX string
Lennart Poettering [Fri, 20 Jan 2023 12:44:26 +0000 (13:44 +0100)] 
time-util: if a date is unrepresentable, honour style to generate XXX string

2 years agotime-util: use IN_SET() more
Lennart Poettering [Fri, 20 Jan 2023 12:16:19 +0000 (13:16 +0100)] 
time-util: use IN_SET() more

2 years agoboot: Properly strip EFI binaries
Jan Janssen [Fri, 20 Jan 2023 13:11:54 +0000 (14:11 +0100)] 
boot: Properly strip EFI binaries

Removing debugging related sections is apparently not enough to truely
strip a (PE) binary.
Better late than never. It gets rid of this pesky warning from sbsign:
    warning: data remaining[174080 vs 193173]: gaps between PE/COFF sections?

2 years agoMerge pull request #26114 from bluca/sd_login_pidfd
Lennart Poettering [Fri, 20 Jan 2023 16:28:13 +0000 (17:28 +0100)] 
Merge pull request #26114 from bluca/sd_login_pidfd

sd-login: add sd_pidfd_* APIs

2 years agostring-util: add new strdupcspn()/strdupspn()
Lennart Poettering [Fri, 20 Jan 2023 12:14:42 +0000 (13:14 +0100)] 
string-util: add new strdupcspn()/strdupspn()

These combine strndup() + strspn()/strcspn() into one.

There are a bunch of strndupa() calls that could use similar treatment
(or should be converted to strdup[c]spn(), but this commit doesn't
bother with that.

2 years agoMerge pull request #23309 from DaanDeMeyer/log-context
Luca Boccassi [Fri, 20 Jan 2023 15:01:03 +0000 (15:01 +0000)] 
Merge pull request #23309 from DaanDeMeyer/log-context

basic: Add log context

2 years agobootctl: add kernel-inspect to --help text
Gerd Hoffmann [Fri, 20 Jan 2023 12:30:48 +0000 (13:30 +0100)] 
bootctl: add kernel-inspect to --help text

2 years agohwdb: Add Chuwi Hi10X (N4120 version) iio matrix
Waltibaba [Fri, 20 Jan 2023 07:38:13 +0000 (08:38 +0100)] 
hwdb: Add Chuwi Hi10X (N4120 version) iio matrix

There is a later model version of the Chuwi Hi10X that has significantly changed components compared to the existing hwdb one. Differentiator (on Chuwi forums, in thesofproject, etc.) is the N4120 rather than the N4100 processor.
The svn and pn seem to be identical, my Chuwi Hi10X matches with the old model except for the changed KIOX000A* iio sensor.
With the added ACCEL_MOUNT_MATRIX, my device works on gnome and has the correct (right-up) output in monitor-sensors.

2 years agoukify: Downgrade required python version to 3.9
Daan De Meyer [Thu, 19 Jan 2023 12:14:29 +0000 (13:14 +0100)] 
ukify: Downgrade required python version to 3.9

2 years agosd-login: add sd_pidfd_* APIs 26114/head
Luca Boccassi [Thu, 19 Jan 2023 23:20:55 +0000 (23:20 +0000)] 
sd-login: add sd_pidfd_* APIs

Same as the sd_pid_* counterparts, but take a pid file descriptor instead of
a pid, so that the callers can be sure that the returned values are really
about the process they asked for, and not about a recycled PID.

2 years agoprocess-util: add helper to verify a pid via its pidfd
Luca Boccassi [Fri, 20 Jan 2023 12:13:22 +0000 (12:13 +0000)] 
process-util: add helper to verify a pid via its pidfd

2 years agoMerge pull request #26115 from yuwata/test-fix-memleak-fdleak
Luca Boccassi [Fri, 20 Jan 2023 11:00:53 +0000 (11:00 +0000)] 
Merge pull request #26115 from yuwata/test-fix-memleak-fdleak

test: fix memleak and fd leak

2 years agotree-wide: fix typo
Yu Watanabe [Fri, 20 Jan 2023 06:32:16 +0000 (15:32 +0900)] 
tree-wide: fix typo

2 years agotest-unit-name: fix fd leak 26115/head
Yu Watanabe [Fri, 20 Jan 2023 05:54:44 +0000 (14:54 +0900)] 
test-unit-name: fix fd leak

Fixes an issue reported at https://github.com/systemd/systemd/issues/22576#issuecomment-1396774385.

2 years agotest-ndisc: fix memleak and fd leak
Yu Watanabe [Fri, 20 Jan 2023 05:37:12 +0000 (14:37 +0900)] 
test-ndisc: fix memleak and fd leak

Fixes issues reported at #22576.

2 years agoMerge pull request #26105 from yuwata/network-config-parse-address-make-prefix-length...
Luca Boccassi [Thu, 19 Jan 2023 21:06:08 +0000 (21:06 +0000)] 
Merge pull request #26105 from yuwata/network-config-parse-address-make-prefix-length-full

network: make config_parse_address() assume full prefix length

2 years agocore: mount namespaces: Remove auxiliary bind mounts directory after unit termination
Michal Koutný [Wed, 18 Jan 2023 22:20:31 +0000 (23:20 +0100)] 
core: mount namespaces: Remove auxiliary bind mounts directory after unit termination

Unit that requires its own mount namespace creates a temporary directory
to implement dynamic bind mounts (org.freedesktop.systemd1.Manager.BindMountUnit).
However, this directory is never removed and they will accumulate for
each unique unit (e.g. templated units of systemd-coredump@).

Attach the auxiliary runtime directory existence to lifetime of other
"runtime" only per-unit directories.

2 years agoMerge pull request #25977 from YHNdnzj/PropagatesStopTo-fix-restart
Lennart Poettering [Thu, 19 Jan 2023 20:57:39 +0000 (21:57 +0100)] 
Merge pull request #25977 from YHNdnzj/PropagatesStopTo-fix-restart

core: propagate stop too if restart is issued

2 years agohostnamed: expose FirmwareDate as timestamp in dbus
Jelle van der Waa [Fri, 13 Jan 2023 16:33:12 +0000 (17:33 +0100)] 
hostnamed: expose FirmwareDate as timestamp in dbus

Offer the firmware date as an epoch instead of the literal DMI string.

Closes #25679

2 years agoMerge pull request #26103 from lnussel/bootctl
Luca Boccassi [Thu, 19 Jan 2023 20:21:52 +0000 (20:21 +0000)] 
Merge pull request #26103 from lnussel/bootctl

bootctl: unlink and cleanup functions

2 years agomkosi: Rename the configuration files to use ".conf" as extension
Daan De Meyer [Thu, 19 Jan 2023 13:24:40 +0000 (14:24 +0100)] 
mkosi: Rename the configuration files to use ".conf" as extension

2 years agoFix typo in parameter name
edupont [Thu, 19 Jan 2023 13:24:56 +0000 (14:24 +0100)] 
Fix typo in parameter name

2 years agocore: propagate stop too if restart is issued 25977/head
Mike Yuan [Sun, 8 Jan 2023 15:16:22 +0000 (23:16 +0800)] 
core: propagate stop too if restart is issued

The restart of a unit should also be considered as that
a stop job happens, and thus gets propagated to units
specified using PropagatesStopTo=.

Fixes #24068

2 years agobootctl: unlink and cleanup functions 26103/head
Ludwig Nussel [Thu, 8 Dec 2022 15:27:31 +0000 (16:27 +0100)] 
bootctl: unlink and cleanup functions

The unlink command removes an entry from the ESP including
referenced files that are not referenced in other entries. That is
useful eg to have multiple entries that use the same kernel with
different options.

The cleanup command removes all files that are not referenced by any
entry.

2 years agobpf: disable -fstack-protector in meson
Sam James [Fri, 13 Jan 2023 05:17:56 +0000 (05:17 +0000)] 
bpf: disable -fstack-protector in meson

In Gentoo, we recently started making Clang behave the same way as
our GCC, with -fstack-protector and some friends enabled by default.

SSP doesn't make sense for BPF, so disable it explicitly.

See also e.g. https://www.spinics.net/lists/netdev/msg556400.html.

Bug: https://bugs.gentoo.org/890004

2 years agochase-symlinks: new chase_symlinks_and_unlink()
Ludwig Nussel [Mon, 9 Jan 2023 16:58:57 +0000 (17:58 +0100)] 
chase-symlinks: new chase_symlinks_and_unlink()

2 years agoNEWS: mention that Address= assumes /32 or /128 prefix length if not specified 26105/head
Yu Watanabe [Thu, 19 Jan 2023 12:27:24 +0000 (21:27 +0900)] 
NEWS: mention that Address= assumes /32 or /128 prefix length if not specified

2 years agoin-addr-util: drop unused mode to parse prefix length
Yu Watanabe [Thu, 19 Jan 2023 12:20:24 +0000 (21:20 +0900)] 
in-addr-util: drop unused mode to parse prefix length

2 years agonetwork: assume prefix length is full address size
Yu Watanabe [Thu, 19 Jan 2023 09:21:34 +0000 (18:21 +0900)] 
network: assume prefix length is full address size

The commit 0f707207b9fc04d45ad176930cfefc77c0068545 enables strong
warning about missing prefix length in Address= setting.
The change was done in v241, and was about 4 years ago.
Let's drop the legacy assumption and make the parser consistent with
'ip address' command.

C.f. #11307.
Closes #26102.

2 years agotest: update Ubuntu CI docs
Frantisek Sumsal [Thu, 19 Jan 2023 12:54:19 +0000 (13:54 +0100)] 
test: update Ubuntu CI docs

2 years agonetwork: do not enter failed state when received an invalid RA
Yu Watanabe [Tue, 17 Jan 2023 04:20:13 +0000 (13:20 +0900)] 
network: do not enter failed state when received an invalid RA

Fixes the issue reported at https://github.com/systemd/systemd/issues/25891#issuecomment-1368509262.

2 years agotest-network: drop unused file
Yu Watanabe [Thu, 19 Jan 2023 12:21:52 +0000 (21:21 +0900)] 
test-network: drop unused file

2 years agomeson: ukify depends on GNU_EFI
Ludwig Nussel [Wed, 18 Jan 2023 09:25:58 +0000 (10:25 +0100)] 
meson: ukify depends on GNU_EFI

ukify is rather efi specific and the manpage is already conditional on
HAVE_GNU_EFI so make the program also depend on HAVE_GNU_EFI

2 years agotestsuite-77: Fix race condition
Daan De Meyer [Wed, 18 Jan 2023 15:31:35 +0000 (16:31 +0100)] 
testsuite-77: Fix race condition

Use a socket unit to make sure the socket exists before we start
the client that accesses it.

2 years agoMerge pull request #23706 from medhefgo/efi-clang
Luca Boccassi [Wed, 18 Jan 2023 22:24:39 +0000 (22:24 +0000)] 
Merge pull request #23706 from medhefgo/efi-clang

boot: Add printf functions

2 years agotpm2: add salt to pin
William Roberts [Wed, 18 Jan 2023 14:45:53 +0000 (08:45 -0600)] 
tpm2: add salt to pin

Add a salt to the pin and store it in the TPM2 LUKS header for future
this. This adds entropy to user supplied pins and helps brute forcing
the passphrase on the key residing in the TPM or brute forcing bind key
encrypted sessions with low entropy passphrases.

Signed-off-by: malikabhi05 <abhishek.malik@intel.com>
Signed-off-by: William Roberts <william.c.roberts@intel.com>
2 years agoman: note that cgroup-based sandboxing is not bypassed by '+'
Luca Boccassi [Sun, 15 Jan 2023 18:54:16 +0000 (18:54 +0000)] 
man: note that cgroup-based sandboxing is not bypassed by '+'

DeviceAllow= and others are applied to the whole cgroup via bpf, so
using '+' on an Exec line will not bypass them. Explain this in the
manpage.

Fixes https://github.com/systemd/systemd/issues/26035

2 years agoMerge pull request #25790 from joshua-zivkovic/JZ/plotjson-main
Lennart Poettering [Wed, 18 Jan 2023 17:11:12 +0000 (18:11 +0100)] 
Merge pull request #25790 from joshua-zivkovic/JZ/plotjson-main

systemd-analyze: Add JSON and table output to systemd-analyze's plot

2 years agoMerge pull request #26082 from kraxel/uki
Lennart Poettering [Wed, 18 Jan 2023 17:10:30 +0000 (18:10 +0100)] 
Merge pull request #26082 from kraxel/uki

bootctl: add is-uki command

2 years agoboot: Drop use of Print 23706/head
Jan Janssen [Tue, 23 Aug 2022 08:51:36 +0000 (10:51 +0200)] 
boot: Drop use of Print

The custom print helpers have been replaced with explicit checks at the
call site to keep this in line with the way it is done in userspace. Any
calls where the check has been ommited should not need them as the value
is expected to alawys be around.

2 years agoboot: Drop use of xpool_print/SPrint
Jan Janssen [Sun, 5 Jun 2022 13:08:07 +0000 (15:08 +0200)] 
boot: Drop use of xpool_print/SPrint

2 years agotree-wide: Use __func__ in asserts
Jan Janssen [Thu, 18 Aug 2022 11:43:19 +0000 (13:43 +0200)] 
tree-wide: Use __func__ in asserts

clang puts the whole function signature in __PRETTY_FUNCTION__, which is
a bit excessive for something that can already be figured out by using
the line number.

2 years agoboot: Add log_trace debugging helper
Jan Janssen [Thu, 18 Aug 2022 11:41:49 +0000 (13:41 +0200)] 
boot: Add log_trace debugging helper

2 years agoboot: Introduce log_wait
Jan Janssen [Sun, 5 Jun 2022 11:19:21 +0000 (13:19 +0200)] 
boot: Introduce log_wait

Instead of stalling for every log message as it appears we now wait for
several messages at strategic locations.

2 years agoboot: Use printf for error logging
Jan Janssen [Fri, 10 Jun 2022 17:06:57 +0000 (19:06 +0200)] 
boot: Use printf for error logging

This also drops the _stall suffix in anticipation of the next commit.

2 years agoboot: Add printf functions
Jan Janssen [Fri, 10 Jun 2022 16:55:24 +0000 (18:55 +0200)] 
boot: Add printf functions

2 years agosystemd-analyze: Add --json=, --table and -no-legend tests for plot 25790/head
joshuazivkovic [Fri, 13 Jan 2023 09:17:27 +0000 (09:17 +0000)] 
systemd-analyze: Add --json=, --table and -no-legend tests for plot

2 years agosystemd-analyze: Add tab complete logic for plot
joshuazivkovic [Wed, 14 Dec 2022 12:31:59 +0000 (12:31 +0000)] 
systemd-analyze: Add tab complete logic for plot

2 years agosystemd-analyze: Update man/systemd-analyze.xml with Plot JSON and table
joshuazivkovic [Wed, 14 Dec 2022 12:31:22 +0000 (12:31 +0000)] 
systemd-analyze: Update man/systemd-analyze.xml with Plot JSON and table

2 years agosystemd-analyze: Add table and JSON output implementation to plot
Joshua Zivkovic [Wed, 2 Nov 2022 08:55:50 +0000 (08:55 +0000)] 
systemd-analyze: Add table and JSON output implementation to plot

2 years agotest-network: reprocess the loopback network interface
Yu Watanabe [Wed, 18 Jan 2023 09:53:42 +0000 (18:53 +0900)] 
test-network: reprocess the loopback network interface

Fixes the issue reported at https://github.com/systemd/systemd-centos-ci/pull/585#issuecomment-1385537641.

2 years agoMerge pull request #26021 from fbuihuu/some-journald-improvements
Lennart Poettering [Wed, 18 Jan 2023 14:05:40 +0000 (15:05 +0100)] 
Merge pull request #26021 from fbuihuu/some-journald-improvements

Some journald improvements

2 years agobootctl: add kernel-inspect command 26082/head
Gerd Hoffmann [Tue, 17 Jan 2023 21:06:06 +0000 (22:06 +0100)] 
bootctl: add kernel-inspect command

Takes a kernel image as argument. Prints details about the kernel.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2 years agobootctl: add kernel-identity command
Gerd Hoffmann [Mon, 16 Jan 2023 17:58:21 +0000 (18:58 +0100)] 
bootctl: add kernel-identity command

The command takes a kernel as argument and checks what kind of kernel
the image is.  Returns one of uki, pe or unknown.

2 years agoMerge pull request #26092 from poettering/dissect-sector-size
Lennart Poettering [Wed, 18 Jan 2023 13:14:39 +0000 (14:14 +0100)] 
Merge pull request #26092 from poettering/dissect-sector-size

auto-detect intended sector size from DDI disk images, and configure loopback devices for it

2 years agocore: add GetUnitByPIDFD method and use it in systemctl
Luca Boccassi [Mon, 16 Jan 2023 23:46:01 +0000 (23:46 +0000)] 
core: add GetUnitByPIDFD method and use it in systemctl

A pid can be recycled, but a pidfd is pinned. Add a new method that is safer
as it takes a pidfd as input.
Return not only the D-Bus object path, but also the unit id and the last
recorded invocation id, as they are both useful (especially the id, as
converting from a path object to a unit id from a script requires another
round-trip via D-Bus).

Note that the manager still tracks processes by pid, so theorethically this
is not fully error-proof, but on the other hand the method response is
synchronous and the manager is single-threaded, so once a call is being
processed the unit database will not change anyway. Once the manager
switches to use pidfds everywhere, this can be further hardened.

2 years agohwdb: Add mic mute key mappings for Dell G16 Series
Koba Ko [Wed, 18 Jan 2023 03:22:50 +0000 (11:22 +0800)] 
hwdb: Add mic mute key mappings for Dell G16 Series

add Dell G16 series to use the mic mute hotkey.

2 years agorepart: auto-probe sector size when not specified 26092/head
Lennart Poettering [Tue, 17 Jan 2023 20:42:21 +0000 (21:42 +0100)] 
repart: auto-probe sector size when not specified

2 years agohomework: when creating/resizing GPT partitions, also set sector size explicitly
Lennart Poettering [Tue, 17 Jan 2023 20:42:02 +0000 (21:42 +0100)] 
homework: when creating/resizing GPT partitions, also set sector size explicitly

2 years agodissect: show sector size in info output
Lennart Poettering [Tue, 17 Jan 2023 17:52:09 +0000 (18:52 +0100)] 
dissect: show sector size in info output

2 years agoloop-util: always tell kernel explicitly about loopback sector size
Lennart Poettering [Tue, 17 Jan 2023 17:50:59 +0000 (18:50 +0100)] 
loop-util: always tell kernel explicitly about loopback sector size

Let's not leave the sector size unspecified: either set a user supplied
value, or auto-detect the right size by probing the disk image
accordingly.

2 years agodissect-image: add probe_sector_size() helper for detecting sector size of a GPT...
Lennart Poettering [Tue, 17 Jan 2023 17:06:05 +0000 (18:06 +0100)] 
dissect-image: add probe_sector_size() helper for detecting sector size of a GPT disk image

When we operate with DDIs with sector sizes != 512 we need to configure
the loopback device to match it, otherwise the image and the kernel
block device will disagree what things are.

Let's add a prober that tries to determine the sector size of a GPT DDI.
It does this by looking for the GPT partition table header at the
various byte offsets they must be located on, given a specific sector
size. It will try sector size 512, 1024, 2048 and 4096. Of these only
the 512 and 4096 really make sense IRL I guess, but let's be thorough.

2 years agoloop-util: insist on setting the sector size correctly
Lennart Poettering [Tue, 17 Jan 2023 14:49:31 +0000 (15:49 +0100)] 
loop-util: insist on setting the sector size correctly

If we attach a disk image to a loopback device the sector size of the
image must match the one of the loopback device, hence be more careful
here.

2 years agoblockdev-util: add simple wrapper around BLKSSZGET
Lennart Poettering [Tue, 17 Jan 2023 19:12:30 +0000 (20:12 +0100)] 
blockdev-util: add simple wrapper around BLKSSZGET

Just adds some typesafety and generates an error if the field is not
initialized in the block device yet.

2 years agoMerge pull request #26044 from DaanDeMeyer/repart-sector-size
Daan De Meyer [Wed, 18 Jan 2023 08:54:50 +0000 (09:54 +0100)] 
Merge pull request #26044 from DaanDeMeyer/repart-sector-size

repart: Allow configuring sector size

2 years agotest: bump D-Bus service start timeout if we run without accel
Frantisek Sumsal [Tue, 17 Jan 2023 17:04:30 +0000 (18:04 +0100)] 
test: bump D-Bus service start timeout if we run without accel

The default (25s) doesn't seem to be enough in some cases (especially
in VMs without acceleration), causing spurious timeouts:

[  174.297658] dbus-daemon[647]: [system] Activating via systemd: service name='org.freedesktop.hostname1' unit='dbus-org.freedesktop.hostname1.service' requested by ':1.0' (uid=0 pid=645 comm="hostnamectl " label="kernel")
[  184.202313] systemd[1]: systemd-update-utmp-runlevel.service: Consumed 1.253s CPU time.
[  197.335422] systemd[1]: Started dbus.service.
[  199.211468] testsuite-71.sh[639]: + assert_in 'Static hostname: H' ''
[  199.347192] dbus-daemon[647]: [system] Failed to activate service 'org.freedesktop.hostname1': timed out (service_start_timeout=25000ms)
[  199.394879] testsuite-71.sh[657]: + set +ex
[  199.438918] testsuite-71.sh[657]: FAIL: 'Static hostname: H' not found in:
[  200.966006] systemd-logind[631]: Watching system buttons on /dev/input/event0 (Power Button)
[  201.008178] systemd-logind[631]: Watching system buttons on /dev/input/event1 (AT Translated Set 2 keyboard)
[  201.034106] systemd-logind[631]: New seat seat0.
[  201.238267] sh[658]: + systemctl poweroff --no-block
[  201.329890] systemd[1]: Starting systemd-hostnamed.service...
[  202.156622] systemd[1]: systemd-update-utmp-runlevel.service: Deactivated successfully.
[  204.818913] hostnamectl[645]: Failed to query system properties: Connection timed out
[  205.195583] systemd[1]: testsuite-71.service: Main process exited, code=exited, status=1/FAILURE
[  205.227237] systemd[1]: testsuite-71.service: Failed with result 'exit-code'.
[  205.712780] systemd[1]: Failed to start testsuite-71.service.