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

84 Commits

Author SHA1 Message Date
Daan De Meyer
74f2a3ae0d mkosi: Make sure we always boot our built from source kernel
If we build a kernel from source, let's make sure it's always booted
by giving it a very high version number.
2023-04-05 16:20:28 +02:00
Daan De Meyer
9f94d2741f mkosi: Use default timeout of 10s
Let's override the default timeout to something more reasonable for
mkosi builds.
2023-03-16 18:19:37 +01:00
Jan Janssen
dfca5587cf tree-wide: Drop gnu-efi
This drops all mentions of gnu-efi and its manual build machinery. A
future commit will bring bootloader builds back. A new bootloader meson
option is now used to control whether to build sd-boot and its userspace
tooling.
2023-03-10 11:41:03 +01:00
Daan De Meyer
d2a0ca2440 mkosi: Simplify BUILDDIR/SRCDIR handling a bit 2023-02-21 15:20:20 +01:00
Daan De Meyer
01a0756427 mkosi: Move more logic to the postinst script
Let's move stuff that only applies to the final image to the
postinst script. Let's also move out some of the static files to
mkosi.extra/ instead of hardcoding them in scripts.
2023-02-21 15:20:18 +01:00
Daan De Meyer
fff772bee8 mkosi: Remove preset workaround
A "disable *" preset is already shipped on debian so no need to add
one ourselves.
2023-02-21 14:57:29 +01:00
Daan De Meyer
a1cfe39000 mkosi: Use 4 space indentation for scripts
mkosi scripts are shell scripts and for shell scripts we use 4 space
indentation.
2023-02-21 14:22:52 +01:00
Daan De Meyer
046607bb5f mkosi: Drop locale workaround
mkosi will always run all commands with the C.UTF-8 locale so we
don't need a workaround in the build script anymore.
2023-02-21 13:01:30 +01:00
Daan De Meyer
f88f720a8b mkosi: Drop ld workaround
Build scripts will always run in an environment with /etc/ available
now, so we don't need this workaround anymore.
2023-02-21 13:01:30 +01:00
Luca Boccassi
bbb40c4e6f mkosi: configure multiarch libdir in debian/ubuntu builds
Debian/Ubuntu use /usr/lib/<triplet> instead of /usr/lib64, so configure it
accordingly. This is especially important for cryptsetup token plugins,
as cryptsetup comes from the distro and is configured to look into those
directories.
2023-02-16 11:30:32 +01:00
Daan De Meyer
1d362bdf0f mkosi: Stop installing kernel headers to /usr
The selftests automatically pick up the headers from the kernel
build directory so we don't have to install them to /usr ourselves.
2023-02-12 18:41:27 +01:00
Daan De Meyer
c9853672a0 mkosi: Update to latest
Let's make sure we're testing unprivileged builds properly. Usage
of SourceFileTransfer= and SourceFileTransferFinal= are removed as
they were dropped by mkosi. SourceFileTransfer=mount is now the
default in mkosi so behavior for the build script is unchanged. We
stop copying sources in the final image until mkosi adds support
for virtiofs.
2023-02-10 18:16:54 +09:00
Daan De Meyer
fc4b61d0b9 mkosi: Drop focal workaround in build script
Now that jammy is the latest LTS, lets drop the focal workaround
from the build script.
2023-01-29 17:05:23 +01:00
Daan De Meyer
84a4af2c81 mkosi: Don't modify rootfs in build script
When unprivileged mkosi becomes available, builds will be executed
as an unprivileged user, so we won't be able to modify the rootfs
anymore. Let's update the build script to account for this.
2023-01-29 17:05:23 +01:00
Daan De Meyer
ac3326dfb8 mkosi: Fix shellcheck warnings 2023-01-29 17:05:04 +01:00
Daan De Meyer
c8943ce884 mkosi: Update and enable ukify in mkosi builds
We also add the necessary deps for ukify to the mkosi configs.

CentOS Stream 8 is dropped from CI because its python version is too
old (3.6) to be able to run ukify.
2023-01-27 15:05:04 +01:00
Daan De Meyer
8c21a0c9ee mkosi: Use meson setup 2023-01-15 20:45:22 +01:00
Daan De Meyer
31aba196ac mkosi: Make sure selftests bpftool is accessible from $PATH 2022-12-05 10:51:24 +01:00
Daan De Meyer
37b56a79dc mkosi: Rework kconfig handling
Instead of relying on the arch specific kconfigs that enable all
kinds of options that are irrelevant for our use case, let's beef
up our own config a little so that we don't need to rely on the
arch specific configs anymore.

