Commit graph

64469 commits

Author SHA1 Message Date
Daan De Meyer b959570012 mkosi: Make sure we use systemd-networkd-wait-online
Disable the NetworkManager one and pull in the networkd one explicitly.
2023-05-11 12:18:50 +02:00
Daan De Meyer 4decc7a514 mkosi: Replace root password setting with a credential 2023-05-11 12:18:50 +02:00
Daan De Meyer db7a46ed5f 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.
2023-05-11 12:16:47 +02:00
Daan De Meyer 3e9dd3cde0 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.
2023-05-11 12:16:47 +02:00
Daan De Meyer 4bfcb6ba27 mkosi: Don't run slow tests by default
Instead, allow enabling it via an environment variable and do so
in CI.
2023-05-11 12:16:47 +02:00
Luca Boccassi fcb4ba6c14
Merge pull request #27539 from esposem/ukify_pesign
ukify: support pesign as alternative to sbsign
2023-05-11 10:45:59 +01:00
Yu Watanabe d698679112
Merge pull request #27596 from yuwata/drop-pure
drop two more inappropriate _pure_ attributes and several cleanups
2023-05-11 16:49:40 +09:00
Yu Watanabe 531a6233d1
Merge pull request #27603 from mrc0mmand/more-test-shenanigans
test: merge PID1-related tests into TEST-07-PID1
2023-05-11 16:48:13 +09:00
dependabot[bot] 43a221473c 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](ac59398561...8e5e7e5ab8)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-05-11 09:34:08 +02:00
dependabot[bot] 93b2175a87 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>
2023-05-11 09:33:21 +02:00
dependabot[bot] c07aa178b3 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>
2023-05-11 09:31:55 +02:00
dependabot[bot] 6a3ba07bfb 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](454ba4482c...45fc0d8828)

---
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>
2023-05-11 09:31:22 +02:00
dependabot[bot] 882235d581 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](98814c53be...d7906e4ad0)

