1
0
mirror of https://github.com/systemd/systemd.git synced 2024-10-27 18:55:40 +03:00
Commit Graph

73 Commits

Author SHA1 Message Date
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
James Hilliard
e4086f7dc9 bpf: test with GCC BPF compiler on opensuse 2023-05-30 13:30:28 +09:00
Luca Boccassi
05c9f9c251 stub: allow loading and verifying cmdline addons
Files placed in /EFI/Linux/UKI.efi.extra.d/ and /loader/addons/ are
opened and verified using the LoadImage protocol, and will thus get
verified via shim/firmware.
If they are valid signed PE files, the .cmdline section will be
extracted and appended. If there are multiple addons in each directory,
they will be parsed in alphanumerical order.

Optionally the .uname sections are also matched if present, so
that they can be used to filter out addons as well if needed, and only
addons that correspond exactly to the UKI being loaded are used.
It is recommended to also always add a .sbat section to addons, so
that they can be mass-revoked with just a policy update.

The files must have a .addon.efi suffix.

Files in the per-UKI directory are parsed, sorted, measured and
appended first. Then, files in the generic directory are processed.
2023-05-24 15:02:36 +01:00
Daan De Meyer
139b6fb16f mkosi: Make sure persistent journal storage is enabled
We ship with empty /var, so /var/log/journal does not exist, which
means journald does not do persistent logging. Let's fix that by
setting the config to explicitly enable persistent logging.
2023-05-22 22:19:41 +02:00
Zbigniew Jędrzejewski-Szmek
fbecfbe224 mkosi: use wildcard to shorten things 2023-05-18 15:23:27 +02:00
Daan De Meyer
1fb59099f6 mkosi: Drop squashfs dropin
This accidentally got pulled into a commit even though it was only
for local testing, let's drop it again so we correctly use erofs
when building local images.
2023-05-15 15:41:53 +02:00
Daan De Meyer
3dca0b3661 mkosi: Install tmux in the final image
We currently have to resort to SSH to get more than one interactive
terminal in a mkosi qemu VM. Let's increase our options by installing
tmux in the final image, which can multiplex the serial console into
many unique terminal sessions.
2023-05-15 11:45:58 +01:00
Daan De Meyer
47e5e12866 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.
2023-05-13 10:49:17 +02:00
Daan De Meyer
724683c27f 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.
2023-05-13 09:17:15 +02:00
Daan De Meyer
104afc7300 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.
2023-05-12 11:38:02 +02:00