Also, instead of using scripts/config to enable options in the
mkosi build script, let's add a new kernel.config file that includes
all the configs we want enabled/disabled.

Finally, let's make sure we can properly run the bpf selftests by
making sure we enable all the right configs required to run the bpf
selftests successfully. We use the scripts/kconfig/merge_config.sh
script to merge the three different config files together.
2022-12-05 10:51:22 +01:00
Frantisek Sumsal
09cd639a59
Merge pull request #25327 from keszybz/mkosi-less-work
Skip mkosi runs on docs-only changes and some small cleanups
2022-11-14 11:44:16 +00:00
Luca Boccassi
a460debc8e README: note Kconfig for verifying DDIs via MoK keys
Also note them in the mkosi.build kernel config list
2022-11-14 11:09:36 +00:00
Zbigniew Jędrzejewski-Szmek
f7ad96506e mkosi: drop spaces after shell redirection operator 2022-11-14 11:59:30 +01:00
Daan De Meyer
6c2ff4a050 mkosi: Build and install kernel selftests 2022-11-08 16:24:21 +01:00
Daan De Meyer
6afeac1dd6 mkosi: Make sure bpf-framework works on CentOS Stream 8 as well 2022-10-17 08:45:48 +02:00
Daan De Meyer
3632e90c85 mkosi: Reenable bpf-framework
This got changed by mistake by #24511. Since we still support the
same libbpf version, we can keep this enabled everywhere.
2022-10-17 08:45:16 +02:00
Daan De Meyer
beead603c5
Merge pull request #24629 from DaanDeMeyer/mkosi-kernel
mkosi: Optionally build a kernel image from mkosi.kernel/
2022-10-11 14:37:19 +02:00
Daan De Meyer
e2490f7384 Bump libbpf version to 0.7
We already depend on the skeleton APIs introduced in libbpf 0.7 so
let's bump our minimum version to reflect that.

We don't enforce bpf compilation on mkosi anymore since not all
distros have sufficiently up-to-date libbpf available.
2022-10-06 07:31:20 +09:00
Daan De Meyer
d12e9bdc76 mkosi: Optionally build a kernel image from mkosi.kernel/
If mkosi.kernel/ exists, the mkosi script will try to build a kernel
image from it. We use the architecture defconfig as a base and add
our own extra configuration on top.

We also add some extra tooling to the build image required to build
the kernel and include some documentation in HACKING.md on how to
use this new feature.

