1
0
mirror of https://github.com/systemd/systemd synced 2024-07-05 17:39:42 +00:00
Commit Graph

81 Commits

Author SHA1 Message Date
Daan De Meyer
6f1f13ca9f mkosi: Enable hyperscale-packages-experimental for CentOS
This gets us a kernel with btrfs support.
2024-06-27 12:50:41 +02:00
Daan De Meyer
8919f86f57 mkosi: Sanitizer improvements
- Let's set the environment on the kernel command line so it applies
to initrd and main system.
- Let's add the necessary wrappers that are also added in test-functions.
Unlike test-functions we don't use gcc/clang to get the library path as
that requires installing gcc/clang in the initrd.
- Let's drop the hack to get journald writing to the console and have
it write to kmsg instead. We'll get the output either way.
- Stop removing libstdc++ and sanitizer libraries from Arch Linux
initrds and other images as it's required by the sanitizer libraries.
- Add a workaround for specifying extra meson options for opensuse
- Add a leak sanitizer suppression file as a workaround for a false
positive leak in verify_selinuxmnt() in libselinux. We do a soname match
because the stacktrace can't be properly symbolized on Debian.
2024-05-31 17:26:13 +02:00
Daan De Meyer
074ac66e88 Revert "mkosi: Sanitizer improvements"
This reverts commit aef13ad029.
2024-05-30 14:50:21 +02:00
Daan De Meyer
aef13ad029 mkosi: Sanitizer improvements
- Let's set the environment on the kernel command line so it applies
to initrd and main system.
- Let's add the necessary wrappers that are also added in test-functions.
Unlike test-functions we don't use gcc/clang to get the library path as
that requires installing gcc/clang in the initrd.
- Let's drop the hack to get journald writing to the console and have
it write to kmsg instead. We'll get the output either way.
- Stop removing libstdc++ and sanitizer libraries from Arch Linux
initrds and other images as it's required by the sanitizer libraries.
- Add a workaround for specifying extra meson options for opensuse
- Add a leak sanitizer suppression file as a workaround for a false
positive leak in verify_selinuxmnt() in libselinux. We do a soname match
because the stacktrace can't be properly symbolized on Debian.
2024-05-30 12:47:45 +02:00
Daan De Meyer
3c367df7c6 mkosi: Switch from btrfs to ext4
Mounting multiple btrfs filesystems with the same fsid only works
properly from kernel 6.7 onwards. Let's switch to ext4 for now which
does support this.
2024-05-29 14:10:50 +02:00
Daan De Meyer
ecf8468dd4 mkosi: Update fedora to latest
We drop the Fedora 40 job as the latest rawhide spec introduced
dependencies that are not available in Fedora 40.
2024-05-14 20:44:39 +02:00
Daan De Meyer
1781de18ab mkosi: Drop usage of updates-testing for Fedora 40
The util-linux update we need has migrated to the stable repositories.
2024-05-09 11:03:39 +02:00
Daan De Meyer
b1670c52ad mkosi: Switch to fedora 40
Enable updates-testing and use the most recent mirror to make sure
we get util-linux 2.40.1 which contains a crucial fix to make sure
the serial terminal in virtual machines works properly.
2024-05-07 11:51:29 +02:00
Daan De Meyer
ffda3c3de9 mkosi: Disable ext4's orphan_file feature for centos images
Not supported by e2fsck from centos. We also disable building repart
from source in CI as running it from the build directory means repart
will run mkfs.ext4 from the host which doesn't know about the orphan_file
feature causing it to fail.
2024-05-06 10:56:45 +02:00
Daan De Meyer
4d0f1451b5 Build distribution packages in mkosi
Instead of running meson install and hoping for the best, let's build
distribution packages from the downstream packaging specs. This gets
us the following:

- Vastly simplified mkosi scripts since we don't need a separate initrd
  image anymore but can just reuse the default mkosi initrd.
- Almost everything can move to the base image as its not the basis
  anymore for the initrd and as such we don't need to care about the
  size anymore.
- The systemd packages that get pulled in as dependencies of other
  packages get properly uninstalled and replaced with our packages that
  we built instead of just installing on top of an existing systemd
  installation with no guarantee that everything from that previous
  installation was removed.
- Much better testing coverage as what we're testing is much closer
  to what will actually be deployed in distributions.
- Immediate feedback if something we change breaks distribution packaging
- We get integration with the distribution for free as we'll automatically
  use the proper directories and such instead of having to hack this
  into a mkosi build script.