---
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>
2023-05-11 09:30:48 +02:00
Frantisek Sumsal 15bbc0c107 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).
2023-05-10 21:26:26 +02:00
Frantisek Sumsal 3a4b86264e test: merge TEST-20-MAINPIDGAMES into TEST-07-PID1 2023-05-10 21:26:26 +02:00
Frantisek Sumsal d8d8380a35 test: merge TEST-51-ISSUE-16115 into TEST-07-PID1 2023-05-10 21:26:26 +02:00
Frantisek Sumsal 11562ee585 test: merge TEST-47-ISSUE-14566 into TEST-07-PID1 2023-05-10 21:26:26 +02:00
Frantisek Sumsal 8412cdf4fd test: move TEST-23's units into a dedicated subfolder
To remain consistent with other tests.
2023-05-10 21:26:26 +02:00
Frantisek Sumsal 51b6dbf75a test: merge TEST-12-ISSUE-3171 into TEST-07-PID1 2023-05-10 21:26:26 +02:00
Daan De Meyer 1fd5ec5697 tmpfiles: Add merge support for copy files action
If '+' is specified with 'C', let's merge the tree with any existing
tree.
2023-05-10 18:08:07 +02:00
Daan De Meyer e57b7020d2 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.
2023-05-10 18:07:47 +02:00
Emanuele Giuseppe Esposito 4e906270a3 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>
2023-05-10 09:20:46 -04:00
Emanuele Giuseppe Esposito ff5618c7c0 src/ukify/test/test_ukify: add pesign unit test
Signed-off-by: Emanuele Giuseppe Esposito <eesposit@redhat.com>
2023-05-10 09:20:46 -04:00
Emanuele Giuseppe Esposito c1e8d1727b 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>
2023-05-10 09:18:27 -04:00
Emanuele Giuseppe Esposito e673c5c2d9 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>
2023-05-10 09:18:25 -04:00
Frantisek Sumsal 33dff897b9 test: merge TEST-11-ISSUE-3166 into TEST-07-PID1 2023-05-10 14:29:38 +02:00
Frantisek Sumsal a8faac7dae test: merge TEST-10-ISSUE-2467 with TEST-07-PID1 2023-05-10 14:29:38 +02:00
Frantisek Sumsal 4966a31ba3 test: merge TEST-09-ISSUE-2691 into TEST-07-PID1 2023-05-10 14:29:38 +02:00
Frantisek Sumsal cd62ba42a4 test: merge TEST-08-ISSUE-2730 into TEST-07-PID1 2023-05-10 14:29:38 +02:00
Yu Watanabe 39a39f18f2 udev: do not set ID_PATH and by-path symlink for nvmf disks
Prompted by #27391.
2023-05-10 19:42:49 +08:00
Frantisek Sumsal 09c033a276 test: rename TEST-07-ISSUE-1981 to TEST-07-PID1 2023-05-10 12:38:57 +02:00
Yu Watanabe 6112c86139 core: replace hashmap_get() with hashmap_contains() where appropriate 2023-05-10 15:06:44 +09:00
Yu Watanabe 735f0645db core: drop unused argument 2023-05-10 15:06:39 +09:00
Yu Watanabe fcd7e0b7ed core: several cleanups for job_get_timeout()
- add missing assertion,
- rename the argument for storing result,
- always initialize result on success.
2023-05-10 15:06:39 +09:00
Yu Watanabe bc52801034 tree-wide: drop _pure_ attribute from non-pure functions
Prompted by #27595.
Follow-ups for 6723c28f36.
2023-05-10 15:06:24 +09:00
Sam James eb29296937 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
2023-05-10 15:05:18 +09:00
Mike Yuan 8707dcdf3b network/tc: rename settings in log messages too
Follow-up for c03ef420fa
2023-05-10 14:21:28 +09:00
Xi Ruoyao 6723c28f36 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
2023-05-10 14:21:01 +09:00
Yu Watanabe 18449960b9
Merge pull request #27597 from mrc0mmand/more-test-shenanigans
test: slightly extend systemd-cryptenroll coverage
2023-05-10 08:16:29 +09:00
Michal Sekletar aaf7b0e411 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.
2023-05-10 00:01:32 +01:00
Frantisek Sumsal a9fe7f66e8 test: slightly extend systemd-cryptenroll coverage 2023-05-09 22:47:42 +02:00
Frantisek Sumsal 0e43ab6d24 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)
2023-05-09 22:17:15 +02:00
Frantisek Sumsal 920eb35db9 test: TEST-70-TPM2 cleanup
No functional changes.
2023-05-09 21:18:36 +02:00
Frantisek Sumsal b6869359e6 test: add coverage for #27533
Issue: https://github.com/systemd/systemd/issues/27533
Fix: https://github.com/systemd/systemd/pull/27553
2023-05-09 19:59:13 +02:00
Frantisek Sumsal 5e8656e101 test: discard kill's output 2023-05-09 19:55:04 +02:00
Frantisek Sumsal 539af5c441 test: merge unit file related tests into TEST-23-UNIT-FILE
Rename TEST-23-TYPE-EXEC to TEST-23-UNIT-FILE and merge it with
following tests:
  - TEST-37-RUNTIMEDIRECTORYPRESERV
  - TEST-40-EXEC-COMMAND-EX
  - TEST-41-ONESHOT-RESTART
  - TEST-42-EXECSTOPPOST
  - TEST-57-ONSUCCESS-UPHOLD
2023-05-10 02:39:12 +09:00
Daan De Meyer 97211510b0 units: Add CAP_NET_ADMIN condition to systemd-networkd-wait-online@.service as well
It was added to CAP_NET_ADMIN but we forgot to add it to the template
service as well.
2023-05-09 17:59:55 +02:00
Yu Watanabe 251ca88230 sd-dhcp-client: client ID always has non-zero data
Follow-up for f04c991a2f.
Fixes CID#1510978.
2023-05-09 14:41:55 +01:00
Yu Watanabe c093bfe0ad
Merge pull request #27534 from keszybz/deperlify
Rewrite udev-test.pl in Python
2023-05-09 18:06:51 +09:00
Zbigniew Jędrzejewski-Szmek 98e2089f1b mkosi,ci: do not install perl 2023-05-09 08:11:10 +02:00