]> git.ipfire.org Git - thirdparty/systemd.git/log
thirdparty/systemd.git
2 years agoMerge pull request #24420 from keszybz/mouse-power
Lennart Poettering [Wed, 24 Aug 2022 08:16:14 +0000 (10:16 +0200)] 
Merge pull request #24420 from keszybz/mouse-power

Rework on_ac_power()

2 years agoMerge pull request #24071 from bluca/path_trigger_report
Lennart Poettering [Wed, 24 Aug 2022 07:35:59 +0000 (09:35 +0200)] 
Merge pull request #24071 from bluca/path_trigger_report

path/timer units: export env vars and D-Bus properties with reason that triggered the job

2 years agovirt: Support detection of Apple Virtualization.framework guests
Zhaofeng Li [Mon, 22 Aug 2022 16:35:21 +0000 (10:35 -0600)] 
virt: Support detection of Apple Virtualization.framework guests

2 years agocheck-os-release.py compatible with Python < 3.8
David Jaša [Tue, 23 Aug 2022 21:58:09 +0000 (23:58 +0200)] 
check-os-release.py compatible with Python < 3.8

The ":=" operator was only added in Python 3.8 so splitting the line with it into two makes check-os-release.py actually fulfill its claim of working with any python version.

2 years agoservice: set TRIGGER_UNIT= and TRIGGER_TIMER_REALTIME_USEC/MONOTONIC_USEC on activati... 24071/head
Luca Boccassi [Tue, 2 Aug 2022 19:15:12 +0000 (20:15 +0100)] 
service: set TRIGGER_UNIT= and TRIGGER_TIMER_REALTIME_USEC/MONOTONIC_USEC on activation by timer unit

Same as path unit, best effort.

2 years agoservice: set TRIGGER_UNIT= and TRIGGER_PATH= on activation by path unit
Luca Boccassi [Tue, 2 Aug 2022 19:07:35 +0000 (20:07 +0100)] 
service: set TRIGGER_UNIT= and TRIGGER_PATH= on activation by path unit

When a service is triggered by a path unit, pass the
path unit name and the path that triggered it via env vars
to the spawned processes.
Note that this is best-effort, as there might be many triggers
at the same time, but we only get woken up by one.

2 years agocore: add basic infrastructure to record unit activation information
Luca Boccassi [Tue, 2 Aug 2022 18:49:20 +0000 (19:49 +0100)] 
core: add basic infrastructure to record unit activation information

Not wired in by any unit type yet, just the basic to allocate,
ref, deref and plug in to other unit types.
Includes recording the trigger unit name and passing it to the
triggered unit as TRIGGER_UNIT= env var.

2 years agoglob: add glob_first(), returns first match
Luca Boccassi [Wed, 3 Aug 2022 13:20:41 +0000 (14:20 +0100)] 
glob: add glob_first(), returns first match

Note that which match is returned depends on the system and is
not guaranteed to be stable

2 years agotest-63: convert to full shell script and generalize
Luca Boccassi [Wed, 3 Aug 2022 15:50:39 +0000 (16:50 +0100)] 
test-63: convert to full shell script and generalize

Will add more path unit tests later

2 years agosleep: support acpi_btp and suspend system if enabled, skipping custom timer
Sonali Srivastava [Sat, 23 Jul 2022 12:00:42 +0000 (17:30 +0530)] 
sleep: support acpi_btp and suspend system if enabled, skipping custom timer

2 years agojournal: Add new _INITRD field
Daan De Meyer [Tue, 17 May 2022 12:57:54 +0000 (14:57 +0200)] 
journal: Add new _INITRD field

The _INITRD field is a boolean field (0 or 1) that specifies whether
a message was processed by systemd-journald in the initrd or not.

2 years agoMerge pull request #24254 from medhefgo/mold
Luca Boccassi [Tue, 23 Aug 2022 18:33:47 +0000 (19:33 +0100)] 
Merge pull request #24254 from medhefgo/mold

ci: Add mold to build tests

2 years agoMerge pull request #24396 from poettering/no-more-dirname
Luca Boccassi [Tue, 23 Aug 2022 18:32:52 +0000 (19:32 +0100)] 
Merge pull request #24396 from poettering/no-more-dirname

stop using dirname()/dirname_malloc()

2 years agomeasure: fix minor memory leak
Lennart Poettering [Tue, 23 Aug 2022 08:09:21 +0000 (10:09 +0200)] 
measure: fix minor memory leak

