Zbigniew Jędrzejewski-Szmek [Tue, 9 Aug 2022 13:21:10 +0000 (15:21 +0200)]
NEWS: add entries for v252
josh-gordon-fb [Tue, 9 Aug 2022 07:20:07 +0000 (00:20 -0700)]
core/cgroup: use bus locator (#24251)
gtwang01 [Tue, 9 Aug 2022 07:19:09 +0000 (00:19 -0700)]
tree-wide: use bus locator (#24252)
This modifies some sd_bus calls to equivalent bus calls.
Luca BRUNO [Mon, 8 Aug 2022 15:56:06 +0000 (15:56 +0000)]
sysusers: properly process user entries with an explicit GID
This tweaks user creation logic to properly take into consideration
an explicitly requested GID.
It fixes a bug where the creation flow would mistakenly fall back
to use the username instead, resulting in wrong lookups in case of
users and groups using the same name.
Luca BRUNO [Mon, 8 Aug 2022 15:52:33 +0000 (15:52 +0000)]
sysusers: only check whether the requested GID is available
This relaxes the availability check when creating a group, if an
explicit GID has been requested.
It avoids mixing up users and groups entries with valid and unique
UIDs/GIDs, but each having the same ID number.
Yu Watanabe [Mon, 8 Aug 2022 19:57:48 +0000 (04:57 +0900)]
Merge pull request #24244 from yuwata/device-enumerator
sd-device-enumerator: fix sysattr match
Ludwig Nussel [Mon, 8 Aug 2022 14:54:58 +0000 (16:54 +0200)]
kmod-setup: load dmi-sysfs if it's a module
Yu Watanabe [Mon, 8 Aug 2022 14:22:52 +0000 (23:22 +0900)]
test: add tests for sd_device_enumerator_add_match_sysattr/property()
Yu Watanabe [Mon, 8 Aug 2022 14:19:49 +0000 (23:19 +0900)]
sd-device-enumerator: FOREACH_DEVICE_PROPERTY() does not provide NULL value
Hence, when sd_device_enumerator_add_match_property() called with NULL
for value, then the filter always unmatches with the device.
Yu Watanabe [Mon, 8 Aug 2022 13:03:35 +0000 (22:03 +0900)]
sd-device-enumerator,monitor: fix sysattr match
Previously, if sd_device_enumerator_add_match_sysattr() is called for
the same sysattr with different values, then no device passed the filter.
Now, the accepted values (or patterns) are stored in strv, and if the
sysattr value of a device matches with the strv, then the device passes
the filter.
Chih-Hsuan Yen [Thu, 4 Aug 2022 16:45:33 +0000 (00:45 +0800)]
cryptsetup: support keyfile-timeout for using a device as the key file
Closes https://github.com/systemd/systemd/issues/21993
Yu Watanabe [Mon, 8 Aug 2022 14:59:58 +0000 (23:59 +0900)]
Merge pull request #24221 from yuwata/dhcp-client-cleanups
dhcp: use struct hw_addr_data
Yu Watanabe [Mon, 8 Aug 2022 13:02:53 +0000 (22:02 +0900)]
hash-funcs: introduce string_hash_ops_free_strv_free
Lennart Poettering [Mon, 8 Aug 2022 13:40:03 +0000 (15:40 +0200)]
Merge pull request #23511 from diabonas/tpm2-pin-systemd-gpt-auto-generator
cryptsetup: make systemd-gpt-auto-generator work with TPM2 and PIN
Lennart Poettering [Mon, 8 Aug 2022 13:35:55 +0000 (15:35 +0200)]
Merge pull request #24220 from yuwata/on-ac-power
udev-util: assume running on AC power when no battery found
Jan Janssen [Mon, 8 Aug 2022 09:50:01 +0000 (11:50 +0200)]
stub: Use EfiLoaderCode for kernel memory
Fixes: #24237
Lennart Poettering [Mon, 8 Aug 2022 13:32:55 +0000 (15:32 +0200)]
Merge pull request #24044 from dtardon/default-device-timeout
Add a configuration option for setting default device timeout
João Loureiro [Mon, 8 Aug 2022 13:32:19 +0000 (15:32 +0200)]
Fix issue with system time set back (#24131)
Fixes #6036
undef [Sat, 6 Aug 2022 05:47:03 +0000 (05:47 +0000)]
shared/generator: Ensure growfs unit runs after repart
When deploying an image using systemd-repart and systemd-growfs one
should have the image expanded entirely and ready to use after the first
boot. This ensures that growfs does not occur before repart, thus
requiring a second boot.
Lennart Poettering [Mon, 8 Aug 2022 11:50:08 +0000 (13:50 +0200)]
update TODO
Yu Watanabe [Wed, 3 Aug 2022 02:40:00 +0000 (11:40 +0900)]
dhcp: add assertions about client state
Sonali Srivastava [Mon, 8 Aug 2022 10:43:00 +0000 (16:13 +0530)]
docs: mkosi-13 or newer required
Jan Janssen [Sat, 6 Aug 2022 07:07:47 +0000 (09:07 +0200)]
boot: Build with at least -O1 as workaround
Fixes: #24202
Yu Watanabe [Sat, 6 Aug 2022 04:05:59 +0000 (13:05 +0900)]
dhcp: fix potential buffer overflow
Fixes a bug introduced by
324f818781a250b60f2fcfa74ff1c9101d2d1315.
This also renames several macros for DHCP packet size.
Yu Watanabe [Tue, 2 Aug 2022 07:25:20 +0000 (16:25 +0900)]
dhcp: make dhcp_network_bind_raw_socket() take struct hw_addr_data
Yu Watanabe [Tue, 2 Aug 2022 06:45:03 +0000 (15:45 +0900)]
dhcp: make dhcp_identifier_set_duid() take struct hw_addr_data
Yu Watanabe [Tue, 2 Aug 2022 06:34:42 +0000 (15:34 +0900)]
dhcp: make dhcp_identifier_set_iaid() take struct hw_addr_data
Yu Watanabe [Tue, 2 Aug 2022 06:22:16 +0000 (15:22 +0900)]
sd-dhcp6-client: use hw_addr_set()
Yu Watanabe [Tue, 2 Aug 2022 06:07:26 +0000 (15:07 +0900)]
sd-dhcp-client: use struct hw_addr_data to store MAC and broadcast address
Yu Watanabe [Tue, 2 Aug 2022 06:04:50 +0000 (15:04 +0900)]
ether-addr-util: introduce hw_addr_set() helper function
Yu Watanabe [Tue, 2 Aug 2022 06:04:24 +0000 (15:04 +0900)]
dhcp4: stop client before updating MAC address
Yu Watanabe [Mon, 25 Jul 2022 05:11:00 +0000 (14:11 +0900)]
sd-netlink: rename NLType and friends
In sd-netlink, we use 'type' for naming many variables with different type,
and worst of all, function like `type_get_type()` exists. That makes the
code hard to understood.
Let's rename
- NLType -> NLAPolicy
- NLTypeSystem -> NLAPolicySet
- NLTypeSystemUnion -> NLAPolicySetUnion
- type_get_type() -> policy_get_type()
- type_get_type_system() -> policy_get_policy_set(), and so on.
This also changes the type of attribute taken by e.g.
`sd_netlink_message_append_string()` from `unsigned short` -> `uint16_t`
to make the variable size clearer.
Yu Watanabe [Fri, 5 Aug 2022 18:42:29 +0000 (03:42 +0900)]
udev-util: assume system is running on AC power when no battery found
Fixes #24214.
Yu Watanabe [Fri, 5 Aug 2022 18:35:04 +0000 (03:35 +0900)]
udev-util: align string table
Yu Watanabe [Fri, 5 Aug 2022 18:18:30 +0000 (03:18 +0900)]
Merge pull request #23340 from yuwata/network-check-sr-iov-pf-state
network: check SR-IOV PF state
Yu Watanabe [Fri, 5 Aug 2022 18:18:14 +0000 (03:18 +0900)]
Merge pull request #23508 from yuwata/core-device
core/device: fix devlink handling
Richard Phibel [Fri, 5 Aug 2022 17:40:17 +0000 (19:40 +0200)]
mkosi: Add package libfdisk to Ubuntu dependencies (#24211)
* mkosi: Add package libfdisk to Ubuntu dependencies
The libfdisk package is needed by systemd-repart.
David Rheinsberg [Wed, 29 Jun 2022 11:37:40 +0000 (13:37 +0200)]
bus: use inline trace argument for ANONYMOUS auth
Rather than using a separate DATA round to transmit the trace-string of
the ANONYMOUS authentication scheme, transmit it inline as argument.
This requires a refactor of the client-side SASL parser, as we now have
a different set of replies depending on the mode used.
This fixes an issue where libdbus-1 does not query for trace-strings if
not transmit inline as AUTH-ANONYMOUS argument. It is unclear from the
wording of the spec whether this is a violation by libdbus-1. However,
we can work around it by simply changing our mode of transmittal.
Luca Boccassi [Fri, 5 Aug 2022 15:38:58 +0000 (16:38 +0100)]
Merge pull request #24216 from poettering/ispowerof2
add ISPOWEROF2() macro and use it
Lennart Poettering [Thu, 4 Aug 2022 13:15:52 +0000 (15:15 +0200)]
man,journalctl: introduce man/--help sections
So far the --help text and the man page of journactl were mostly a large
pile of options shown next to each other. Let's add some basic
structure, and group switches by sections such as "Filtering Options",
"Output Options" and so on.
Do this the same way in the --help text and in the man page.
Since this moves everything around anyway, I also opted to rebreak all
paragraphs in the man page. This makes the patch larger than necessary,
but given that this whole patch doesn't really change contents besides
section titles I figured this would be OK.
David Tardon [Sat, 16 Jul 2022 10:36:06 +0000 (12:36 +0200)]
man: update dbus docs
David Tardon [Sat, 16 Jul 2022 08:16:41 +0000 (10:16 +0200)]
man: document DefaultDeviceTimeoutSec=
Yu Watanabe [Fri, 5 Aug 2022 13:16:58 +0000 (22:16 +0900)]
core/device: add comments for boolean arguments
Yu Watanabe [Thu, 28 Apr 2022 18:14:44 +0000 (03:14 +0900)]
core/device: always accept syspath change
When multiple devices have the same devlink, then
adding/updating/removing one of the device may cause syspath change.
Fixes the following issue in
https://github.com/systemd/systemd/issues/23208#issue-
1217909746
> the above shows an inconsistency between udev's and systemd's handling
> of the two different devices having the same alias. While udev replaces
> the by-uuid symlink which now points to sdh1 rather than sdd1, systemd
> keeps the previous mapping to sdd1 and emits a warning. This is not the
> problem cause but worth mentioning.
Yu Watanabe [Thu, 28 Apr 2022 18:12:17 +0000 (03:12 +0900)]
core/device: move several functions
No functional change. A preparation for later commits.
Yu Watanabe [Fri, 29 Apr 2022 17:35:16 +0000 (02:35 +0900)]
core/device: store the original path
The unit name may be hashed. Hence, we cannot obtain the original path
from the unit name.
The path will be used in the later commits.
Franck Bui [Thu, 5 May 2022 09:11:57 +0000 (11:11 +0200)]
core: replace m->honor_device_enumeration with MANAGER_IS_SWITCHING_ROOT()
Franck Bui [Thu, 5 May 2022 06:49:56 +0000 (08:49 +0200)]
core: introduce MANAGER_IS_SWITCHING_ROOT() helper function
Will be used by the following commit.
Yu Watanabe [Thu, 28 Jul 2022 06:11:46 +0000 (15:11 +0900)]
network: also check SR-IOV PF port and other VF ports before configuring
When a PF port becomes down (this can happens e.g. the PF port is joining
a bond interface), some drivers make its VF ports also become down, and
may cause failures in configuring VF ports.
Similary, when a VF port become down, some drivers make its PF port and
other VF ports down.
Let's configure SR-IOV ports (both PF and VFs) after all link-layer
settings of all ports being applied.
Fixes #23315.
Yu Watanabe [Thu, 28 Jul 2022 05:25:52 +0000 (14:25 +0900)]
network: manage SR-IOV PF and VF ports
Yu Watanabe [Fri, 13 May 2022 11:21:21 +0000 (20:21 +0900)]
network: split out link_is_ready_to_create_stacked_netdev()
Preparation for later commits.
Yu Watanabe [Fri, 13 May 2022 11:48:18 +0000 (20:48 +0900)]
network: check link state with link_is_ready_to_configure() before configuring DHCP client or friends
Otherwise, DHCP client or friends may started before link-layer properties,
e.g. MAC address, being configured or the link being activated.
Yu Watanabe [Thu, 28 Jul 2022 07:43:26 +0000 (16:43 +0900)]
network: drop carrier check for unmanaged interface from link_is_ready_to_configure()
Preparation for later commits. No functional change.
Yu Watanabe [Tue, 10 May 2022 16:54:48 +0000 (01:54 +0900)]
network: refuse to configure anything on pending or initialized state
Yu Watanabe [Thu, 12 May 2022 23:36:50 +0000 (08:36 +0900)]
network: unset master ifindex only when necessary
Yu Watanabe [Thu, 28 Jul 2022 07:39:11 +0000 (16:39 +0900)]
network: wiphy: use ERRNO_IS_DEVICE_ABSENT()
Yu Watanabe [Thu, 12 May 2022 23:54:44 +0000 (08:54 +0900)]
udev: ignore empty SR-IOV VF suffix
It should not happen. Just for safety.
Yu Watanabe [Tue, 26 Jul 2022 19:16:55 +0000 (04:16 +0900)]
sd-device: introduce sd_device_new_child()
Frantisek Sumsal [Fri, 5 Aug 2022 09:48:45 +0000 (11:48 +0200)]
ci: set a timeout for each mkosi stage
Work around #24202 so we don't wait ~6 hours for a stuck QEMU job.
Lennart Poettering [Fri, 5 Aug 2022 11:19:23 +0000 (13:19 +0200)]
macro: use ISPOWEROF2() at various places
Lennart Poettering [Fri, 5 Aug 2022 11:16:27 +0000 (13:16 +0200)]
macro: add macro for checking if integer is power of 2
David Tardon [Sat, 16 Jul 2022 07:49:12 +0000 (09:49 +0200)]
core: allow to set default timeout for devices
Fixes: #19879
Jonas Witschel [Wed, 25 May 2022 12:06:44 +0000 (14:06 +0200)]
cryptsetup: test unlocking using a TPM2 LUKS2 token plugin with a PIN
Test the functionality implemented in the previous commit ("cryptsetup: ask for
PIN when trying to activate using a LUKS2 token plugin"): when "tpm2-device" is
not specified, systemd-cryptsetup calls crypt_activate_by_token_pin() to try to
unlock using a LUKS2 token plugin, test whether this is able to obtain the
provided PIN.
Jonas Witschel [Wed, 25 May 2022 12:06:12 +0000 (14:06 +0200)]
cryptsetup: ask for PIN when trying to activate using a LUKS2 token plugin
crypt_activate_by_token() fails with ENOANO if the token is protected with a
PIN, in this case we need to call crypt_activate_by_token_pin() with a PIN.
This logic is already implemented in
crypt_activate_by_token_pin_ask_password().
This code path is relevant when using systemd-gpt-auto-generator because there
is no a priory information about the type of the used security device, so
systemd-cryptsetup tries to unlock the volume using the corresponding
cryptsetup plugin.
Jonas Witschel [Fri, 5 Aug 2022 09:11:54 +0000 (11:11 +0200)]
cryptsetup-token-systemd-fido2: use crypt_normalize_pin
Use the helper function introduced in the previous commit ("cryptsetup:
implement cryptsetup_token_open_pin for systemd-tpm2 LUKS2 token") for
cryptsetup-token-systemd-tpm2.
Jonas Witschel [Wed, 25 May 2022 12:06:12 +0000 (14:06 +0200)]
cryptsetup: implement cryptsetup_token_open_pin for systemd-tpm2 LUKS2 token
This finishes the implementation started in commit
1f895adac287b5f1b6b854caa586093616ccc172 ("cryptsetup: add libcryptsetup TPM2
PIN support").
Note that the previous implementation took a shortcut by returning EOPNOTSUPP
instead of the correct ENOANO as per the cryptsetup documentation. This meant
that systemd-cryptsetup fell back to the non-plugin implementation in order to
ask for the PIN. Since this does not happen any more when returning ENOANO, we
need to ask for the PIN in attach_luks2_by_tpm2_via_plugin() instead like
attach_luks2_by_fido2_via_plugin() does.
Jonas Witschel [Wed, 25 May 2022 12:05:31 +0000 (14:05 +0200)]
cryptsetup: refactor asking for a PIN into a more generic function
This functionality will be useful for other LUKS2 token types as well in the
future.
Yu Watanabe [Fri, 5 Aug 2022 04:48:23 +0000 (13:48 +0900)]
Merge pull request #23367 from yuwata/core-mount
core/mount: fix dependency issues
Yu Watanabe [Thu, 4 Aug 2022 16:03:54 +0000 (01:03 +0900)]
test-network: support the case that l2tp module is not supported
Hopefully fixes the issue reported at
https://github.com/systemd/systemd-centos-ci/pull/517#issuecomment-
1205399798.
Yu Watanabe [Wed, 20 Jul 2022 07:56:25 +0000 (16:56 +0900)]
test: add test case for mount unit dependencies
Yu Watanabe [Sat, 14 May 2022 21:31:17 +0000 (06:31 +0900)]
core/mount: make device deps from /proc/self/mountinfo and .mount unit file exclusive
Before this commit, when a .mount unit file is loaded, the device
dependencies from the unit file are automatically added. If a device
that is different from which specified in .mount unit file is mounted
on the path, then the device dependencies about the device are also added.
Hence, the unit has device dependencies about two (or more) different
devices. Hence, if one of the devices are unplugged, even if another one
is mounted on the path, then the path is unmounted.
This commit makes device dependencies from two different sources
exclusive, and always regenerate the dependencies when one of the
information is updated.
Fixes #19983 and #23552.
Yu Watanabe [Sat, 14 May 2022 20:49:01 +0000 (05:49 +0900)]
core/mount: also remove default deps from /proc/self/mountinfo when it is updated
The dependencies tagged with UNIT_DEPENDENCY_MOUNTINFO_DEFAULT depend
on both /proc/self/mountinfo and corresponding .mount unit file.
Hence, if some information from mountinfo is updated, e.g. device mounted
on the path, we need to update the dependencies.
Yu Watanabe [Fri, 13 May 2022 03:30:04 +0000 (12:30 +0900)]
core/mount: set Mount.from_proc_self_mountinfo flag before adding default dependencies
When the function mount_setup_new_unit() is called, the corresponding
.mount unit file is not loaded. Hence, Mount.from_fragment is false.
To add default dependencies to e.g. .device units, it is necessary that
the Mount.from_proc_self_mountinfo flag is set. However, the flag was
not set even the unit has information from /proc/self/mountinfo.
Partially fixes #19983.
Yu Watanabe [Fri, 13 May 2022 02:40:55 +0000 (11:40 +0900)]
core: unit_name_from_path() does not return -ENAMETOOLONG anymore
Follow-ups for
a7fb1f2eae3314c28d451822302283a7ab1bc1c0 and
1d0727e76fd5e9a07cc9991ec9a10ea1d78a99c7.
Yu Watanabe [Sat, 14 May 2022 20:40:34 +0000 (05:40 +0900)]
core/mount: use set_put_strdup_full()
Lennart Poettering [Thu, 4 Aug 2022 15:27:20 +0000 (17:27 +0200)]
Merge pull request #24189 from medhefgo/boot-secure
boot: Follow-up fixes for #20255
Ludwig Nussel [Tue, 19 Jul 2022 15:29:45 +0000 (17:29 +0200)]
pull: fix PullFlags numbering
Richard Phibel [Thu, 4 Aug 2022 09:03:51 +0000 (11:03 +0200)]
analyze: Migrate to bus-locator.h
Migrated analyze-security to use new API bus_call_method instead of sd_bus_call_method.
Michal Sekletar [Wed, 1 Jun 2022 08:15:06 +0000 (10:15 +0200)]
scope: allow unprivileged delegation on scopes
Previously it was possible to set delegate property for scope, but you
were not able to allow unprivileged process to manage the scope's cgroup
hierarchy. This is useful when launching manager process that will run
unprivileged but is supposed to manage its own (scope) sub-hierarchy.
Fixes #21683
Frantisek Sumsal [Thu, 4 Aug 2022 09:00:10 +0000 (11:00 +0200)]
test: skip the relevant test case if systemd-measure is not present
systemd-measure is not built without gnu-efi, which is the case, for
example, on ppc64le. Let's skip the relevant test case in this case
instead of failing.
```
The Meson build system
Version: 0.58.2
...
Host machine cpu family: ppc64
Host machine cpu: ppc64le
...
Message: Skipping systemd-measure.1 because HAVE_GNU_EFI is false
...
[ 115.711775] testsuite-70.sh[745]: + cat
[ 115.741996] testsuite-70.sh[832]: + /usr/lib/systemd/systemd-measure calculate --linux=/tmp/tpmdata1 --initrd=/tmp/tpmdata2
[ 115.754015] testsuite-70.sh[833]: + cmp - /tmp/result
[ 115.758004] testsuite-70.sh[832]: /usr/lib/systemd/tests/testdata/units/testsuite-70.sh: line 56: /usr/lib/systemd/systemd-measure: No such file or directory
[ 115.773851] testsuite-70.sh[833]: cmp: EOF on - which is empty
[ 115.983681] sh[835]: + systemctl poweroff --no-block
```
Luca Boccassi [Tue, 26 Jul 2022 17:01:09 +0000 (18:01 +0100)]
docs: add disabled PR template for code freeze
To be enabled on rc1, and disabled again after the final release.
Gives contributors a clear warning that new features/APIs will be
postponed.
Jan Janssen [Thu, 4 Aug 2022 08:21:15 +0000 (10:21 +0200)]
boot: Skip safety countdown when running in a VM
Jan Janssen [Wed, 3 Aug 2022 09:27:38 +0000 (11:27 +0200)]
man: Add instructions for Microsoft secure boot keys
Adding Microsoft keys by default is recommended because firmware drivers
might be signed by it.
This also changes the file ending from .esl to .auth as that is used by
sign-efi-sig-list manpage and other sources.
Daan De Meyer [Wed, 3 Aug 2022 09:37:17 +0000 (11:37 +0200)]
repart: Only lock block device once
Let's lock the backing fd instead of locking/unlocking multiple
times when doing multiple operations with repart. It doesn't make
much sense for anything else to touch the block device while there
are still repart operations pending on it. By keeping the lock over
the full duration of repart, we avoid anything else from interfering
with the block device inbetween operations.
Luca Boccassi [Thu, 4 Aug 2022 00:02:55 +0000 (01:02 +0100)]
Merge pull request #24141 from DaanDeMeyer/dissect-umount
dissect: Add systemd-dissect --umount
Luca Boccassi [Wed, 3 Aug 2022 17:41:13 +0000 (18:41 +0100)]
integritysetup: do not use crypt_init_data_device after crypt_init
crypt_init_data_device() replaces the crypt_device struct with a
new allocation, losing the old one, which we get from crypt_init().
Use crypt_set_data_device() instead.
Enhance the test to cover this option too.
Daan De Meyer [Wed, 3 Aug 2022 13:52:29 +0000 (15:52 +0200)]
man: Clarify that tools should prefer mount units over editing fstab
Daan De Meyer [Wed, 27 Jul 2022 23:55:11 +0000 (01:55 +0200)]
dissect: Add systemd-dissect --umount
This command takes a mountpoint, unmounts it and makes sure the
underlying partition devices and block device are removed before
exiting.
To mirror the --mount operation, we also add a --rmdir option which
does the opposite of --mkdir, and a -U option which is a shortcut
for --umount --rmdir.
Daan De Meyer [Fri, 29 Jul 2022 10:19:09 +0000 (12:19 +0200)]
blockdev-util: Add block_device_remove_all_partitions()
This function takes a block device, uses sd-device to iterate all
the partitions, and removes them one by one.
Daan De Meyer [Wed, 27 Jul 2022 23:49:07 +0000 (01:49 +0200)]
loop-util: Add loop_device_unrelinquish()
Allows taking ownership of a loop device which makes sure that
loop_device_unrefp() will try to destroy it when it runs.
Daan De Meyer [Wed, 27 Jul 2022 22:54:16 +0000 (00:54 +0200)]
blockdev-util: Introduce block_device_add/remove_partition()
Extracted from dissect-image.c.
Daan De Meyer [Wed, 27 Jul 2022 21:11:37 +0000 (23:11 +0200)]
blockdev-util: Introduce fd_get_whole_disk()
Extracted from find_devno() in udevadm-lock.c.
Lennart Poettering [Wed, 3 Aug 2022 16:51:45 +0000 (18:51 +0200)]
man: fix docbook
Quentin Deslandes [Mon, 25 Jul 2022 13:53:12 +0000 (15:53 +0200)]
journal: remove unnecessary HAVE_PCRE2 check
Since HAVE_PCRE2 checks are performed in pcre2-util.c, there is no
need for this extra check in journalctl.c.
Luca Boccassi [Mon, 18 Apr 2022 20:46:52 +0000 (22:46 +0200)]
core: drop unused BUS_UNIT_QUEUE_RETURN_SKIP_ON_CONDITION_FAIL flag
We'll refactor and implement the feature in a different way
Daan De Meyer [Wed, 3 Aug 2022 13:39:12 +0000 (15:39 +0200)]
repart: Remove unnecessary newlines from JSON output
Before
```
➜ systemd git:(dissect-have-blkid) SYSTEMD_LOG_LEVEL=err build/systemd-repart --definitions definitions/ --dry-run=yes --empty=create --size=100M --json=pretty abc
[
{
"type" : "root-x86-64",
"label" : "root-x86-64",
"uuid" : "
2f7c902c-6b2a-4b47-a44b-
dca765f38cd2",
"file" : "root.conf",
"node" : "abc1",
"offset" :
1048576,
"old_size" : 0,
"raw_size" :
103788544,
"old_padding" : 0,
"raw_padding" : 0,
"activity" : "create"
}
]
➜ systemd git:(dissect-have-blkid)
```
After:
```
➜ systemd git:(repart-newlines) SYSTEMD_LOG_LEVEL=err build/systemd-repart --definitions definitions/ --dry-run=yes --empty=create --size=100M --json=pretty abc
[
{
"type" : "root-x86-64",
"label" : "root-x86-64",
"uuid" : "
2f7c902c-6b2a-4b47-a44b-
dca765f38cd2",
"file" : "root.conf",
"node" : "abc1",
"offset" :
1048576,
"old_size" : 0,
"raw_size" :
103788544,
"old_padding" : 0,
"raw_padding" : 0,
"activity" : "create"
}
]
➜ systemd git:(repart-newlines)
```
Frantisek Sumsal [Wed, 3 Aug 2022 10:35:49 +0000 (12:35 +0200)]
test: optionally wait a bit when checking the mount unit
On fast systems we might race against systemd and check the mount unit
after mounting it way too early before systemd had a chance to react to
the change.
```
[ 4.677701] H systemd[1]: Event source 0x210b3b0 (mount-monitor-dispatch) entered rate limit state.
...
[ 4.863731] H testsuite-64.sh[812]: + mount /logsysfsRxx
[ 4.865918] H kernel: EXT4-fs (vda2): mounted filesystem with ordered data mode. Opts: (null)
[ 4.866213] H testsuite-64.sh[812]: + systemctl status /logsysfsRxx
[ 4.877502] H testsuite-64.sh[919]: ○ logsysfsRxx.mount - /logsysfsRxx
[ 4.877502] H testsuite-64.sh[919]: Loaded: loaded (/etc/fstab; generated)
[ 4.877502] H testsuite-64.sh[919]: Active: inactive (dead)
[ 4.877502] H testsuite-64.sh[919]: Where: /logsysfsRxx
[ 4.877502] H testsuite-64.sh[919]: What: /dev/disk/by-uuid/
deadbeef-dead-dead-beef-
222222222222
[ 4.877502] H testsuite-64.sh[919]: Docs: man:fstab(5)
[ 4.877502] H testsuite-64.sh[919]: man:systemd-fstab-generator(8)
[ 4.877502] H testsuite-64.sh[919]: Aug 03 10:10:10 H systemd[1]: logsysfsRxx.mount: Processing implicit device dependencies
[ 4.877502] H testsuite-64.sh[919]: Aug 03 10:10:10 H systemd[1]: logsysfsRxx.mount: Added Requires dependency on /dev/disk/by-uuid/
deadbeef-dead-dead-beef-
222222222222
[ 4.877502] H testsuite-64.sh[919]: Aug 03 10:10:10 H systemd[1]: logsysfsRxx.mount: Added StopPropagatedFrom dependency on /dev/disk/by-uuid/
deadbeef-dead-dead-beef-
222222222222
[ 4.895683] H sh[920]: + systemctl poweroff --no-block
[ 4.906533] H systemd[1]: Found unit logsysfsRxx.mount at /run/systemd/generator/logsysfsRxx.mount (regular file)
[ 4.906594] H systemd[1]: Preset files don't specify rule for logsysfsRxx.mount. Enabling.
[ 4.906990] H systemd[1]: testsuite-64.service: Main process exited, code=exited, status=3/NOTIMPLEMENTED
[ 4.907057] H systemd[1]: testsuite-64.service: Failed with result 'exit-code'.
[ 4.907287] H systemd[1]: Failed to start testsuite-64.service.
[ 4.955293] H systemd[1]: Starting end.service...
[ 4.955736] H systemd-logind[809]: The system will power off now!
[ 4.955868] H systemd-logind[809]: System is powering down.
[ 4.975781] H systemd[1]: Event source 0x210b3b0 (mount-monitor-dispatch) left rate limit state.
[ 4.975821] H systemd[1]: logsysfsRxx.mount: Processing implicit device dependencies
[ 4.975857] H systemd[1]: logsysfsRxx.mount: Added Requires dependency on /dev/vda2
[ 4.975893] H systemd[1]: logsysfsRxx.mount: Added StopPropagatedFrom dependency on /dev/vda2
[ 4.975928] H systemd[1]: Unit blockdev@dev-vda2.target has alias blockdev@.target.
[ 4.975967] H systemd[1]: logsysfsRxx.mount: Added After dependency on /dev/vda2
[ 4.976081] H systemd[1]: logsysfsRxx.mount: Changed dead -> mounted
```
James Hilliard [Mon, 1 Aug 2022 01:11:47 +0000 (01:11 +0000)]
bpf: fix is_allow_list section
The llvm bpf compiler appears to place const volatile variables in
a non-standard section which creates an incompatibility with the gcc
bpf compiler.
To fix this force GCC to also use the rodata section.
Note this does emit an assembler warning:
Generating src/core/bpf/restrict_ifaces/restrict-ifaces.bpf.unstripped.o with a custom command
/tmp/ccM2b7jP.s: Assembler messages:
/tmp/ccM2b7jP.s:87: Warning: setting incorrect section attributes for .rodata
See:
https://github.com/llvm/llvm-project/issues/56468
Fixes:
../src/core/restrict-ifaces.c:45:14: error: ‘struct
restrict_ifaces_bpf’ has no member named ‘rodata’; did you mean
‘data’?
45 | obj->rodata->is_allow_list = is_allow_list;
| ^~~~~~
| data
Loïc Collignon [Wed, 3 Aug 2022 09:42:28 +0000 (11:42 +0200)]
Fix 24172: __STDC_VERSION__ may be defined in C++
According to the C++ ISO standard, a conformant compiler is allowed to
define this macro to any value for any reason as it is implementation
defined: https://timsong-cpp.github.io/cppwp/cpp.predefined#2.3
This mean that it cannot be assumed that it is not defined in a C++.
Change the condition to reflect that.
Jan Janssen [Wed, 3 Aug 2022 09:05:12 +0000 (11:05 +0200)]
boot: Follow-up fixes for #20255