From a940484ee53152cc7d401e635267571a114319a4 Mon Sep 17 00:00:00 2001 From: Daan De Meyer Date: Sat, 9 Sep 2023 10:20:01 +0200 Subject: [PATCH] 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. --- mkosi.conf.d/10-systemd.conf | 3 +++ mkosi.presets/initrd/mkosi.conf | 4 ---- mkosi.presets/system/mkosi.conf | 2 -- mkosi.presets/system/mkosi.conf.d/05-initrd.conf | 11 +++++++++++ 4 files changed, 14 insertions(+), 6 deletions(-) create mode 100644 mkosi.presets/system/mkosi.conf.d/05-initrd.conf diff --git a/mkosi.conf.d/10-systemd.conf b/mkosi.conf.d/10-systemd.conf index f25d53d2b76..adb46e488d3 100644 --- a/mkosi.conf.d/10-systemd.conf +++ b/mkosi.conf.d/10-systemd.conf @@ -1,5 +1,8 @@ # SPDX-License-Identifier: LGPL-2.1-or-later +[Preset] +Presets=system + [Output] OutputDirectory=mkosi.output BuildDirectory=mkosi.builddir diff --git a/mkosi.presets/initrd/mkosi.conf b/mkosi.presets/initrd/mkosi.conf index 5d347b71d81..0ef3a7bd4ad 100644 --- a/mkosi.presets/initrd/mkosi.conf +++ b/mkosi.presets/initrd/mkosi.conf @@ -1,9 +1,5 @@ # SPDX-License-Identifier: LGPL-2.1-or-later -[Match] -Bootable=|auto -Bootable=|yes - [Preset] Dependencies=base diff --git a/mkosi.presets/system/mkosi.conf b/mkosi.presets/system/mkosi.conf index 58cd4939427..aaf05364f8f 100644 --- a/mkosi.presets/system/mkosi.conf +++ b/mkosi.presets/system/mkosi.conf @@ -2,14 +2,12 @@ [Preset] Dependencies=base - initrd [Content] Autologin=yes BaseTrees=../../mkosi.output/base ExtraTrees=../../mkosi.output/base-systemd ExtraTrees=../../src:/usr/src/src -Initrds=../../mkosi.output/initrd Packages= acl bash-completion diff --git a/mkosi.presets/system/mkosi.conf.d/05-initrd.conf b/mkosi.presets/system/mkosi.conf.d/05-initrd.conf new file mode 100644 index 00000000000..e5dedafdc34 --- /dev/null +++ b/mkosi.presets/system/mkosi.conf.d/05-initrd.conf @@ -0,0 +1,11 @@ +# SPDX-License-Identifier: LGPL-2.1-or-later + +[Match] +Bootable=!no +Format=disk + +[Preset] +Dependencies=initrd + +[Content] +Initrds=../../mkosi.output/initrd