When using --current switch, copy in current hash, don't just reassign
buffers forgetting about the old.

While we are at it, allocate the local copy buffer later, in
measure_pcr() as we won#t need it in the --current case.

2 years agotest: wait for the lodev to get properly initialized
Frantisek Sumsal [Tue, 23 Aug 2022 12:44:01 +0000 (14:44 +0200)] 
test: wait for the lodev to get properly initialized

Otherwise we might start writing to one of its partition before the
respective node is created under /dev, resulting in... interesting
stuff.

Resolves: #24390

2 years agoon-ac-power: ignore devices with scope==Device 24420/head
Zbigniew Jędrzejewski-Szmek [Tue, 23 Aug 2022 14:48:26 +0000 (16:48 +0200)] 
on-ac-power: ignore devices with scope==Device

My mouse is reported as:

P: /devices/pci0000:00/0000:00:14.0/usb1/1-4/1-4.4/1-4.4:1.2/0003:046D:C52B.001E/0003:046D:4051.001F/power_supply/hidpp_battery_4
M: hidpp_battery_4
R: 4
U: power_supply
E: DEVPATH=/devices/pci0000:00/0000:00:14.0/usb1/1-4/1-4.4/1-4.4:1.2/0003:046D:C52B.001E/0003:046D:4051.001F/power_supply/hidpp_battery_4
E: SUBSYSTEM=power_supply
E: POWER_SUPPLY_NAME=hidpp_battery_4
E: POWER_SUPPLY_TYPE=Battery
E: POWER_SUPPLY_ONLINE=1
E: POWER_SUPPLY_STATUS=Discharging
E: POWER_SUPPLY_SCOPE=Device
E: POWER_SUPPLY_MODEL_NAME=Wireless Mouse M510
E: POWER_SUPPLY_MANUFACTURER=Logitech
E: POWER_SUPPLY_SERIAL_NUMBER=4051-bc-cd-d2-5b
E: POWER_SUPPLY_CAPACITY_LEVEL=Normal

See https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=25a0bc2dfc2ea732f40af2dae52426ead66ae76e
Effectively, "System" and "Unkown" are passed through, "Device" is rejected.

2 years agoon-ac-power: rework logic
Zbigniew Jędrzejewski-Szmek [Tue, 23 Aug 2022 14:30:05 +0000 (16:30 +0200)] 
on-ac-power: rework logic

History of the function:
96788d2aa4f4b0b49874b4a240ce47d9e8485d1b assume system is running on AC power when no battery found
795e86b4f1e8a1fd440f8c817621779c6aedbdb5 ignore USB-C ports in power source mode when detecting system is running on AC power
c19a51bec40ae5e5073464e72411e7920d05d683 invert ac_power() source type check
6d89003462484c8656b698e07b9cf0a337e3818e assume ac when /sys/class/power_supply is missing
240dbaa44f8e5ad51775c776fc3ce9cd2f19f037 add ConditionACPower=

Interestingly, the return condition 'on_ac_power == found_online || !found_offline'
was there from the very beginning, and even Yu's latest change doesn't change this,
but only extends it to 'on_ac_power == found_online || !found_offline || !found_battery'.
This means that any system with no AC power supply will be unconditionally classified
as on_ac_power.

Let's change the logic: if we have an online AC supply, answer is "yes". If no
supplies, but we have a battery, answer is "no". Otherwise, assume "yes", based
on the assumption that presense of a battery would at least be always reported,
even if an AC power supply might not be.

Fixes #24407. It also shouldn't impact previous fixes: assume ac when
/sys/class/power_supply is missing, ignore USB-C ports in power source mode,
assume system is running on AC power when no battery found.

2 years agosd-device: add helper to read a unsigned int attribute
Zbigniew Jędrzejewski-Szmek [Tue, 23 Aug 2022 14:24:02 +0000 (16:24 +0200)] 
sd-device: add helper to read a unsigned int attribute

There are dozens of places where this could be used, but I don't
want to do the conversion now because it's quite a bit of work.
I think we could export this function later on, because reading
numerical attributes is so common. But for now, I'm just adding the
helper to use it one place.

2 years agoshared/udev-util: say "ignoring device", not "ignoring"
Zbigniew Jędrzejewski-Szmek [Tue, 23 Aug 2022 12:18:41 +0000 (14:18 +0200)] 
shared/udev-util: say "ignoring device", not "ignoring"

The short form sounds like we're ignoring the error.

