Frantisek Sumsal [Sun, 14 May 2023 06:15:33 +0000 (08:15 +0200)]
test: use dropins to override system configuration
Instead of touching the configuration files directly.
Frantisek Sumsal [Sat, 13 May 2023 19:59:34 +0000 (21:59 +0200)]
vimrc: use 109ch text width for shell scripts as well
Maksim Kliazovich [Sat, 13 May 2023 19:20:55 +0000 (21:20 +0200)]
po: Translated using Weblate (Belarusian)
Currently translated at 100.0% (193 of 193 strings)
Co-authored-by: Maksim Kliazovich <maxklezovich@gmail.com>
Translate-URL: https://translate.fedoraproject.org/projects/systemd/master/be/
Translation: systemd/main
Yu Watanabe [Thu, 11 May 2023 07:42:27 +0000 (16:42 +0900)]
sd-dhcp-server: also send DNS servers or friends on DHCPOFFER
From RFC 2131 section 4.3.1 (https://www.rfc-editor.org/rfc/rfc2131#section-4.3.1):
----
The server MUST return to the client:
- Parameters requested by the client, according to the following rules:
-- IF the server has been explicitly configured with a default
value for the parameter, the server MUST include that value
in an appropriate option in the 'option' field,
----
The sentence is not only for ACK, but for all (positive) responses, that
is DHCPOFFER and DHCPACK.
Fixes #27471.
Luca Boccassi [Sat, 13 May 2023 10:49:21 +0000 (11:49 +0100)]
Merge pull request #27605 from YHNdnzj/dbus-activation-followup
core: only refuse Type=dbus service enqueue if dbus has pending stop job
Luca Boccassi [Sat, 13 May 2023 10:09:00 +0000 (11:09 +0100)]
Merge pull request #27571 from DaanDeMeyer/mkosi
mkosi: Package a erofs usr partition with signed verity
Luca Boccassi [Sat, 13 May 2023 09:23:14 +0000 (10:23 +0100)]
Merge pull request #27634 from mrc0mmand/TEST-13-shenanigans
test: clean up & extend the nspawn/machinectl test suite
Daan De Meyer [Mon, 8 May 2023 14:06:41 +0000 (16:06 +0200)]
mkosi: Package a erofs usr partition with signed verity
Let's start moving towards a more involved partitioning setup to
test our stuff more when using mkosi.
The root partition is generated on boot with systemd-repart.
CentOS supports neither erofs nor btrfs so we use squashfs and xfs
instead.
We also enable SecureBoot= locally for additional coverage. This
and the use of verity means users need to run `mkosi genkey` once
to generate the keys necessary to do secure boot and verity.
Daan De Meyer [Tue, 9 May 2023 11:47:43 +0000 (13:47 +0200)]
mkosi: Store /etc under /usr/share/factory/mkosi
If we're making a /usr only image, we still want to populate /etc
fully on first boot. To make that possible, let's copy /etc to
/usr/share/factory/mkosi in a finalize script, which runs after
all changes to the image have been made. Let's also add a tmpfiles
snippet that merges /usr/share/factory/mkosi with /etc on boot to
populate /etc.
Daan De Meyer [Fri, 12 May 2023 15:24:39 +0000 (17:24 +0200)]
mkosi: Do not enable ACL usage by default
This is only useful to be able to remove generated files using rm -rf
instead of mkosi clean and has some implications for the generated
rootfs so let's not enable it by default.
Daan De Meyer [Mon, 8 May 2023 09:03:32 +0000 (11:03 +0200)]
sulogin: Read SYSTEMD_SULOGIN_FORCE from kernel cmdline
This allows setting it on the kernel cmdline and having it work
automatically without having to write any dropins or such.
Also enable the option in mkosi so that we can debug the initrd
properly with a locked root account.
Frantisek Sumsal [Fri, 12 May 2023 19:36:50 +0000 (21:36 +0200)]
machine,portable: fix a typo in an info message
Frantisek Sumsal [Fri, 12 May 2023 15:59:54 +0000 (17:59 +0200)]
test: merge machinectl edit/cat tests into TEST-13
Frantisek Sumsal [Fri, 12 May 2023 15:56:22 +0000 (17:56 +0200)]
test: always install the script utility
Frantisek Sumsal [Fri, 12 May 2023 15:39:41 +0000 (17:39 +0200)]
test: add a couple of tests for machinectl
Luca Boccassi [Fri, 12 May 2023 20:29:38 +0000 (21:29 +0100)]
Merge pull request #27633 from DaanDeMeyer/repart-dropin
repart: Make sure we look up dropin files in the root directory
Daan De Meyer [Sun, 7 May 2023 09:15:27 +0000 (11:15 +0200)]
units: Add missing dependencies on initrd-switch-root.target
These are all services that valid to be run in the initrd, so let's
make sure they have the appropriate dependencies on
initrd-switch-root.target so that they are stopped when we're about
to switch root.
drosdeck [Fri, 12 May 2023 14:33:54 +0000 (10:33 -0400)]
Fix Positivo CF40CM-V2 key toggle touchpad
Frantisek Sumsal [Fri, 12 May 2023 12:50:52 +0000 (14:50 +0200)]
machine: fix a memory leak when showing multiple machines
+ machinectl status long-running long-running long-running
=================================================================
==986==ERROR: LeakSanitizer: detected memory leaks
Direct leak of 1568 byte(s) in 2 object(s) allocated from:
#0 0x7fe57caba097 in calloc (/lib64/libasan.so.8+0xba097)
#1 0x7fe57b891e8e in message_from_header ../src/libsystemd/sd-bus/bus-message.c:372
#2 0x7fe57b892dfd in bus_message_from_malloc ../src/libsystemd/sd-bus/bus-message.c:421
#3 0x7fe57b9089a8 in bus_socket_make_message ../src/libsystemd/sd-bus/bus-socket.c:1165
#4 0x7fe57b90affe in bus_socket_read_message ../src/libsystemd/sd-bus/bus-socket.c:1294
#5 0x7fe57b92db71 in bus_read_message ../src/libsystemd/sd-bus/sd-bus.c:2082
#6 0x7fe57b933352 in sd_bus_call ../src/libsystemd/sd-bus/sd-bus.c:2483
#7 0x7fe57b84da61 in sd_bus_call_methodv ../src/libsystemd/sd-bus/bus-convenience.c:183
#8 0x7fe57b2789e8 in bus_call_method ../src/shared/bus-locator.c:109
#9 0x40f71c in show_machine ../src/machine/machinectl.c:713
#10 0x7fe57b65c8cf in dispatch_verb ../src/shared/verbs.c:103
#11 0x42e9ce in machinectl_main ../src/machine/machinectl.c:2980
#12 0x42ebf9 in run ../src/machine/machinectl.c:3005
#13 0x42ed1f in main ../src/machine/machinectl.c:3008
#14 0x7fe579e4a50f in __libc_start_call_main (/lib64/libc.so.6+0x2750f)
Indirect leak of 234 byte(s) in 2 object(s) allocated from:
#0 0x7fe57cab95b5 in __interceptor_realloc.part.0 (/lib64/libasan.so.8+0xb95b5)
#1 0x7fe57b909822 in bus_socket_read_message ../src/libsystemd/sd-bus/bus-socket.c:1214
#2 0x7fe57b92db71 in bus_read_message ../src/libsystemd/sd-bus/sd-bus.c:2082
#3 0x7fe57b933352 in sd_bus_call ../src/libsystemd/sd-bus/sd-bus.c:2483
#4 0x7fe57b84da61 in sd_bus_call_methodv ../src/libsystemd/sd-bus/bus-convenience.c:183
#5 0x7fe57b2789e8 in bus_call_method ../src/shared/bus-locator.c:109
#6 0x40f71c in show_machine ../src/machine/machinectl.c:713
#7 0x7fe57b65c8cf in dispatch_verb ../src/shared/verbs.c:103
#8 0x42e9ce in machinectl_main ../src/machine/machinectl.c:2980
#9 0x42ebf9 in run ../src/machine/machinectl.c:3005
#10 0x42ed1f in main ../src/machine/machinectl.c:3008
#11 0x7fe579e4a50f in __libc_start_call_main (/lib64/libc.so.6+0x2750f)
Indirect leak of 4 byte(s) in 2 object(s) allocated from:
#0 0x7fe57ca7243b in strdup (/lib64/libasan.so.8+0x7243b)
#1 0x7fe57b8c1543 in message_parse_fields ../src/libsystemd/sd-bus/bus-message.c:4125
#2 0x7fe57b893586 in bus_message_from_malloc ../src/libsystemd/sd-bus/bus-message.c:443
#3 0x7fe57b9089a8 in bus_socket_make_message ../src/libsystemd/sd-bus/bus-socket.c:1165
#4 0x7fe57b90affe in bus_socket_read_message ../src/libsystemd/sd-bus/bus-socket.c:1294
#5 0x7fe57b92db71 in bus_read_message ../src/libsystemd/sd-bus/sd-bus.c:2082
#6 0x7fe57b933352 in sd_bus_call ../src/libsystemd/sd-bus/sd-bus.c:2483
#7 0x7fe57b84da61 in sd_bus_call_methodv ../src/libsystemd/sd-bus/bus-convenience.c:183
#8 0x7fe57b2789e8 in bus_call_method ../src/shared/bus-locator.c:109
#9 0x40f71c in show_machine ../src/machine/machinectl.c:713
#10 0x7fe57b65c8cf in dispatch_verb ../src/shared/verbs.c:103
#11 0x42e9ce in machinectl_main ../src/machine/machinectl.c:2980
#12 0x42ebf9 in run ../src/machine/machinectl.c:3005
#13 0x42ed1f in main ../src/machine/machinectl.c:3008
#14 0x7fe579e4a50f in __libc_start_call_main (/lib64/libc.so.6+0x2750f)
SUMMARY: AddressSanitizer: 1806 byte(s) leaked in 6 allocation(s).
Frantisek Sumsal [Fri, 12 May 2023 12:43:23 +0000 (14:43 +0200)]
machine: fix a memory leak when showing multiple images
+ machinectl image-status container1 container1 container0 container1 container2 container3 container4
=================================================================
==1354==ERROR: LeakSanitizer: detected memory leaks
Direct leak of 4704 byte(s) in 6 object(s) allocated from:
#0 0x7fc3670ba097 in calloc (/lib64/libasan.so.8+0xba097)
#1 0x7fc365e91e8e in message_from_header ../src/libsystemd/sd-bus/bus-message.c:372
#2 0x7fc365e92dfd in bus_message_from_malloc ../src/libsystemd/sd-bus/bus-message.c:421
#3 0x7fc365f089a8 in bus_socket_make_message ../src/libsystemd/sd-bus/bus-socket.c:1165
#4 0x7fc365f0affe in bus_socket_read_message ../src/libsystemd/sd-bus/bus-socket.c:1294
#5 0x7fc365f2db71 in bus_read_message ../src/libsystemd/sd-bus/sd-bus.c:2082
#6 0x7fc365f33352 in sd_bus_call ../src/libsystemd/sd-bus/sd-bus.c:2483
#7 0x7fc365e4da61 in sd_bus_call_methodv ../src/libsystemd/sd-bus/bus-convenience.c:183
#8 0x7fc3658789e8 in bus_call_method ../src/shared/bus-locator.c:109
#9 0x413b76 in show_image ../src/machine/machinectl.c:1014
#10 0x7fc365c5c8cf in dispatch_verb ../src/shared/verbs.c:103
#11 0x42e992 in machinectl_main ../src/machine/machinectl.c:2981
#12 0x42ebbd in run ../src/machine/machinectl.c:3006
#13 0x42ece3 in main ../src/machine/machinectl.c:3009
#14 0x7fc36444a50f in __libc_start_call_main (/lib64/libc.so.6+0x2750f)
Indirect leak of 666 byte(s) in 6 object(s) allocated from:
#0 0x7fc3670b95b5 in __interceptor_realloc.part.0 (/lib64/libasan.so.8+0xb95b5)
#1 0x7fc365f09822 in bus_socket_read_message ../src/libsystemd/sd-bus/bus-socket.c:1214
#2 0x7fc365f2db71 in bus_read_message ../src/libsystemd/sd-bus/sd-bus.c:2082
#3 0x7fc365f33352 in sd_bus_call ../src/libsystemd/sd-bus/sd-bus.c:2483
#4 0x7fc365e4da61 in sd_bus_call_methodv ../src/libsystemd/sd-bus/bus-convenience.c:183
#5 0x7fc3658789e8 in bus_call_method ../src/shared/bus-locator.c:109
#6 0x413b76 in show_image ../src/machine/machinectl.c:1014
#7 0x7fc365c5c8cf in dispatch_verb ../src/shared/verbs.c:103
#8 0x42e992 in machinectl_main ../src/machine/machinectl.c:2981
#9 0x42ebbd in run ../src/machine/machinectl.c:3006
#10 0x42ece3 in main ../src/machine/machinectl.c:3009
#11 0x7fc36444a50f in __libc_start_call_main (/lib64/libc.so.6+0x2750f)
Indirect leak of 12 byte(s) in 6 object(s) allocated from:
#0 0x7fc36707243b in strdup (/lib64/libasan.so.8+0x7243b)
#1 0x7fc365ec1543 in message_parse_fields ../src/libsystemd/sd-bus/bus-message.c:4125
#2 0x7fc365e93586 in bus_message_from_malloc ../src/libsystemd/sd-bus/bus-message.c:443
#3 0x7fc365f089a8 in bus_socket_make_message ../src/libsystemd/sd-bus/bus-socket.c:1165
#4 0x7fc365f0affe in bus_socket_read_message ../src/libsystemd/sd-bus/bus-socket.c:1294
#5 0x7fc365f2db71 in bus_read_message ../src/libsystemd/sd-bus/sd-bus.c:2082
#6 0x7fc365f33352 in sd_bus_call ../src/libsystemd/sd-bus/sd-bus.c:2483
#7 0x7fc365e4da61 in sd_bus_call_methodv ../src/libsystemd/sd-bus/bus-convenience.c:183
#8 0x7fc3658789e8 in bus_call_method ../src/shared/bus-locator.c:109
#9 0x413b76 in show_image ../src/machine/machinectl.c:1014
#10 0x7fc365c5c8cf in dispatch_verb ../src/shared/verbs.c:103
#11 0x42e992 in machinectl_main ../src/machine/machinectl.c:2981
#12 0x42ebbd in run ../src/machine/machinectl.c:3006
#13 0x42ece3 in main ../src/machine/machinectl.c:3009
#14 0x7fc36444a50f in __libc_start_call_main (/lib64/libc.so.6+0x2750f)
SUMMARY: AddressSanitizer: 5382 byte(s) leaked in 18 allocation(s).
Frantisek Sumsal [Fri, 12 May 2023 08:14:06 +0000 (10:14 +0200)]
test: clean up the nspawn tests a bit
Daan De Meyer [Fri, 12 May 2023 15:16:21 +0000 (17:16 +0200)]
repart: Make sure we look up dropin files in the root directory
Daan De Meyer [Fri, 12 May 2023 15:14:46 +0000 (17:14 +0200)]
conf-parser: Add root argument to config_parse_many()
Frantisek Sumsal [Fri, 12 May 2023 08:23:56 +0000 (10:23 +0200)]
core: fix memory leak during deserialization
when activation-details-unit-name is encountered multiple times.
Resolves: #27623
Daan De Meyer [Fri, 12 May 2023 15:16:45 +0000 (17:16 +0200)]
repart: Make sure r is declared last
Daan De Meyer [Fri, 12 May 2023 15:08:28 +0000 (17:08 +0200)]
repart: Read arguments directly instead of passing them in
Daan De Meyer [Tue, 9 May 2023 13:04:56 +0000 (15:04 +0200)]
mkosi: Use zstd compression on non-centos distros
Just because centos doesn't support it doesn't mean we can't use it
on the other distros.
Daan De Meyer [Mon, 8 May 2023 14:04:43 +0000 (16:04 +0200)]
mkosi: Update .gitignore to account for changed output locations
Daan De Meyer [Sat, 6 May 2023 09:36:58 +0000 (11:36 +0200)]
mkosi: Only build initrd if Bootable= is enabled or set to "auto"
With this change, Bootable= can be set to "no" for a faster build
intended for booting in systemd-nspawn but not qemu.
Daan De Meyer [Sat, 6 May 2023 09:50:22 +0000 (11:50 +0200)]
mkosi: Use initrd symlink without format/compression
This way, we can change the compression (and even the output format)
in the future without having to modify the final preset.
Daan De Meyer [Mon, 8 May 2023 14:13:37 +0000 (16:13 +0200)]
mkosi: Update to latest
Mike Yuan [Thu, 11 May 2023 10:55:43 +0000 (18:55 +0800)]
Revert "core/manager: export manager_dbus_is_running" and partially "core: refuse dbus activation if dbus is not running"
This reverts commit
e8863150653931ae2ffc91757623f179ce763628
and partially
53964fd26b4a01191609ffc064aa8ccccd28e377.
Specifically, changes to signal_activation_request()
is not desired.
Mike Yuan [Wed, 10 May 2023 05:54:15 +0000 (13:54 +0800)]
core: only refuse Type=dbus service enqueuing if dbus has stop job
Follow-up for #27579
In #27579 we refused all StartUnit requests for Type=dbus units
if dbus is not running, which means if dbus is manually stopped,
user can't use systemctl to start Type=dbus units again, which
is incorrect.
The only culprit that leads to the cancellation of the whole
transaction mentioned in #26799 is job type conflict on dbus.
So let's relax the restriction and only refuse job enqueuing
if dbus has a stop job.
To summarize, the case we want to avoid is:
1. dbus has a stop job installed
2. StartUnit/ActivationRequest is received
3. Type=dbus service gets started, which has Requires=dbus.socket
4. dbus is pulled in again, resulting in job type conflict
What we can support is:
1. dbus is already stopped
2. StartUnit is received (possibly through systemctl, i.e. on private bus)
3. Type=dbus service gets started, which will wait for dbus to start
4. dbus is started again, thus the job for Type=dbus service
Replaces #27590
Fixes #27588
Daan De Meyer [Mon, 8 May 2023 09:27:31 +0000 (11:27 +0200)]
core: Try to initialize TERM from systemd.tty.term.console as well
We already have the systemd.tty.xxx kernel cmdline arguments for
configuring tty's for services, let's make sure the term cmdline
argument applies to pid1 as well.
Daan De Meyer [Fri, 12 May 2023 06:36:43 +0000 (08:36 +0200)]
Merge pull request #27565 from yuwata/static-destruct
static-destruct: support clearing array on exit
Daan De Meyer [Sun, 7 May 2023 19:39:10 +0000 (21:39 +0200)]
mkfs-util: Add quiet argument to make_filesystem()
We default to quiet operation everywhere except for repart, where
we disable quiet and have the mkfs tools write to stdout.
We also make sure --quiet or equivalent is implemented for all mkfs
tools.
Daan De Meyer [Mon, 8 May 2023 11:48:25 +0000 (13:48 +0200)]
core: Check if any init exists before switching root
If we switch root and can't execute an init program afterwards, we're
completely stuck as we can't go back to the initramfs to start
emergency.service as it will have been completely removed by the switch
root operation.
To prevent leaving users with a completely undebuggable system, let's
at least check before we switch root whether at least one of the init
programs we might want to execute actually exist, and fail early if
none of them exists.
Daan De Meyer [Thu, 11 May 2023 06:47:38 +0000 (08:47 +0200)]
core: Make sure systemctl exit <X> works outside of a container
When running in a VM, we now support propagating the exit status
via a vsock notify socket, so drop the restrictions on propagating
an exit status when not in a container to make sure this works
properly.
Yu Watanabe [Thu, 11 May 2023 19:23:54 +0000 (04:23 +0900)]
Merge pull request #27618 from DaanDeMeyer/fstab-generator
Fstab generator fixes
Yu Watanabe [Thu, 11 May 2023 08:08:27 +0000 (17:08 +0900)]
test-network: add tests for static lease matching with chaddr
Follow-up for
4646cdaa378fa2aab7334a80228d8a94b316763b (#27313).
Yu Watanabe [Thu, 11 May 2023 16:40:32 +0000 (01:40 +0900)]
Merge pull request #27611 from yuwata/core-mount-escape-utf8
core/mount: escape invalid utf8 chars
Daan De Meyer [Wed, 10 May 2023 13:25:34 +0000 (15:25 +0200)]
fstab-generator: Fix log message
Daan De Meyer [Wed, 10 May 2023 08:35:16 +0000 (10:35 +0200)]
fstab-generator: Unset kernel cmdline options if empty value is given
Daan De Meyer [Wed, 10 May 2023 08:34:43 +0000 (10:34 +0200)]
fstab-generator: Take systemd.verity= into account
Disable verity logic if systemd.verity= switch is disabled.
Frantisek Sumsal [Wed, 10 May 2023 09:47:57 +0000 (11:47 +0200)]
cryptenroll: actually allow using multiple "special" strings when wiping
The systemd-cryptenroll man page states:
Takes a comma separated list of numeric slot indexes, or the special
strings ..., or any combination of these strings or numeric
indexes, in which case all slots matching either are wiped.
but we'd allow only one special string at any given time as the value
was not ORed when assigning. So, for example, --wipe=recovery,password
would actually become --wipe=password, etc.
Daan De Meyer [Thu, 11 May 2023 12:04:34 +0000 (14:04 +0200)]
Merge pull request #27610 from DaanDeMeyer/mkosi-trivial
mkosi: Trivial fixes
Yu Watanabe [Thu, 11 May 2023 10:21:57 +0000 (19:21 +0900)]
core/mount: escape invalid UTF8 char in dbus reply
When What= or Options= may contain invalid UTF8 chars.
Replaces
aaf7b0e41105d7b7cf30912cdac32820f011a219 (#27541).
Yu Watanabe [Thu, 11 May 2023 10:13:51 +0000 (19:13 +0900)]
Revert "core/mount: replace invalid UTF-8 code points in "what" and "options""
This reverts commit
aaf7b0e41105d7b7cf30912cdac32820f011a219.
Not only /proc/mountinfo, .mount units not started yet may contain
invalid UTF-8 chars.
Daan De Meyer [Wed, 10 May 2023 16:55:24 +0000 (18:55 +0200)]
mkosi: Install apt in Debian/Ubuntu images
Daan De Meyer [Tue, 9 May 2023 18:53:02 +0000 (20:53 +0200)]
mkosi: Run in debug mode
Let's make sure we log more of what mkosi's doing so we can debug
issues better. Note this also makes mkosi set SYSTEMD_LOG_LEVEL=debug
when running programs so we'll get all the systemd debug logging as
well.
Daan De Meyer [Tue, 9 May 2023 13:02:45 +0000 (15:02 +0200)]
mkosi: Disable pamconfdir
Let's use the distro's pam config instead of installing the systemd one.
Daan De Meyer [Mon, 8 May 2023 14:04:24 +0000 (16:04 +0200)]
mkosi: Add back accidentally removed .gdbinit file
Daan De Meyer [Sun, 7 May 2023 09:40:09 +0000 (11:40 +0200)]
mkosi: Enable systemd-timesyncd by default
Daan De Meyer [Sun, 7 May 2023 09:29:28 +0000 (11:29 +0200)]
mkosi: Disable auditd in the preset instead of masking it
Daan De Meyer [Sun, 7 May 2023 09:24:47 +0000 (11:24 +0200)]
mkosi: Disable dnf-makecache.service by default
Daan De Meyer [Sun, 7 May 2023 09:02:13 +0000 (11:02 +0200)]
mkosi: Make sure we use systemd-networkd-wait-online
Disable the NetworkManager one and pull in the networkd one explicitly.
Daan De Meyer [Sun, 7 May 2023 09:03:29 +0000 (11:03 +0200)]
mkosi: Replace root password setting with a credential
Daan De Meyer [Sat, 6 May 2023 09:42:07 +0000 (11:42 +0200)]
mkosi: Disable create-log-dirs option
We run the build as a regular user and create-log-dirs requires to
run as root so let's disable the option to avoid error noise during
the install phase.
Daan De Meyer [Sat, 6 May 2023 09:36:14 +0000 (11:36 +0200)]
mkosi: Stop creating test users in prepare scripts
This was added for opensuse to make the tests pass but doesn't seem
to be needed anymore after recent changes so let's drop it.
Daan De Meyer [Sat, 6 May 2023 09:35:38 +0000 (11:35 +0200)]
mkosi: Don't run slow tests by default
Instead, allow enabling it via an environment variable and do so
in CI.
Luca Boccassi [Thu, 11 May 2023 09:45:59 +0000 (10:45 +0100)]
Merge pull request #27539 from esposem/ukify_pesign
ukify: support pesign as alternative to sbsign
Yu Watanabe [Thu, 11 May 2023 07:49:40 +0000 (16:49 +0900)]
Merge pull request #27596 from yuwata/drop-pure
drop two more inappropriate _pure_ attributes and several cleanups
Yu Watanabe [Thu, 11 May 2023 07:48:13 +0000 (16:48 +0900)]
Merge pull request #27603 from mrc0mmand/more-test-shenanigans
test: merge PID1-related tests into TEST-07-PID1
dependabot[bot] [Mon, 1 May 2023 19:11:57 +0000 (19:11 +0000)]
build(deps): bump actions/checkout from 3.3.0 to 3.5.2
Bumps [actions/checkout](https://github.com/actions/checkout) from 3.3.0 to 3.5.2.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/
ac593985615ec2ede58e132d2e21d2b1cbd6127c...
8e5e7e5ab8b370d6c329ec480221332ada57f0ab)
---
updated-dependencies:
- dependency-name: actions/checkout
dependency-type: direct:production
update-type: version-update:semver-minor
...
Signed-off-by: dependabot[bot] <support@github.com>
dependabot[bot] [Mon, 1 May 2023 09:57:42 +0000 (09:57 +0000)]
build(deps): bump meson from 1.0.1 to 1.1.0 in /.github/workflows
Bumps [meson](https://github.com/mesonbuild/meson) from 1.0.1 to 1.1.0.
- [Release notes](https://github.com/mesonbuild/meson/releases)
- [Commits](https://github.com/mesonbuild/meson/compare/1.0.1...1.1.0)
---
updated-dependencies:
- dependency-name: meson
dependency-type: direct:production
update-type: version-update:semver-minor
...
Signed-off-by: dependabot[bot] <support@github.com>
dependabot[bot] [Mon, 1 May 2023 09:57:22 +0000 (09:57 +0000)]
build(deps): bump actions/upload-artifact from 3.1.1 to 3.1.2
Bumps [actions/upload-artifact](https://github.com/actions/upload-artifact) from 3.1.1 to 3.1.2.
- [Release notes](https://github.com/actions/upload-artifact/releases)
- [Commits](https://github.com/actions/upload-artifact/compare/v3.1.1...
0b7f8abb1508181956e8e162db84b466c27e18ce)
---
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>
dependabot[bot] [Mon, 1 May 2023 09:57:26 +0000 (09:57 +0000)]
build(deps): bump github/super-linter from 4.10.1 to 5.0.0
Bumps [github/super-linter](https://github.com/github/super-linter) from 4.10.1 to 5.0.0.
- [Release notes](https://github.com/github/super-linter/releases)
- [Changelog](https://github.com/github/super-linter/blob/main/docs/release-process.md)
- [Commits](https://github.com/github/super-linter/compare/
454ba4482ce2cd0c505bc592e83c06e1e37ade61...
45fc0d88288beee4701c62761281edfee85655d7)
---
updated-dependencies:
- dependency-name: github/super-linter
dependency-type: direct:production
update-type: version-update:semver-major
...
Signed-off-by: dependabot[bot] <support@github.com>
dependabot[bot] [Mon, 1 May 2023 09:57:30 +0000 (09:57 +0000)]
build(deps): bump actions/github-script from 6.4.0 to 6.4.1
Bumps [actions/github-script](https://github.com/actions/github-script) from 6.4.0 to 6.4.1.
- [Release notes](https://github.com/actions/github-script/releases)
- [Commits](https://github.com/actions/github-script/compare/
98814c53be79b1d30f795b907e553d8679345975...
d7906e4ad0b1822421a7e6a35d5ca353c962f410)
---
updated-dependencies:
- dependency-name: actions/github-script
dependency-type: direct:production
update-type: version-update:semver-patch
...
Signed-off-by: dependabot[bot] <support@github.com>
Frantisek Sumsal [Wed, 10 May 2023 19:12:01 +0000 (21:12 +0200)]
test: abstract the common test parts into a utility script
Also, instead of bailing out on the first failed subtest, always run all
subtests and print a summary at the end (with an appropriate exit code).
Frantisek Sumsal [Wed, 10 May 2023 18:17:19 +0000 (20:17 +0200)]
test: merge TEST-20-MAINPIDGAMES into TEST-07-PID1
Frantisek Sumsal [Wed, 10 May 2023 12:26:08 +0000 (14:26 +0200)]
test: merge TEST-51-ISSUE-16115 into TEST-07-PID1
Frantisek Sumsal [Wed, 10 May 2023 12:19:40 +0000 (14:19 +0200)]
test: merge TEST-47-ISSUE-14566 into TEST-07-PID1
Frantisek Sumsal [Wed, 10 May 2023 12:02:54 +0000 (14:02 +0200)]
test: move TEST-23's units into a dedicated subfolder
To remain consistent with other tests.
Frantisek Sumsal [Wed, 10 May 2023 11:58:13 +0000 (13:58 +0200)]
test: merge TEST-12-ISSUE-3171 into TEST-07-PID1
Daan De Meyer [Tue, 9 May 2023 11:45:16 +0000 (13:45 +0200)]
tmpfiles: Add merge support for copy files action
If '+' is specified with 'C', let's merge the tree with any existing
tree.
Daan De Meyer [Mon, 8 May 2023 16:44:01 +0000 (18:44 +0200)]
repart: Fix deny list logic
Until now, we always excluded the top level directories that were
covered by child partition mount points, regardless of the source
directory and the target directory of the copy files operation.
This means that even if we were populating a XBOOTLDR partition, if
there was an EFI partition in the image, we'd exclude /boot
unconditionally, leading to the XBOOTLDR partition to be empty.
Also, because of the same cause, if we were copying a nested source
directory (e.g. /abc/def) to the root directory in the root
partition, if /abc/def/usr existed and was populated with files and
directories, the root partition would have those files under /usr,
even if a /usr partition was defined.
To fix these issues, instead of unconditionally excluding the top
level partition mount points under <source>, let's make sure that
when we're copying files from any source directory to the root
directory of a root partition, that we exclude the partition mount
point directories under the source directory instead of the top
level ones.
Emanuele Giuseppe Esposito [Mon, 8 May 2023 12:41:04 +0000 (08:41 -0400)]
src/ukify/test/test_ukify: fix skipped tests
Some tests are skipped because initrd extracted from bootctl
is "/boot/initramfs-5.14.0-284.el9.x86_64.img $tuned_initrd"
and not just "/boot/initramfs-5.14.0-284.el9.x86_64.img".
Therefore split and remove the additional garbage.
Signed-off-by: Emanuele Giuseppe Esposito <eesposit@redhat.com>
Emanuele Giuseppe Esposito [Mon, 8 May 2023 12:23:11 +0000 (08:23 -0400)]
src/ukify/test/test_ukify: add pesign unit test
Signed-off-by: Emanuele Giuseppe Esposito <eesposit@redhat.com>
Emanuele Giuseppe Esposito [Thu, 4 May 2023 15:48:47 +0000 (11:48 -0400)]
ukify: support pesign as alternative to sbsign
sbsign is not available everywhere, for example RHEL does not have it.
Add pesign as alternative to it.
pesign will use options "--secureboot-certificate-name" (mandatory) and
"--secureboot-certificate-dir" (optional), while sbsign will use
"--secureboot-private-key" and "--secureboot-certificate".
By default, use sbsign. If no key/cert is provided or sbsign is not found,
try pesign.
Signed-off-by: Emanuele Giuseppe Esposito <eesposit@redhat.com>
Emanuele Giuseppe Esposito [Fri, 5 May 2023 10:22:57 +0000 (06:22 -0400)]
ukify: typo in doc and print when package is missing
If a package is missing, a subprocess is started with None as
command argument. Error raised by subprocess is therefore not helpful
at all to understand what needs to be done to fix that error.
Also fix doc since systemd-stub will look for .cmdline files, and not
.cmdline.efi files.
Signed-off-by: Emanuele Giuseppe Esposito <eesposit@redhat.com>
Frantisek Sumsal [Wed, 10 May 2023 11:49:34 +0000 (13:49 +0200)]
test: merge TEST-11-ISSUE-3166 into TEST-07-PID1
Frantisek Sumsal [Wed, 10 May 2023 11:41:03 +0000 (13:41 +0200)]
test: merge TEST-10-ISSUE-2467 with TEST-07-PID1
Frantisek Sumsal [Wed, 10 May 2023 11:13:12 +0000 (13:13 +0200)]
test: merge TEST-09-ISSUE-2691 into TEST-07-PID1
Frantisek Sumsal [Wed, 10 May 2023 11:07:26 +0000 (13:07 +0200)]
test: merge TEST-08-ISSUE-2730 into TEST-07-PID1
Yu Watanabe [Wed, 10 May 2023 06:47:44 +0000 (15:47 +0900)]
udev: do not set ID_PATH and by-path symlink for nvmf disks
Prompted by #27391.
Frantisek Sumsal [Wed, 10 May 2023 10:38:57 +0000 (12:38 +0200)]
test: rename TEST-07-ISSUE-1981 to TEST-07-PID1
Yu Watanabe [Tue, 9 May 2023 18:33:46 +0000 (03:33 +0900)]
core: replace hashmap_get() with hashmap_contains() where appropriate
Yu Watanabe [Tue, 9 May 2023 18:31:11 +0000 (03:31 +0900)]
core: drop unused argument
Yu Watanabe [Tue, 9 May 2023 18:25:37 +0000 (03:25 +0900)]
core: several cleanups for job_get_timeout()
- add missing assertion,
- rename the argument for storing result,
- always initialize result on success.
Yu Watanabe [Tue, 9 May 2023 18:22:16 +0000 (03:22 +0900)]
tree-wide: drop _pure_ attribute from non-pure functions
Prompted by #27595.
Follow-ups for
6723c28f36ea566faf61d3610012cd89f95ee4a0.
Sam James [Wed, 10 May 2023 00:47:13 +0000 (01:47 +0100)]
dirent: conditionalize dirent assert based on dirent64 existence
>=musl-1.2.4 doesn't define dirent64 and its LFS friends as its "native"
functions are already LFS-aware.
Check for dirent64 in meson.build and only assert if it exists.
Bug: https://bugs.gentoo.org/905900
Closes: https://github.com/systemd/systemd/pull/25809
Mike Yuan [Tue, 9 May 2023 16:15:14 +0000 (00:15 +0800)]
network/tc: rename settings in log messages too
Follow-up for
c03ef420fa7157b8d4881636fe72596a06e08bb6
Xi Ruoyao [Tue, 9 May 2023 17:41:28 +0000 (01:41 +0800)]
sd-bus: bus_message_type_from_string is not pure
GCC document [1] says:
The pure attribute prohibits a function from modifying the state
of the program that is observable by means other than inspecting
the function’s return value.
And there is an example:
`int hash (char *) __attribute__ ((pure));`
... Even though hash takes a non-const pointer argument it must
not modify the array it points to, ...
But we are modifying the object pointed to by the pointer u, which is
clearly a violation of the semantic of pure.
With -ftrivial-auto-var-init (enabled by -Dmode=release), on some
targets (GCC 12.2 on AArch64 and GCC 13.1 on x86_64) performs an
optimization: as the variable "u" in bus_match_parse has been
zero-initialized (by the -ftrivial-auto-var-init option) and never
modified (because a "pure" bus_message_type_from_string is not allowed
to modify it), "u" will be always 0.
Then 0 is used to initialize .value_u8 field of struct
bus_match_component. This then causes a infinite event loop, so
"systemctl restart" never stops, and pam_systemd timeouts communicating
with logind, etc.
So we should remove the "pure" attribute here.
Fixes #26395.
[1]:https://gcc.gnu.org/onlinedocs/gcc/Common-Function-Attributes.html#index-pure-function-attribute
Yu Watanabe [Tue, 9 May 2023 23:16:29 +0000 (08:16 +0900)]
Merge pull request #27597 from mrc0mmand/more-test-shenanigans
test: slightly extend systemd-cryptenroll coverage
Michal Sekletar [Fri, 5 May 2023 10:50:15 +0000 (12:50 +0200)]
core/mount: replace invalid UTF-8 code points in "what" and "options"
Previously, these strings were copied w/o any modification. However, if
mount table contained e.g. remote fs mount like NFS or CIFS that was
mounted from server running with non UTF-8 locale then those strings
might have contained some non UTF-8 characters.
If then client asked about status of such mount unit we tried to forward
these non UTF-8 strings over D-Bus. That is the violation of the
protocol and we ended up kicked from the bus.
Frantisek Sumsal [Tue, 9 May 2023 20:47:42 +0000 (22:47 +0200)]
test: slightly extend systemd-cryptenroll coverage
Frantisek Sumsal [Tue, 9 May 2023 20:17:15 +0000 (22:17 +0200)]
cryptenroll: fix an assertion with weak passwords
Passing 0 to log_xxx_errno() leads to an assertion, so let's not do that:
$ NEWPASSWORD="" build-san/systemd-cryptenroll --unlock-key-file=/tmp/password --password "$img"
/tmp/password has 0644 mode that is too permissive, please adjust the ownership and access mode.
Assertion '(_error) != 0' failed at src/cryptenroll/cryptenroll-password.c:164, function enroll_password(). Aborting.
Aborted (core dumped)
Frantisek Sumsal [Tue, 9 May 2023 19:14:24 +0000 (21:14 +0200)]
test: TEST-70-TPM2 cleanup
No functional changes.
Frantisek Sumsal [Tue, 9 May 2023 17:59:13 +0000 (19:59 +0200)]
test: add coverage for #27533
Issue: https://github.com/systemd/systemd/issues/27533
Fix: https://github.com/systemd/systemd/pull/27553
Frantisek Sumsal [Tue, 9 May 2023 17:55:04 +0000 (19:55 +0200)]
test: discard kill's output