To avoid the kernel sources from being copied into the build or
final image (which we don't want because it takes a while), we put
the mkosi.kernel/ directory in .gitignore and use
"SourceFileTransfer=mount" so that the sources are still accessible
in the build image.
2022-09-29 20:15:57 +02:00
Jan Janssen
de9b57a130 mkosi: Print logs of failing tests 2022-08-25 21:42:57 +01:00
Luca Boccassi
80c2f3e4cf mkosi: use the just built systemd-sysusers instead of groupadd
It disappeared again from SUSE Tumbleweed. Just use sysusers since we
just built it.
2022-08-25 13:52:00 +00:00
Daan De Meyer
37d35150cb mkosi: Ensure we build all features/components in mkosi
Explicitly enable all features/components in the mkosi build to
ensure they all get built and we get an error if they can't be built.

We also rework the packages sections of all mkosi configs to reduce
duplication and cover all the dependencies necessary to build/use all
systemd features.

Note that for the final image, since systemd is installed by default
in base images, we rely on that to install the base library dependencies
and we only list extra optional dependencies and tools that aren't already
installed by default into the base image.

We also drop the centos stream 8 mkosi build as dependencies on that
distro are too out-of-date to be able to build all systemd features.
Since centos stream 9 has been out for a while, let's focus on that
and leave it to downstream to keep systemd building on centos stream 8.

Finally, there's a few additions to the mkosi scripts to make sure
services don't start by default on boot.
2022-08-23 15:19:26 +02:00
Daan De Meyer
819a2502f2 mkosi: Install tests in final image 2022-08-20 23:24:19 +02:00
Daan De Meyer
69d638e67e mkosi: Changes to allow booting with sanitizers in mkosi
- Extra memory because ASAN needs it
- The environment variables to make the sanitizers more useful
- LD_PRELOAD because the ASAN DSO needs to be the first in the list
- The sanitizer library packages
- Disable syscall filters because they interfere with ASAN
- Disable systemd-hwdb-update because it's super slow when systemd-hwdb
  is built with sanitizers
- Take the value for meson's b_sanitize option from the SANITIZERS
  environment variable
2022-07-18 16:54:56 +02:00
Daan De Meyer
2401c9ace6 mkosi: Fix build script indentation 2022-07-18 10:20:48 +02:00
Daan De Meyer
c0daae3ad8 mkosi: Enable meson developer mode 2022-07-18 10:20:48 +02:00
Frantisek Sumsal
24acd4064e ci: check for failed services after boot
This should, hopefully, catch issues like systemd/systemd#21671
automagically.
2021-12-10 10:25:43 +01:00
Daan De Meyer
1b6f9b9880 mkosi: Install sd-boot using postinst script instead of in build script
This allows us to reuse bootctl install instead of replicating the
logic in the build script.
2021-11-25 13:54:03 +01:00
Zbigniew Jędrzejewski-Szmek
8f5bcd615b licensing: add forgotten spdx headers
Those are all "our" files, but we forgot to add the headers,
most likely because of non-standard file extensions.
2021-10-01 14:45:00 +02:00
Daan De Meyer
64782655e1 mkosi: Remove build script umask workaround
A fix for this landed in meson 3 years ago so the workaround in the
build script can now be removed (https://github.com/mesonbuild/meson/pull/3225).
2021-09-28 23:09:11 +09:00
Zbigniew Jędrzejewski-Szmek
068d133881 mkosi: make mkosi.build shellcheck-clean
Also remove the space after redirection operators. (Some redirections
were with, some without, and I think it's nicer without.)
2021-09-03 09:54:43 +02:00
Zbigniew Jędrzejewski-Szmek
fc5f5c2a3c mkosi: drop the code to determine nobody user name
The comments were outdated: at least "nfsnobody" is not used in Fedora since a
few years. So I hope we don't need this anymore. The meson build scripts do
autodetection on their own.
2021-09-03 09:54:42 +02:00
Lennart Poettering
f533cda5a8 mkosi: initialize /usr/lib/os-release' IMAGE_ID + IMAGE_VERSION fields from build
If it's passed into the build, use it, so that the mkosi build version
is propagated into the image itself.
2021-07-03 11:07:00 +01:00
Lennart Poettering
7211773a55 mkosi: work-around to make systemd build in Fedora images that lack populated /etc
On Fedora /usr/bin/ld is a symlink managed via the "alternatives"
system. This unfortunately means the binary is not usable in
environments where /var or /etc are unpopulated. Let's address this by
redirecting "ld" to "ld.bfd" manually if such an environment is
detected, via $PATH.

This is useful for building systemd in mkosi with UsrOnly=1 set.
2021-04-07 17:45:28 +02:00
Daan De Meyer
44bc7f4fcf meson: Fix update-man-rules when the build dir is not a subdir of the project dir
Until now, update-man-rules assumed that the build directory was
a subdirectory of the project directory. When using mkosi, this is
not the case. We use find instead of git ls-files because git ls-files
does not seem to support outputting absolute paths.

Also, this makes update-man-rules a bit more user-friendly as new manpages
don't have to be added to the git staging area before they are processed by
update-man-rules.py.
2021-01-24 17:33:49 +00:00
Daan De Meyer
5a89c7972a mkosi: Pass build script arguments to ninja
mkosi recently gained support to pass arguments to the build script.
Let's take advantage of this in systemd's build script to allow
passing which target to build to ninja in the build script.
2021-01-24 14:13:02 +00:00
Daan De Meyer
ef1bd2349b mkosi: Allow setting version-tag option via VERSION_TAG env variable
With https://github.com/systemd/mkosi/pull/630, we can set environment
variables for the build script in mkosi. Let's modify the build script
so we can set the version-tag option via an environment variable of the
same name. The default is the empty string which causes meson to fall
back to the default behavior (git version).
2021-01-15 21:42:30 +01:00
Daan De Meyer
e2ebc406ac mkosi: Only reset file permissions when $SRCDIR is not a mountpoint
If $SRCDIR is mounted into the build image (via mkosi overrides),
let's not reset the permissions fo the source tree so as to not
modify the original files on the host.
2021-01-14 20:08:20 +01:00
Daan De Meyer
db52af5af5 mkosi: Disable translations
Speeds up incremental builds by half a second. Let's assume translations
won't be necessary in the resulting test images.
2021-01-10 12:44:21 +01:00
Daan De Meyer
1e48ef3f5d mkosi.build: Only create groups if they don't exist yet 2021-01-09 18:06:28 +01:00
Daan De Meyer
c3e2dc71de mkosi.build: Silence "Entering directory" message from ninja
When using `ninja -C "$BUILDDIR"`, ninja prints an annoying log
message about entering the directory that cannot be silenced. Let's
manually move in and out of the build directory instead.
2021-01-09 18:05:57 +01:00