2 years agomkosi: Ensure we build all features/components in mkosi
Daan De Meyer [Mon, 22 Aug 2022 11:21:07 +0000 (13:21 +0200)] 
mkosi: Ensure we build all features/components in mkosi

Explicitly enable all features/components in the mkosi build to
ensure they all get built and we get an error if they can't be built.

We also rework the packages sections of all mkosi configs to reduce
duplication and cover all the dependencies necessary to build/use all
systemd features.

Note that for the final image, since systemd is installed by default
in base images, we rely on that to install the base library dependencies
and we only list extra optional dependencies and tools that aren't already
installed by default into the base image.

We also drop the centos stream 8 mkosi build as dependencies on that
distro are too out-of-date to be able to build all systemd features.
Since centos stream 9 has been out for a while, let's focus on that
and leave it to downstream to keep systemd building on centos stream 8.

Finally, there's a few additions to the mkosi scripts to make sure
services don't start by default on boot.

2 years agoupdate TODO 24396/head
Lennart Poettering [Mon, 22 Aug 2022 11:35:48 +0000 (13:35 +0200)] 
update TODO

2 years agolgtm: dirname() is now icky
Lennart Poettering [Mon, 22 Aug 2022 12:58:13 +0000 (14:58 +0200)] 
lgtm: dirname() is now icky

2 years agomkdir: don't allow us to get confused by symlinks in mkdir_p_root()'s chowning logic
Lennart Poettering [Mon, 22 Aug 2022 12:49:17 +0000 (14:49 +0200)] 
mkdir: don't allow us to get confused by symlinks in mkdir_p_root()'s chowning logic

2 years agobless-boot: remove a bunch of 'else'
Lennart Poettering [Mon, 22 Aug 2022 11:37:15 +0000 (13:37 +0200)] 
bless-boot: remove a bunch of 'else'

2 years agodocs: suggests people use path_extract_filename() + path_extract_directory()
Lennart Poettering [Mon, 22 Aug 2022 11:36:30 +0000 (13:36 +0200)] 
docs: suggests people use path_extract_filename() + path_extract_directory()

2 years agopath-util: drop the now unused dirname_malloc()
Lennart Poettering [Mon, 22 Aug 2022 10:39:46 +0000 (12:39 +0200)] 
path-util: drop the now unused dirname_malloc()

2 years agotree-wide: port things dirname_malloc() → path_extract_directory()
Lennart Poettering [Mon, 22 Aug 2022 10:34:34 +0000 (12:34 +0200)] 
tree-wide: port things dirname_malloc() → path_extract_directory()

2 years agoMerge pull request #24412 from keszybz/man-similarly
Luca Boccassi [Tue, 23 Aug 2022 12:17:13 +0000 (13:17 +0100)] 
Merge pull request #24412 from keszybz/man-similarly

man: grammar cleanups

2 years agoMerge pull request #23893 from yuwata/core-mount-re-read-mountinfo
Luca Boccassi [Tue, 23 Aug 2022 11:46:39 +0000 (12:46 +0100)] 
Merge pull request #23893 from yuwata/core-mount-re-read-mountinfo

core/mount: adjust deserialized state based on if the corresponding mountinfo entry exists or not

2 years agoman/crypttab: rework formatting in "key acquisition section" 24412/head
Zbigniew Jędrzejewski-Szmek [Tue, 23 Aug 2022 10:14:23 +0000 (12:14 +0200)] 
man/crypttab: rework formatting in "key acquisition section"

<example> without <title> was rendered as "Example 1.", which did not
look good. While at it, the text is rewored to be, I hope, a bit easier to
read.

2 years agotest: install /etc/default/knot if available as well
Frantisek Sumsal [Mon, 22 Aug 2022 20:04:51 +0000 (22:04 +0200)] 
test: install /etc/default/knot if available as well

The knot.service on Ubuntu Jammy loads an env file which we didn't
install, causing the service to fail:

```
knot.service: Will spawn child (service_enter_start_pre): /usr/sbin/knotc
knot.service: Failed to load environment files: No such file or directory
knot.service: Failed to run 'start-pre' task: No such file or directory
knot.service: Failed with result 'resources'.
knot.service: Service will not restart (restart setting)
```

2 years agoman: similar → similarly
Zbigniew Jędrzejewski-Szmek [Tue, 23 Aug 2022 10:12:28 +0000 (12:12 +0200)] 
man: similar → similarly

Something *is* similar
Something *works* similarly
Something does something, similarly to how something else does something

See https://sites.ulethbridge.ca/roussel/2017/11/29/similar-and-similarly-are-they-similar/
for a clear explanation.

