Commit Graph

64494 Commits

Author SHA1 Message Date
Daan De Meyer
153d5dfd87 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.
2023-05-12 08:38:20 +02:00
Daan De Meyer
32b0be0eb8 Merge pull request #27565 from yuwata/static-destruct
static-destruct: support clearing array on exit
2023-05-12 08:36:43 +02:00
Daan De Meyer
2bc161dddb 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.
2023-05-12 07:51:50 +02:00
Daan De Meyer
aaa27e2e21 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.
2023-05-12 07:48:50 +02:00
Daan De Meyer
3f92250f4c 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.
2023-05-12 07:48:29 +02:00
Yu Watanabe
f466e828db Merge pull request #27618 from DaanDeMeyer/fstab-generator
Fstab generator fixes
2023-05-12 04:23:54 +09:00
Yu Watanabe
82c60c939c test-network: add tests for static lease matching with chaddr
Follow-up for 4646cdaa37 (#27313).
2023-05-12 03:07:10 +09:00
Yu Watanabe
db4afb95c2 Merge pull request #27611 from yuwata/core-mount-escape-utf8
core/mount: escape invalid utf8 chars
2023-05-12 01:40:32 +09:00
Daan De Meyer
32fe629abc fstab-generator: Fix log message 2023-05-11 14:44:16 +02:00
Daan De Meyer
338da50141 fstab-generator: Unset kernel cmdline options if empty value is given 2023-05-11 14:44:16 +02:00
Daan De Meyer
200268c6db fstab-generator: Take systemd.verity= into account
Disable verity logic if systemd.verity= switch is disabled.
2023-05-11 14:44:14 +02:00
Frantisek Sumsal
b0582f6b63 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.
2023-05-11 13:12:08 +01:00
Daan De Meyer
885b5cabe2 Merge pull request #27610 from DaanDeMeyer/mkosi-trivial
mkosi: Trivial fixes
2023-05-11 14:04:34 +02:00
Yu Watanabe
4804da5853 core/mount: escape invalid UTF8 char in dbus reply
When What= or Options= may contain invalid UTF8 chars.

Replaces aaf7b0e411 (#27541).
2023-05-11 19:25:38 +09:00
Yu Watanabe
bcf58ff559 Revert "core/mount: replace invalid UTF-8 code points in "what" and "options""
This reverts commit aaf7b0e411.

Not only /proc/mountinfo, .mount units not started yet may contain
invalid UTF-8 chars.
2023-05-11 19:24:42 +09:00
Daan De Meyer
1d07c3de79 mkosi: Install apt in Debian/Ubuntu images 2023-05-11 12:18:50 +02:00
Daan De Meyer
93a948865c 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.
2023-05-11 12:18:50 +02:00
Daan De Meyer
fef33f9498 mkosi: Disable pamconfdir
Let's use the distro's pam config instead of installing the systemd one.
2023-05-11 12:18:50 +02:00
Daan De Meyer
b811b9addf mkosi: Add back accidentally removed .gdbinit file 2023-05-11 12:18:50 +02:00
Daan De Meyer
94fe8c87c7 mkosi: Enable systemd-timesyncd by default 2023-05-11 12:18:50 +02:00
Daan De Meyer
949e1fdd52 mkosi: Disable auditd in the preset instead of masking it 2023-05-11 12:18:50 +02:00
Daan De Meyer
4f7582bc0b mkosi: Disable dnf-makecache.service by default 2023-05-11 12:18:50 +02:00
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