- ...
2024-03-07 10:47:19 +01:00
Daan De Meyer
bcb335ac68 Update to mkosi v19
- Use mkosi.images/ instead of mkosi.presets/
- Use the .chroot suffix to run scripts in the image
- Use BuildSources= match for the kernel build
- Move 10-systemd.conf to mkosi.conf and rely on mkosi.local.conf
  for local configuration
2023-11-28 19:54:58 +01:00
Daan De Meyer
74b45fe43f Set default value for tools tree
This allows overriding it from CLI or previous config file if
required.
2023-11-09 12:10:11 +01:00
Daan De Meyer
e94f0af168 Revert "mkosi: Use cache and build subdirectories"
We're not going ahead with the corresponding change in mkosi
after all so revert the preparatory change in systemd as well.

This reverts commit f756bcdf17.
2023-11-06 20:10:34 +01:00
Daan De Meyer
f756bcdf17 mkosi: Use cache and build subdirectories
Next release of mkosi will not use subdirectories under the cache
and build directory by default anymore, so let's make sure we already
start creating those ourselves.
2023-10-28 11:30:18 +01:00
Daan De Meyer
6e24a9dc7f mkosi: Update to latest
We have to set the image runtime size explicitly now so that's it's
grown a bit when we boot in nspawn or qemu.
2023-10-05 16:57:10 +02:00
Daan De Meyer
bcc911a7d7 mkosi: Conditionally use tools tree
If the systemd version on the host is too old and there's no local
build directory, use the default tools tree which will build an
image containing all the tooling required to build systemd and use
that to build the other presets.
2023-09-09 15:53:26 +02: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
076a16dee8 mkosi: Move to Fedora 39 2023-09-09 15:45:48 +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
Daan De Meyer
9f643be929 mkosi: Drop fedora workaround
Seems the key issues got resolved so let's drop the workaround.
2023-08-23 15:10:46 +02:00
Luca Boccassi
f7590e3cb4 mkosi: disable key check on Fedora Rawhide for now
There are key issues so jobs are failing, disable the check for now
2023-08-12 22:58:46 +02:00
Luca Boccassi
2c941b4e07
Merge pull request #28401 from keszybz/set-console-size
Set console size when we reset it
2023-07-14 23:02:41 +01:00
Daan De Meyer
8229217327 mkosi: Move settings to right sections 2023-07-14 14:53:53 +02:00
Daan De Meyer
2defccf3e1 mkosi: Drop kernel command line arguments that are set by mkosi
mkosi sets these by default now so let's drop them from our
configuration.
2023-07-14 14:51:42 +02:00
Daan De Meyer
5b79e9d7a9 mkosi: Update to latest
mkosi now supports CentOS SIGs natively so we drop our own definition
of that and use the mkosi builtin one. We also enable hyperscale for
both CentOS 8 and CentOS 9 for consistency and add epel-next as well
which is a requirement for Hyperscale.
2023-07-14 14:47:45 +02:00
Daan De Meyer
95b8bf9df2 mkosi: Set systemd.early_core_pattern=/core
This makes sure we get pid1 coredumps during early boot.
2023-07-14 09:13:10 +02:00
Daan De Meyer
2fe24cccde mkosi: Enable Incremental= mode by default
Since mkosi is now smart enough to drop the caches when the list of
packages changes, let's enable Incremental= mode by default to ensure
a good experience for anyone new to hacking on systemd with mkosi.
2023-06-29 13:11:39 +01:00
Yu Watanabe
f06390d504 mkosi: install HyperScale repository for CentOS 8
Preparation for bumping meson requirement higher than 0.56.2.
2023-06-16 10:43:06 +09:00
Daan De Meyer
abeecde242 mkosi: Update to latest
We update our configuration to replace the removed
RepositoryDirectories= option with the new PackageManagerTrees=
option.
2023-06-13 16:04:08 +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
fdeed78a71 mkosi: Blacklist vmw_vmci to avoid issues with vsock in Github Actions
If this module is loaded, sending readiness notifications from the
VM will fail with "no route to host" so let's blacklist the module
to prevent that from happening.
2023-05-31 14:19:25 +02:00
Daan De Meyer
78c49d012c mkosi: Always pull in network-online.target
Let's always pull this in so that we always activate
systemd-networkd-wait-online for extra coverage.
2023-05-15 15:41:53 +02: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
79255d86ba mkosi: Do not enable ACL usage by default
This is only useful to be able to remove generated files using rm -rf
instead of mkosi clean and has some implications for the generated
rootfs so let's not enable it by default.
2023-05-13 09:17:15 +02:00
Daan De Meyer
fecbce1fc6 sulogin: Read SYSTEMD_SULOGIN_FORCE from kernel cmdline
This allows setting it on the kernel cmdline and having it work
automatically without having to write any dropins or such.