2 years agoMerge pull request #24352 from DaanDeMeyer/mkosi-opensuse
Zbigniew Jędrzejewski-Szmek [Tue, 23 Aug 2022 09:05:02 +0000 (11:05 +0200)] 
Merge pull request #24352 from DaanDeMeyer/mkosi-opensuse

mkosi: Update to latest commit

2 years agofix typos
eggfly [Tue, 23 Aug 2022 08:09:59 +0000 (16:09 +0800)] 
fix typos

2 years agomeson: Downgrade efi-ld warning 24254/head
Jan Janssen [Wed, 10 Aug 2022 07:47:42 +0000 (09:47 +0200)] 
meson: Downgrade efi-ld warning

The warning isn't that serious and mostly there to inform the user that
lld/mold cannot build efi binaries. It is also better to build test with
fatal meson warnings.

2 years agoci: Add mold to build tests
Jan Janssen [Tue, 9 Aug 2022 08:36:40 +0000 (10:36 +0200)] 
ci: Add mold to build tests

2 years agofix typo
jiangchuangang [Tue, 23 Aug 2022 03:22:37 +0000 (11:22 +0800)] 
fix typo

2 years agoAllow uneven length BootXXXX variables
Goffredo Baroncelli [Mon, 22 Aug 2022 19:25:45 +0000 (21:25 +0200)] 
Allow uneven length BootXXXX variables

The BootXXXX variables may have an uneven length. Don't return error
in this case.

Signed-off-by: Goffredo Baroncelli <kreijack@inwind.it>
2 years agochase-symlinks: refuse more chase_symlink() flags in the open/stat flavours
Lennart Poettering [Mon, 22 Aug 2022 09:33:52 +0000 (11:33 +0200)] 
chase-symlinks: refuse more chase_symlink() flags in the open/stat flavours

These flags make no sense when we try to access the final inode, hence
refuse.

2 years agomeasure: add --current switch for "systemd-measure calculate"
Lennart Poettering [Wed, 17 Aug 2022 16:40:19 +0000 (18:40 +0200)] 
measure: add --current switch for "systemd-measure calculate"

This allows allows shortcutting measurements of the specified files and
use the information from /sys/ instead.

This is not too useful on its own given that "systemd-measure status"
already exists which displays the current, relevant PCR values. The main
difference is how "complete" the information is. "status" will detect if
the measurements make any sense, and show more than PCR 11. "calculate
--current" otoh only reads PCR 11 and uses that, and that's really it.

This is mainly preparation for later work to add PCR signing to the
tool, where usually it makes most sense to sign prepared kernel images,
but for testing it's really useful to shortcut signing to the current
PCR values instead

2 years agotree-wide: use path_join() instead of prefix_roota() in various cases
Lennart Poettering [Mon, 22 Aug 2022 09:38:58 +0000 (11:38 +0200)] 
tree-wide: use path_join() instead of prefix_roota() in various cases

prefix_roota() is something we should stop using. It is bad for three
reasons:

1. As it names suggests it's supposed to be used when working relative
   to some root directory, but given it doesn't follow symlinks (and
   instead just stupidly joins paths) it is not a good choice for that.

2. More often than not it is currently used with inputs under control of
   the user, and that is icky given it typically allocates memory on the
   stack.

3. It's a redundant interface, where chase_symlinks() and path_join()
   already exist as better, safer interfaces.

Hence, let's start moving things from prefix_roota() to path_join() for
the cases where that's appropriate.

2 years agoMerge pull request #24392 from poettering/chase-symlinks-more-stuff
Lennart Poettering [Mon, 22 Aug 2022 16:41:14 +0000 (18:41 +0200)] 
Merge pull request #24392 from poettering/chase-symlinks-more-stuff

some tweaks to chase_symlinks() and port some code from prefix_roota() over

2 years agotest: make TEST-58-REPART support nspawn
Yu Watanabe [Fri, 19 Aug 2022 19:59:03 +0000 (04:59 +0900)] 
test: make TEST-58-REPART support nspawn

2 years agotest: merge test-repart.sh and TEST-58-REPART
Yu Watanabe [Fri, 19 Aug 2022 19:37:00 +0000 (04:37 +0900)] 
test: merge test-repart.sh and TEST-58-REPART

2 years agotest: modernize TEST-58-REPART
Yu Watanabe [Fri, 19 Aug 2022 07:33:09 +0000 (16:33 +0900)] 
test: modernize TEST-58-REPART

