1
0
mirror of https://github.com/systemd/systemd.git synced 2024-12-31 21:18:09 +03:00
Commit Graph

82 Commits

Author SHA1 Message Date
Daan De Meyer
7d376f1dde mkosi: Run meson and ninja as the user invoking mkosi
Latest mkosi sets $MKOSI_UID and $MKOSI_GID to the uid/gid of the
user running mkosi. Let's make use of this to run meson setup and
ninja as the user running mkosi, so that if we execute git as a
subprocess during meson setup, it doesn't complain about unsafe
directories. This also makes sure all the build artifacts are owned
on the host by the user running mkosi.
2023-09-25 11:06:15 +01:00
Daan De Meyer
fc5473b737 mkosi: Don't skip initrd dependency when building a directory image
mkosi now supports booting directory images in qemu using virtiofs.
However, until distribution kernels build the virtiofs driver directly
into the kernel, we need an initrd to make this work, so make sure to
pull in the initrd preset when building a directory image that could be
bootable to make this work.
2023-09-22 13:52:02 +02:00
Daan De Meyer
2a55ebb2e9 mkosi: Stop installing kernel-modules on Fedora
squashfs has been moved to kernel-modules-core so no need to install
kernel-modules anymore on Fedora.
2023-09-19 11:47:57 +02:00
Frantisek Sumsal
5898cef22a Revert "mkosi: pin CentOS9 kernel to working version"
The original issue should be fixed in kernel-5.14.0-362.el9.

This reverts commit b0881b65a6.
2023-09-13 23:22:52 +02:00
Luca Boccassi
3cdf7861a0
Merge pull request #29143 from DaanDeMeyer/mkosi-presets
Various mkosi improvements
2023-09-09 16:38:29 +01:00
Daan De Meyer
a940484ee5 mkosi: Only build system preset by default
Let's not build all presets by default, but only the system preset.
Also, let's only make the system preset depend on the initrd preset
if we're building a bootable disk image. This means that if we build
the system image as a cpio, uki or directory, the initrd preset will
be skipped as it's not necessary, making the build a little faster.
2023-09-09 15:45:49 +02:00
Daan De Meyer
1adae328ed mkosi: Make sure custom installkernel scripts are not used
The kernel has this horrible build system feature where distros
can ship /sbin/installkernel and it'll automatically be used by
make install. Let's make sure that doesn't happen as on Debian this
script puts the kernel under the wrong name causing mkosi build
failures.
2023-09-09 14:35:00 +01:00
Daan De Meyer
1e1441d796 mkosi: Allow configuring whether to do secure boot and pcrs from CLI 2023-09-09 10:42:07 +01:00
Daan De Meyer
1ca30ea8c5 mkosi: Don't build hid selftests
We don't build our kernel with hid support so don't build the selftests
either.
2023-09-06 12:57:57 +02:00
Daan De Meyer
6c22badfce
Merge pull request #29035 from DaanDeMeyer/update-mkosi
mkosi: Update to latest
2023-09-05 16:56:35 +02:00
Daan De Meyer
6217c54560 mkosi: Make sure gzip is installed in initrd/system image
Required by loadkeys but not always a hard dependency so let's install
it explicitly.
2023-09-05 16:56:00 +02:00
Daan De Meyer
35356d7f3f mkosi: Update to latest
Configuration now takes priority over CLI options so we have to
configure the defaults for settings that we want to allow overriding
from the CLI. We also explicitly set some other settings so that they
can't be overridden from the CLI anymore. For example the base and
initrd image should never be made bootable so we set Bootable=no
explicitly for both.
2023-09-05 15:28:23 +02:00
Luca Boccassi
b0881b65a6 mkosi: pin CentOS9 kernel to working version
Newer kernels are affected by a regression that causes a kernel panic
on shutdown, so pin them for now. Can be reverted once that problem is
fixed.