Also enable the option in mkosi so that we can debug the initrd
properly with a locked root account.
2023-05-13 09:16:55 +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
4decc7a514 mkosi: Replace root password setting with a credential 2023-05-11 12:18:50 +02:00
Daan De Meyer
d052cc8893 mkosi: Switch to use mkosi presets with prebuilt initrds
Instead of building the initrds for the mkosi images with dracut,
let's switch to using mkosi presets to build the initrd with mkosi
as well.

This commit splits up our single image build into three separate
mkosi presets:

1. The "base" preset. This image contains systemd and all its runtime
dependencies. The sole purpose of this image is to serve as a base image
for the initrd and the final image. It's also responsible for building
systemd from source with the build script. The results are installed into
the base image. Note that we install the systemd and udev packages into this
image as well to prevent package managers from overriding the systemd we built
from source with the distro packaged systemd if it's pulled in as a dependency
by another package from the initrd or final profiles.
2. The "initrd" preset. This image provides the initrd. It's trivial and does
nothing more than packaging the base image up as a zstd compressed initramfs and
adds /init and /etc/initrd-release symlinks to the image.
3. The "final" preset. This image builds on top of the base image and adds
a kernel and extra packages that are useful for testing and debugging.

We also split out the optional kernel build into a separate set of config files
that are only included if a kernel to build is actually provided.

Note that this commit doesn't really change anything about how mkosi is used.
The commands remain the same, except that mkosi will now build all the presets
in order. "mkosi summary" will show the summary of all the presets. "mkosi qemu,
boot, shell" will always boot the final preset. With "-f", all presets will be
built and the final one is booted. "-i" makes a cache of each preset.

The only thing to keep in mind is that specifying config via the mkosi CLI will
apply to each of the presets. e.g. any extra packages added with "-p" will be
installed in both the initrd and the final image. To apply local configuration
to a single preset, create a file 00-local.conf in
mkosi.presets/<profile>/mkosi.conf.d and put all the preset specific configuration
in there.
2023-05-01 15:39:50 +02:00
Luca Boccassi
48df882c7f mkosi: add tmpfiles to create debian/ubuntu /etc/default/locale link 2023-04-24 10:47:29 +01:00
Luca Boccassi
0b5382ed03 mkosi: move debian/ubuntu ignore preset to config directory 2023-04-24 10:46:39 +01:00
Luca Boccassi
6f9b70fc69 mkosi: move debian/ubuntu common conf under common directory 2023-04-24 10:44:42 +01:00
Daan De Meyer
f997f91d7d mkosi: Update to latest
Let's use the new support for matching against any distribution in
a list of distributions to start sharing most things between the
ubuntu/debian configs and centos/fedora configs.
2023-04-24 10:56:55 +02:00
Luca Boccassi
2f39220e7c mkosi: remove ?priority(required) from debian pkg list
Requires apt 2.3.10 which is not available in stable, and also doesn't
seem necessary, same packages are installed anyway
Add tzdata manually, as that doesn't seem to be pulled in via the CI.
2023-04-21 13:43:49 +02:00
Daan De Meyer
85003d1296 mkosi: Disable kmsg ratelimiting 2023-04-20 13:43:37 +02:00
Daan De Meyer
6b7e774b5d mkosi: Update to latest 2023-04-19 10:13:06 +02:00
Daan De Meyer
c8ae0a81bf mkosi: Use kernel-core for Fedora and CentOS images
Let's reduce image size by using a smaller kernel package.
2023-04-17 10:50:14 +02:00
Zbigniew Jędrzejewski-Szmek
4518126807 mkosi: default to Fedora 38
It'll be out this week. We can't update the man pages before it is realeased,
but we can use it for mkosi builds and do some very late testing.

Also, use filepath specification for /bin/pkg-config. We need it for meson, and
meson calls it directly by this path. pkgconfig is a virtual Provides on
pkgconf-pkg-config, and the indirection here just obfuscates things with no
benefit.

Add it explicitly for centos too. (I think it is pulled in by packages which
contain pkg-config modules anyway, but it's better to be explicit).
2023-04-16 15:22:54 +02:00