2 years agogpt: fix alignment
Yu Watanabe [Sat, 20 Aug 2022 01:56:57 +0000 (10:56 +0900)] 
gpt: fix alignment

2 years agogpt: fix native uuids for s390x
Yu Watanabe [Sat, 20 Aug 2022 01:52:39 +0000 (10:52 +0900)] 
gpt: fix native uuids for s390x

__s390__ is defined for both s390 and s390x. Hence, we need to define
the native uuids for s390x at first.

2 years agoudev: fix inversed inequality for timeout of retrying event
Yu Watanabe [Fri, 19 Aug 2022 12:25:03 +0000 (21:25 +0900)] 
udev: fix inversed inequality for timeout of retrying event

Follow-up for 5d354e525a56955ae7f68062e283dda85ab07794.

2 years agorepart: drop doubled space
Yu Watanabe [Fri, 19 Aug 2022 19:40:38 +0000 (04:40 +0900)] 
repart: drop doubled space

2 years agobash-completion: add systemd-sysext support
Antonio Alvarez Feijoo [Mon, 22 Aug 2022 13:05:53 +0000 (15:05 +0200)] 
bash-completion: add systemd-sysext support

2 years agosysext: add missing COMMAND to the help output and man synopsis
Antonio Alvarez Feijoo [Mon, 22 Aug 2022 12:23:57 +0000 (14:23 +0200)] 
sysext: add missing COMMAND to the help output and man synopsis

2 years agoMerge pull request #24385 from yuwata/hostname-chassis
Luca Boccassi [Mon, 22 Aug 2022 14:40:38 +0000 (15:40 +0100)] 
Merge pull request #24385 from yuwata/hostname-chassis

hostname: fix fallback chassis type

2 years agoci: Drop `actions/setup-node` - unused
Jan Macku [Mon, 22 Aug 2022 10:45:12 +0000 (12:45 +0200)] 
ci: Drop `actions/setup-node` - unused

In `issue_labeler.yml` is no need for node.js runtime (`actions/setup-node`). It was accidentally added by `copy & paste` from another workflow.

2 years agoconf-files: port conf_files_list() over to chase_symlinks() from prefix_roota() 24392/head
Lennart Poettering [Mon, 22 Aug 2022 12:07:27 +0000 (14:07 +0200)] 
conf-files: port conf_files_list() over to chase_symlinks() from prefix_roota()

2 years agohwdb-test: don't rely on --root= quirk
Lennart Poettering [Mon, 22 Aug 2022 12:06:10 +0000 (14:06 +0200)] 
hwdb-test: don't rely on --root= quirk

Previously, the test would rely on the fact that systemd-hwdb would
follow symlinks outside of the --root= hierarchy. That's a bug however,
and systemd-hwdb shouldn't do that. Hence let's remove the fact that the
test relies on it, so that we can then fix systemd-hwdb (specifically:
conf_files_list()) accordingly.

2 years agobootctl: port some more code over to chase_symlinks() from prefix_roota()
Lennart Poettering [Mon, 22 Aug 2022 12:06:49 +0000 (14:06 +0200)] 
bootctl: port some more code over to chase_symlinks() from prefix_roota()

This is far from complete, but let's start moving this way.

2 years agochase-symlinks: add chase_symlinks_and_access() helper
Lennart Poettering [Mon, 22 Aug 2022 09:36:12 +0000 (11:36 +0200)] 
chase-symlinks: add chase_symlinks_and_access() helper

This is similar to chase_symlinks_and_access() but wraps access() rather
than stat()

2 years agochase-symlinks: fix shortcut condition
Lennart Poettering [Mon, 22 Aug 2022 09:35:43 +0000 (11:35 +0200)] 
chase-symlinks: fix shortcut condition

2 years agochase-symlinks: honour CHASE_NOFOLLOW flag properly in some cases
Lennart Poettering [Mon, 22 Aug 2022 09:34:40 +0000 (11:34 +0200)] 
chase-symlinks: honour CHASE_NOFOLLOW flag properly in some cases

2 years agotest: add test case for chassis type 24385/head
Yu Watanabe [Mon, 22 Aug 2022 05:05:22 +0000 (14:05 +0900)] 
test: add test case for chassis type

2 years agoAdd support for Fn+PrtSc on Thinkpads
Tomáš Hnyk [Sun, 21 Aug 2022 11:34:20 +0000 (13:34 +0200)] 
Add support for Fn+PrtSc on Thinkpads