https://bugzilla.redhat.com/show_bug.cgi?id=2234390
2023-08-30 14:11:11 +01:00
Jan Janssen
1e73a64a7a meson: Convert more options to meson features
The semantics for libidn2 and pwquality have changed slightly: We will
pick a preferred one if both are enabled instead of making it an error.
2023-08-23 14:45:02 +02:00
Jan Janssen
847e5585b6 meson: Convert bpf-framework to meson feature 2023-08-23 14:45:02 +02:00
Jan Janssen
40e9c4e45d meson: Convert options to meson features (require)
These options use requre() to conveniently express their dependency
requirements.
2023-08-23 14:45:02 +02:00
Jan Janssen
101b59433b meson: Convert dbus to meson feature
Also, there is no need to conditionalize the get_variable() calls
because not-found dependencies will just return the passed default value
if provided.
2023-08-23 14:45:02 +02:00
Jan Janssen
a0c9ac9ae4 meson: Convert options to meson features (find_library fallback)
This uses a two-step approach to make sure we can fall back to
find_library(), while also skipping the detection if the features are
explicitly disabled.
2023-08-23 14:45:02 +02:00
Jan Janssen
9ee80846f8 meson: Convert fidsk to meson feature
By making this a disabler dependency, we can slightly simplify the code
and it als fixes the build for -Dfdisk=disabled as we failed to create a
fallback empty libshared_fdisk variable.
2023-08-23 14:45:02 +02:00
Jan Janssen
43abc59a27 meson: Use feature options
By using meson features we can replace the handcrafted dependency
auto-detection by just passing the value from get_option directly to the
required arg for dependency, find_library etc.
'auto' features make the dependency optional, 'enabled' requires it
while 'disabled' features will skip detection entirely.

Any skipped or not found dependency will just be a no-op when passed to
build steps and therefore we can also skip the creation of empty vars.

The use of skip_deps for these is dropped here as meson provides a way
to disable all optional features in one go by passing
'-Dauto_features=disabled'.
2023-08-23 14:45:02 +02:00
Daan De Meyer
eeb246920d mkosi: Add a swap partition
systemd-oomd keeps complaining about the lack of swap partition, so
let's add one.
2023-08-16 21:26:07 +02:00
Daan De Meyer
06ba811a76 mkosi: Create a few subvolumes in the root partition
Let's exercise the repart Subvolumes= setting by creating a few
subvolumes in the root partition when we create it.
2023-08-15 12:32:39 +02:00
Michal Koutný
9e42433ff9 mkosi: Copy sources under /usr in the image
Originally, the source code was copied under /root/src.
This home directory is part of root FS and the new mkosi building
paradigm has only ephemeral root FS that is generated lazily.
Any files placed on the root FS in the build environment are that
excluded from the final image.

It is useful to have source codes available in the image's runtime (not
build time) environment for debugging.

ExtraTrees= as used currently are ineffective, so change the destination
to copy files under /usr to achieve the intention.

gdb sees source files as:
> 1354	../src/src/systemctl/systemctl.c: No such file or directory.

Modify gdb configration in the built image accordingly (that file cannot
be in /root neither) to resolve to the moved sources.

(Commit fdecbf7 ("Enable unprivileged image builds") envisions bind
mounting or virtiofsd for nspawn or qemu containers respectively.)
2023-08-10 19:14:40 +01:00
Daan De Meyer
257f2063ec mkosi: Move python3dist(pytest-flakes) to base preset build packages
We don't want to pull in python in the base image to keep the initrd
small.
2023-08-10 14:58:21 +01:00
Daan De Meyer
1f035c91bb mkosi: Update to latest
This update introduces the explicit Dependencies= setting, instead
of relying on implicit dependencies via alphanumerical ordering.

We also take the opportunity to rename the "final" preset to the
"system" preset, which seems like a better name.
2023-08-09 18:56:51 +02:00
Daan De Meyer
b57e752220 mkosi: Unmount /etc/resolv.conf if it's a mountpoint 2023-08-07 20:56:55 +01:00
Daan De Meyer
33772b5da6 mkosi: Use SuccessActionExitStatus= in mkosi-check-and-shutdown.service 2023-08-04 16:49:07 +02:00
Daan De Meyer
6ac5aa97ec mkosi: Make sure our systemd build always overrides the distros
Currently, we install the systemd install tree in the base image and
then build the initrd and final images from the base image. This means
if that any systemd package is pulled in during the initrd or final
image builds, it will override our version.

To fix this, we stop installing our build of systemd in the base image,
and store it in the output directory instead. That allows us to refer to
it using ExtraTrees= in the final and initrd image builds to install it
after all the distro packages have been installed, ensuring our version
always takes priority.
2023-08-04 16:49:07 +02:00
Daan De Meyer
0f4259bcf2 mkosi: Update to latest
We modify all our scripts to execute in the image instead of on the
hosts. In the future we can adapt them to run on the host.
2023-08-03 17:03:05 +02:00
Luca Boccassi
b0d3095fd6 Drop split-usr and unmerged-usr support
As previously announced, execute order 66:

https://lists.freedesktop.org/archives/systemd-devel/2022-September/048352.html

The meson options split-usr, rootlibdir and rootprefix become no-ops
that print a warning if they are set to anything other than the
default values. We can remove them in a future release.
2023-07-28 19:34:03 +01:00
Luca Boccassi
0199f203cb mkosi: install sd-boot on opensuse in base image
Workaround for CI issue, the sd-stub we build is overwritten in the final
image as the package gets pulled there, install it in the base to
work around it for now
2023-07-26 22:02:58 +01:00
Luca Boccassi
febbc24ee0 mkosi: set default-keymap='' on Debian/Ubuntu 2023-07-24 15:43:16 +01:00
Daan De Meyer
3e0718f282 mkosi: Stop using python3.9 on CentOS 8
Let's get rid of all the complexity and just not build ukify on
CentOS Stream 8.
2023-07-14 14:52:08 +02:00
Daan De Meyer
076deab75d mkosi: Make sure we build kernel headers
Required for building kernel selftests
2023-07-12 15:07:15 +01:00
Daan De Meyer
db1264a811 mkosi: Add tpm2-tools to the initrd
To provide tpm2_eventlog for PCR debugging.
2023-07-10 15:50:55 +02:00
Daan De Meyer
6aca147f82 mkosi: Remove explicit /testok check
vsock should work properly after the latest release of mkosi. But
to make sure it works, let's exit with 123 in case of success and
check for that in Github Actions.
2023-06-13 16:04:10 +02:00
Daan De Meyer
63e5ee4096 mkosi: Add bpftool to final image
Useful for debugging bpf.
2023-06-13 15:42:17 +02:00
Daan De Meyer
569bbc1f43 mkosi: Add socat to the final image
Useful for debugging vsock stuff
2023-06-13 15:42:17 +02:00
Daan De Meyer
9f89c2d420 mkosi: Update to latest
mkosi's match syntax was changed so we update our config files to
use the new match syntax which mimicks the systemd condition syntax.
2023-06-07 15:59:03 +02:00
Daan De Meyer
cc532533b8 mkosi: Enable more options
We build with support for selinux/apparmor where applicable but
disable them at runtime as even in permissive mode they're horribly
broken.
2023-06-02 17:25:23 +02:00
Daan De Meyer
a47c48cbb2 mkosi: Only lower device timeout instead of all timeouts
We only really care about lowering the device timeout so we get to
a shell faster when the root device doesn't appear so let's only
lower that timeout instead of lowering all default timeouts.
2023-06-02 15:43:28 +02:00
Daan De Meyer
ee6eedab82 mkosi: Sign expected PCRs
This is now possible without a TMP device so let's start signing
PCRs when building images with mkosi.
2023-06-02 15:43:28 +02:00
Daan De Meyer
e577318ddb mkosi: Remove file blacklisting erofs module in opensuse initrd 2023-06-02 15:43:28 +02:00
Daan De Meyer
2d1d0a6cce mkosi: Enable set -e in postinst script 2023-06-02 15:43:28 +02:00
Daan De Meyer
88f7fb16f2 mkosi: Move python3-pytest-flakes to build packages on opensuse 2023-06-02 15:43:28 +02:00
Daan De Meyer
2ee97f56e1 mkosi: Add missing tss2 dependencies 2023-06-02 15:43:28 +02:00
Daan De Meyer
df4835c897 mkosi: Check for failures by mounting again
We rely on vsock to communicate the exit status back to us from the
VM but vsock in Github Actions is broken so let's switch back to
mounting for now.
2023-05-31 14:22:58 +02:00
Daan De Meyer
84c7929cd4 mkosi: Don't fail on systemd-vconsole-setup.service failure for now
Let's make CI green again and dig into this failure later
2023-05-31 14:22:48 +02:00
Daan De Meyer
e167a8283d mkosi: Disable cmdline addon test for now
This fails but we didn't notice until now because error reporting
from the mkosi VM was broken. Let's disable it for now to get CI
green again.
2023-05-31 14:19:25 +02:00
Daan De Meyer
4dfb458f42 mkosi: Use proper check to detect whether we're in a VM 2023-05-31 14:19:25 +02:00