From aa72f856a14dc6afcb70661114b264b21b2fa2fd Mon Sep 17 00:00:00 2001 From: Daan De Meyer Date: Sat, 9 Sep 2023 15:45:41 +0200 Subject: [PATCH 1/4] mkosi: Update to latest --- .github/workflows/mkosi.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/mkosi.yml b/.github/workflows/mkosi.yml index 7b9ad6a67f..d46b7d1782 100644 --- a/.github/workflows/mkosi.yml +++ b/.github/workflows/mkosi.yml @@ -76,7 +76,7 @@ jobs: steps: - uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 - - uses: systemd/mkosi@cb5974d013f7c4c2a45f67c9ae990767e32e9034 + - uses: systemd/mkosi@adaa41512aa30c952daae5ba0abcf2622d66b93b - name: Configure run: | From 076a16dee8a7851468dd9edd99d3c0ea5fb92f87 Mon Sep 17 00:00:00 2001 From: Daan De Meyer Date: Fri, 8 Sep 2023 22:04:28 +0200 Subject: [PATCH 2/4] mkosi: Move to Fedora 39 --- mkosi.conf.d/10-fedora.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mkosi.conf.d/10-fedora.conf b/mkosi.conf.d/10-fedora.conf index 0196c9f745..006cdeded8 100644 --- a/mkosi.conf.d/10-fedora.conf +++ b/mkosi.conf.d/10-fedora.conf @@ -4,4 +4,4 @@ Distribution=fedora [Distribution] -@Release=38 +@Release=39 From a940484ee53152cc7d401e635267571a114319a4 Mon Sep 17 00:00:00 2001 From: Daan De Meyer Date: Sat, 9 Sep 2023 10:20:01 +0200 Subject: [PATCH 3/4] 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 f25d53d2b7..adb46e488d 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 5d347b71d8..0ef3a7bd4a 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 58cd493942..aaf05364f8 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 0000000000..e5dedafdc3 --- /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 From bcc911a7d70fc0595394e23736fedf67f39150c0 Mon Sep 17 00:00:00 2001 From: Daan De Meyer Date: Sat, 9 Sep 2023 12:20:26 +0200 Subject: [PATCH 4/4] 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. --- .github/workflows/mkosi.yml | 3 --- mkosi.conf.d/10-extra-search-paths.conf | 7 +++++++ mkosi.conf.d/10-systemd.conf | 1 - mkosi.conf.d/10-tools.conf | 8 ++++++++ 4 files changed, 15 insertions(+), 4 deletions(-) create mode 100644 mkosi.conf.d/10-extra-search-paths.conf create mode 100644 mkosi.conf.d/10-tools.conf diff --git a/.github/workflows/mkosi.yml b/.github/workflows/mkosi.yml index d46b7d1782..55bbad2bde 100644 --- a/.github/workflows/mkosi.yml +++ b/.github/workflows/mkosi.yml @@ -80,9 +80,6 @@ jobs: - name: Configure run: | - # We configure ExtraSearchPaths=build/ so make sure build/ exists. - mkdir build/ - tee mkosi.conf <<- EOF [Distribution] Distribution=${{ matrix.distro }} diff --git a/mkosi.conf.d/10-extra-search-paths.conf b/mkosi.conf.d/10-extra-search-paths.conf new file mode 100644 index 0000000000..bd3cdb1de4 --- /dev/null +++ b/mkosi.conf.d/10-extra-search-paths.conf @@ -0,0 +1,7 @@ +# SPDX-License-Identifier: LGPL-2.1-or-later + +[Match] +PathExists=build/ + +[Host] +ExtraSearchPaths=build/ diff --git a/mkosi.conf.d/10-systemd.conf b/mkosi.conf.d/10-systemd.conf index adb46e488d..b2921ffc67 100644 --- a/mkosi.conf.d/10-systemd.conf +++ b/mkosi.conf.d/10-systemd.conf @@ -17,7 +17,6 @@ Environment=ASAN_OPTIONS=verify_asan_link_order=false [Host] @Incremental=yes @QemuMem=2G -ExtraSearchPaths=build/ # Make sure we don't trigger systemd-firstboot prompting for the root password. Credentials=passwd.plaintext-password.root= KernelCommandLineExtra=systemd.crash_shell diff --git a/mkosi.conf.d/10-tools.conf b/mkosi.conf.d/10-tools.conf new file mode 100644 index 0000000000..21bdea5809 --- /dev/null +++ b/mkosi.conf.d/10-tools.conf @@ -0,0 +1,8 @@ +# SPDX-License-Identifier: LGPL-2.1-or-later + +[Match] +PathExists=!build/ +SystemdVersion=<254 + +[Host] +ToolsTree=default