This adds support for Fn+PrtSc on my Lenovo Thinkpad Extreme gen 2. Judging by the picture on the key, it should probably instead of prog2 be "selective_screenshot" (that is a possible value from judging this list https://gist.githubusercontent.com/samvel1024/02e5675e04f9d84f098e98bcd0e1ea12/raw/e18d950ce571b4ff5c832cc06406e9a6afece132/keynames.txt ) but that does not register with evtest at all. With this change, evtest reports:

```
Event: time 1661081631.027773, type 1 (EV_KEY), code 149 (KEY_PROG2), value 1
Event: time 1661081631.027773, -------------- SYN_REPORT ------------
Event: time 1661081631.027886, type 1 (EV_KEY), code 149 (KEY_PROG2), value 0
Event: time 1661081631.027886, -------------- SYN_REPORT ------------
```

I am not sure if systemd is the right place to add this, if not, please refer me somewhere else.

2 years agotake jointly mounted controllers into account when migrate cgroups, otherwise "CGroup...
jiangchuangang [Mon, 22 Aug 2022 03:13:51 +0000 (11:13 +0800)] 
take jointly mounted controllers into account when migrate cgroups, otherwise "CGroupMask done" seems to be redundant.

2 years agohostname: make chassis type actually obtained from ACPI when nothing from DMI
Yu Watanabe [Mon, 22 Aug 2022 04:36:54 +0000 (13:36 +0900)] 
hostname: make chassis type actually obtained from ACPI when nothing from DMI

Fixes a bug introduced by 8c8b1800e90d4307397300ef32b0f6d95efad057.

Fixes #24384.

2 years agoMerge pull request #24379 from mrc0mmand/llvm-15 23803/head
Luca Boccassi [Sat, 20 Aug 2022 22:38:52 +0000 (23:38 +0100)] 
Merge pull request #24379 from mrc0mmand/llvm-15

ci: build with clang-15; drop clang-12

2 years agomkosi: Install tests in final image
Daan De Meyer [Tue, 16 Aug 2022 10:50:29 +0000 (12:50 +0200)] 
mkosi: Install tests in final image

2 years agohashmap: use assert_se() to make clang happy 24379/head
Frantisek Sumsal [Sat, 20 Aug 2022 19:57:18 +0000 (21:57 +0200)] 
hashmap: use assert_se() to make clang happy

Otherwise it complains about a set but unused variable:

```
../src/basic/hashmap.c:1070:48: error: variable 'n_rehashed' set but not used [-Werror,-Wunused-but-set-variable]
        unsigned old_n_buckets, new_n_buckets, n_rehashed, new_n_entries;
                                                       ^
                                                       1 error generated.
```

2 years agocoredump: drop an unused variable
Frantisek Sumsal [Sat, 20 Aug 2022 19:04:24 +0000 (21:04 +0200)] 
coredump: drop an unused variable

2 years agonetwork: drop an unused variable
Frantisek Sumsal [Sat, 20 Aug 2022 19:00:14 +0000 (21:00 +0200)] 
network: drop an unused variable

2 years agomachine: drop an unused variable
Frantisek Sumsal [Sat, 20 Aug 2022 18:45:27 +0000 (20:45 +0200)] 
machine: drop an unused variable

2 years agosd-journal: drop an unused variable
Frantisek Sumsal [Sat, 20 Aug 2022 18:38:17 +0000 (20:38 +0200)] 
sd-journal: drop an unused variable

2 years agoci: build with clang-15; drop clang-12
Frantisek Sumsal [Sat, 20 Aug 2022 18:11:32 +0000 (20:11 +0200)] 
ci: build with clang-15; drop clang-12

2 years agoMerge pull request #24378 from yuwata/test-network-issue-24377
Yu Watanabe [Sat, 20 Aug 2022 13:24:53 +0000 (22:24 +0900)] 
Merge pull request #24378 from yuwata/test-network-issue-24377

test-network: add test case for issue #24377

2 years agotest-network: add test for issue #24377 24378/head
Yu Watanabe [Sat, 20 Aug 2022 11:36:12 +0000 (20:36 +0900)] 
test-network: add test for issue #24377

The issue has been already fixed by
b05e52000b4eee764b383cc3031da0a3739e996e (PR #24020).

2 years agotest-network: add helper functions for reading logs of networkd
Yu Watanabe [Sat, 20 Aug 2022 11:35:18 +0000 (20:35 +0900)] 
test-network: add helper functions for reading logs of networkd

2 years agoMerge pull request #24356 from keszybz/sd-netlink-api
Yu Watanabe [Sat, 20 Aug 2022 10:11:02 +0000 (19:11 +0900)] 
Merge pull request #24356 from keszybz/sd-netlink-api

Small improvements to the sd-netlink api

2 years agohwdb: Add Avita Liber NS13A2 (#24376)
Aryan singh [Sat, 20 Aug 2022 10:02:54 +0000 (15:32 +0530)] 
hwdb: Add Avita Liber NS13A2 (#24376)

This fixes the discrepancies in the coordinate ranges for the touchpad, touchpad in this device(NS13A2) is generic and the same one is used in most models.

2 years agomeasure: store bank name in PcrState structure
Lennart Poettering [Wed, 17 Aug 2022 15:10:53 +0000 (17:10 +0200)] 
measure: store bank name in PcrState structure

Let's not query/strdup()ascii_strlower() it all the time, but just cache
it once and use it.

2 years agotest: wait for whole block device instead of partition
Yu Watanabe [Fri, 19 Aug 2022 22:09:21 +0000 (07:09 +0900)] 
test: wait for whole block device instead of partition

In 'udevadm lock' the device /dev/loopX is locked instead of
/dev/loopXp1. Hence, 'udevadm wait' should wait for /dev/loopX.

For some reasons, the kernel sometimes does not emit uevent for
partitions, and 'udevadm wait' for partitions may fail.

Fixes #24360.

2 years agotest: correctly process multiline strings in $KERNEL_APPEND
Frantisek Sumsal [Fri, 19 Aug 2022 14:30:24 +0000 (16:30 +0200)] 
test: correctly process multiline strings in $KERNEL_APPEND

Some tests (like TEST-02) set a multiline string to $KERNEL_APPEND
(which is a valid thing to do), unfortunately we'd use only the first
line of it and throw the rest away, e.g:

```
$ printf "%s" "$x"
hello

this is a multiline

kernel command line
$ read -ra out <<< "$x"
$ printf "%s" "${out[@]}"
hello
```

Let's use readarray/mapfile instead to avoid this:

```
$ readarray out <<< "$x"
$ printf "%s" "${out[@]}"
hello

this is a multiline

kernel command line

```

2 years agomeasure: add json output
Lennart Poettering [Fri, 12 Aug 2022 13:23:44 +0000 (15:23 +0200)] 
measure: add json output

2 years agoMerge pull request #24368 from poettering/tpm2-json-pcr-array-rework
Lennart Poettering [Fri, 19 Aug 2022 19:51:47 +0000 (21:51 +0200)] 
Merge pull request #24368 from poettering/tpm2-json-pcr-array-rework

tpm2: add helpers for building/parsing JSON arrays of PCR indexes

2 years agoMerge pull request #24350 from DaanDeMeyer/docs-pkexec
Luca Boccassi [Fri, 19 Aug 2022 19:43:50 +0000 (20:43 +0100)] 
Merge pull request #24350 from DaanDeMeyer/docs-pkexec

docs: Recommend pkexec over using an askpass program with sudo

2 years agotpm2-util: introduce tpm2_parse_pcr_argument() helper
Lennart Poettering [Wed, 17 Aug 2022 15:00:27 +0000 (17:00 +0200)] 
tpm2-util: introduce tpm2_parse_pcr_argument() helper

Add a new tpm2_parse_pcr_argument() helper that unifies how we merge PCR
masks in a single function, we can use all over the place. Previously we
had basically the same code for this at 4 places.

2 years agorules: import previous SYSTEMD_READY state for suspended DM devices and skip other...
Michal Sekletar [Tue, 2 Aug 2022 10:38:30 +0000 (12:38 +0200)] 
rules: import previous SYSTEMD_READY state for suspended DM devices and skip other rules

We can't get any FS meta-data from a suspended device. Hence defer
making any plugged/unplugged decisions, i.e. we just import whatever was
previous state and skip processing all other rules.

Thanks Lennart Poettering <lennart@poettering.net> for suggesting this
solution.

2 years agotpm2-util: expose more hash algorithms
Lennart Poettering [Wed, 17 Aug 2022 15:30:29 +0000 (17:30 +0200)] 
tpm2-util: expose more hash algorithms

swtpm supports them, hence maybe support them in our codebase, too

2 years agotpm2-util: add TPM2_PCR_MASK_VALID() helper
Lennart Poettering [Wed, 17 Aug 2022 14:49:14 +0000 (16:49 +0200)] 
tpm2-util: add TPM2_PCR_MASK_VALID() helper

2 years agosd-netlink: use SD_EVENT_ONESHOT for a time-based callback 24356/head
Zbigniew Jędrzejewski-Szmek [Fri, 19 Aug 2022 15:43:56 +0000 (17:43 +0200)] 
sd-netlink: use SD_EVENT_ONESHOT for a time-based callback

2 years agomkosi: Drop workarounds 24352/head
Daan De Meyer [Thu, 18 Aug 2022 18:42:04 +0000 (20:42 +0200)] 
mkosi: Drop workarounds

None of these should be necessary anymore with recent versions of
mkosi.

2 years agomkosi: Update to latest commit
Daan De Meyer [Thu, 18 Aug 2022 17:32:23 +0000 (19:32 +0200)] 
mkosi: Update to latest commit

Fixes #1128

2 years agoTEST-70-TPM2: use "truncate" to generate disk image
Lennart Poettering [Fri, 19 Aug 2022 09:19:59 +0000 (11:19 +0200)] 
TEST-70-TPM2: use "truncate" to generate disk image

Let'se operate on a sparse file here, to reuduce memory use.

2 years agoMerge pull request #24362 from poettering/sha256-tweaks
Lennart Poettering [Fri, 19 Aug 2022 14:33:35 +0000 (16:33 +0200)] 
Merge pull request #24362 from poettering/sha256-tweaks

some tweaks to the sha256 implementation

2 years agotpm2-util: also add helper for parsing PCR arrays 24368/head
Lennart Poettering [Fri, 19 Aug 2022 14:16:03 +0000 (16:16 +0200)] 
tpm2-util: also add helper for parsing PCR arrays

2 years agotpm2-util: split out helpers which format a PCR mask as a JSON array
Lennart Poettering [Fri, 19 Aug 2022 14:09:51 +0000 (16:09 +0200)] 
tpm2-util: split out helpers which format a PCR mask as a JSON array

This makes the code easier to read, and is something we can reuse later
on.

2 years agotree-wide: pass proper values (not bools) to sd_event_source_set_enabled()
Lennart Poettering [Fri, 19 Aug 2022 10:40:24 +0000 (12:40 +0200)] 
tree-wide: pass proper values (not bools) to sd_event_source_set_enabled()

2 years agoMerge pull request #23653 from aafeijoo-suse/ask-for-recovery-key
Lennart Poettering [Fri, 19 Aug 2022 12:55:54 +0000 (14:55 +0200)] 
Merge pull request #23653 from aafeijoo-suse/ask-for-recovery-key

cryptsetup: improve password prompt text

2 years agoAdd --efi-boot-option-description argument to bootctl to control the name of the...
Rene Hollander [Sat, 13 Aug 2022 19:38:02 +0000 (21:38 +0200)] 
Add --efi-boot-option-description argument to bootctl to control the name of the boot
entry.

By default an entry named "Linux Boot Manager" is created (which is the
previous behavior). With the flag the name of the entry can be
controlled, which is useful when installing systemd-boot to multiple ESP
partitions and having uniquely named entries.

Fixes #17044.

2 years agoTEST-70-TPM2: actually enable systemd-measure test
Lennart Poettering [Fri, 19 Aug 2022 09:23:45 +0000 (11:23 +0200)] 
TEST-70-TPM2: actually enable systemd-measure test

A bit emberassing that this never worked.

2 years agocryptsetup: make sure all token-based codepaths are effected by SYSTEMD_CRYPTSETUP_US...
Lennart Poettering [Fri, 19 Aug 2022 09:33:41 +0000 (11:33 +0200)] 
cryptsetup: make sure all token-based codepaths are effected by SYSTEMD_CRYPTSETUP_USE_TOKEN_MODULE env var

Previously the env var was only checked when conditionalizing use of our
own libcryptsetup loadable token modules.  But let's also use it for any
other kind of token module, including possible internal ones by
libcryptsetup.

2 years agocryptsetup: use right internal helper when checking whether to use tokens
Lennart Poettering [Fri, 19 Aug 2022 09:32:07 +0000 (11:32 +0200)] 
cryptsetup: use right internal helper when checking whether to use tokens

The other codepaths get this right, the TPM2 one currently does not. Fix
that.

2 years agosha256: add sha256_direct()/SHA256_DIRECT() helpers 24362/head
Lennart Poettering [Wed, 17 Aug 2022 09:32:38 +0000 (11:32 +0200)] 
sha256: add sha256_direct()/SHA256_DIRECT() helpers