From 1a98bb2670e92dbbc769d81770b803a26fec9c7e567866e9bc08977cf1f7b1a8 Mon Sep 17 00:00:00 2001
From: Sebastian Wagner <sebix+novell.com@sebix.at>
Date: Wed, 12 Jun 2024 20:26:01 +0000
Subject: [PATCH] Update to v23.1

OBS-URL: https://build.opensuse.org/package/show/Virtualization/mkosi?expand=0&rev=34
---
 mkosi-22.tar.gz                               |   3 -
 mkosi-23.1.tar.gz                             |   3 +
 mkosi.changes                                 | 121 ++++++++++++++++++
 mkosi.spec                                    |   4 +-
 ...tall-distribution-release-by-default.patch |  70 ----------
 5 files changed, 125 insertions(+), 76 deletions(-)
 delete mode 100644 mkosi-22.tar.gz
 create mode 100644 mkosi-23.1.tar.gz
 delete mode 100644 opensuse-dont-install-distribution-release-by-default.patch

diff --git a/mkosi-22.tar.gz b/mkosi-22.tar.gz
deleted file mode 100644
index e869248..0000000
--- a/mkosi-22.tar.gz
+++ /dev/null
@@ -1,3 +0,0 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:7101d77839b2970e19005ac4f7aaa8c7d025be03e91967f27ca447aa143a384d
-size 315557
diff --git a/mkosi-23.1.tar.gz b/mkosi-23.1.tar.gz
new file mode 100644
index 0000000..a176ca7
--- /dev/null
+++ b/mkosi-23.1.tar.gz
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:116bd3d848ce767a584ce288ad5a098a47d42067c9b95aa5a6662de33dc04eb9
+size 337863
diff --git a/mkosi.changes b/mkosi.changes
index 38dbe9c..f64c74f 100644
--- a/mkosi.changes
+++ b/mkosi.changes
@@ -1,3 +1,124 @@
+-------------------------------------------------------------------
+Wed Jun 12 18:51:56 UTC 2024 - Fredrik Lönnegren <fredrik.lonnegren@suse.com>
+
+- Update to 23.1:
+  * Respin due to git tag mismatch
+
+- Update to 23:
+  * Added CleanScripts= to allow running custom cleanup code whenever
+    mkosi cleans up the output directory. This allows cleaning up extra
+    outputs produced by e.g. a build script that mkosi doesn't know about.
+  * Added ConfigureScripts= to allow dynamically modifying the mkosi
+    configuration. Each configure script receives the current config as
+    JSON on stdin and should output the new config as JSON on stdout.
+  * When building a UKI, we don't measure for the TPM SHA1 PCR bank
+    anymore.
+  * All keys in the mkosi config JSON output are now in pascal case,
+    except for credentials and environments, where the keys encode names
+    of credentials and environment variables and are therefore case
+    sensitive.
+  * Added various settings to allow running mkosi behind a proxy.
+  * Various fixes to kernel module filtering that should result in fewer
+    modules being pulled into the default initrd when
+    KernelModulesExclude= or KernelModulesInitrdExclude= are used.
+  * Added ToolsTreeDistribution= match.
+  * Removed vmspawn verb and replaced it with VirtualMachineMonitor=.
+  * New specifiers for various directories were added. %D resolves to
+    the directory that mkosi was invoked in, %P to the current working
+    directory, and %C to the parent directory of the config file.
+  * Added ForwardJournal= to have systemd inside a container/VM forward
+    its journal to the specified file or directory.
+    Systemd scopes are now allocated for qemu, swtpm, virtiofsd and
+    systemd-journal-remote if available.
+  * The mkosi qemu virtual machine is now registered with
+    systemd-machined if available.
+  * Added new oci output format
+  * Runtime trees without a target are now mounted to /root/src instead
+    of a subdirectory of it (To have the same behaviour as
+    BuildSources=).
+  * Added RuntimeBuildSources= to mount build and source directories
+    when booting the image with mkosi nspawn or mkosi qemu.
+    Introduced --append to allow command line settings to be parsed
+    after parsing configuration files.
+  * distribution-release is not installed by default anymore on
+    OpenSUSE.
+  * Setting QemuSmp= to 0 will now make qemu use all available CPUs
+  * Free page reporting and discard request processing are now enabled by
+    default in VMs spawned by mkosi qemu.
+  * Added ToolsTreeCertificates= to allow configuring whether to use
+    certificates and keys from the tools tree (if one is used) or the
+    host.
+  * Added never for CacheOnly= to specify that repository metadata
+    should always be refreshed.
+  * Renamed the none option for CacheOnly= to auto.
+  * Added ProxyExclude= to configure hostnames for which requests should
+    not go through the configured proxy.
+  * The default tools tree is now reused on incremental builds.
+  * Added VolatilePackages= and InitrdVolatilePackages= to configure
+    packages that should be installed after executing build scripts and
+    which should not be cached when using Incremental=.
+  * PackageDirectories= now has an associated default path
+    mkosi.packages.
+  * reprepro is now used to generate local apt repositories.
+  * Support for BSD tar/cpio was dropped.
+  * When both ExtraSearchPaths= and ToolsTree= are used, mkosi will
+    now prefer running a binary found in ExtraSearchPaths= without the
+    tools tree over running the binary from the tools tree. If a binary is
+    not found in ExtraSearchPaths=, the tools tree is used instead.
+  * An artifact directory is now made available when running scripts which
+    can be used to pass around data between different scripts. mkosi will
+    also look for microcode and initrds in the artifact directory under
+    the io.mkosi.microcode and io.mkosi.initrd subdirectories.
+  * Added Environment= match setting to check for environment variables
+    defined with the Environment= setting.
+  * The basesystem package is now always installed in Fedora and
+    CentOS images instead of the filesystem package.
+  * The qemu, shell and boot verbs do not automatically build the
+    image anymore unless --force is specified.
+  * SplitArtifacts= is now supported for the portable, sysext and
+    confext outputs.
+  * The WithDocs= option was implemented for pacman-based distributions.
+  * The default Fedora release was bumped to 40.
+  * QemuSwtpm= can now be used with QemuFirmware= set to linux or
+    bios.
+  * Added UnitProperties= to allow configure properties on the scopes
+    generated by systemd-nspawn and systemd-run.
+  * mkosi now only builds a single default tools tree per build using the
+    settings from the last regular image that we'll build.
+  * Configure scripts are now only executed for verbs which imply an image
+    build and are executed with the tools tree instead of without it.
+  * $QEMU_ARCHITECTURE is now set for configure scripts to easily allow
+    scripts to figure out which qemu binary will be used to run qemu.
+  * A file ID can now be specified for QemuDrives=. This allows adding
+    multiple qemu drives that are backed by the same file.
+  * mkosi doesn't fail anymore if images already exist when running
+    mkosi build.
+  * Image names from mkosi.images/ are now preferred over the specified
+    image ID when determining the output filename to use for an image.
+    --include now has a shorthand option -I.
+  * The WITH_NETWORK environment variable is now passed to build and
+    finalize scripts.
+  * We now clamp mtimes to the specified source date epoch timestamp
+    instead of resetting all mtimes. This means that we won't touch any
+    mtimes that are already older than the given source date epoch
+    timestamp.
+  * Removed support for CentOS 8 Stream as it is now EOL.
+  * The coredumpctl and journalctl verbs now operrate on the path
+    specified in ForwardJournal= if one is set.
+  * Added UnifiedKernelImageFormat= format setting to allow configuring
+    the naming of unified kernel images generated by mkosi.
+  * The versionlock plugin is now enabled by default for dnf with a noop
+    configuration.
+  * Repositories= is now implemented for zypper.
+  * KernelModulesInclude= and KernelModulesInitrdInclude= now take the
+    special values host and default to include the host's loaded
+    modules and the default kernel modules defined in mkosi-initrd
+    respectively.
+  * KernelModulesIncludeHost= and KernelModulesInitrdIncludeHost= are
+    now deprecated.
+  * Added mkosi dependencies to output the list of packages required by
+    mkosi to build and boot images.
+
 -------------------------------------------------------------------
 Tue Jun  4 13:59:06 UTC 2024 - Franck Bui <fbui@suse.com>
 
diff --git a/mkosi.spec b/mkosi.spec
index a10e80f..dd013b1 100644
--- a/mkosi.spec
+++ b/mkosi.spec
@@ -19,15 +19,13 @@
 %define pythons python3
 
 Name:           mkosi
-Version:        22
+Version:        23.1
 Release:        0
 Summary:        Build Legacy-Free OS Images
 License:        LGPL-2.1-or-later
 Group:          System/Management
 URL:            https://github.com/systemd/mkosi
 Source:         https://github.com/systemd/mkosi/archive/v%{version}.tar.gz#/%{name}-%{version}.tar.gz
-# PATCH-FIX-UPSTREAM https://github.com/systemd/mkosi/pull/2606
-Patch0:         opensuse-dont-install-distribution-release-by-default.patch
 BuildRequires:  %{python_module pip}
 BuildRequires:  %{python_module pytest}
 BuildRequires:  %{python_module wheel}
diff --git a/opensuse-dont-install-distribution-release-by-default.patch b/opensuse-dont-install-distribution-release-by-default.patch
deleted file mode 100644
index 232c87f..0000000
--- a/opensuse-dont-install-distribution-release-by-default.patch
+++ /dev/null
@@ -1,70 +0,0 @@
-From 6cbf5cc1375525f71819416dfae8206ff3c4e1ea Mon Sep 17 00:00:00 2001
-From: Daan De Meyer <daan.j.demeyer@gmail.com>
-Date: Mon, 8 Apr 2024 13:40:35 +0200
-Subject: [PATCH] opensuse: Don't install distribution-release by default
-
-distribution-release is a virtual package that is satisfied by
-multiple packages. By installing it by default in the first transaction
-we can't override it anymore later. Let's fix the issue by not explicitly
-installing distribution-release.
-
-To make sure openSUSE-release is pulled in by default to satisfy
-distribution-release, we install patterns-base-minimal_base which has
-a Suggests dependency on openSUSE-release.
----
- mkosi.conf.d/20-opensuse.conf                              | 1 +
- mkosi/distributions/opensuse.py                            | 2 +-
- mkosi/resources/mkosi-initrd/mkosi.conf.d/10-opensuse.conf | 2 ++
- mkosi/resources/mkosi-tools/mkosi.conf.d/10-opensuse.conf  | 1 +
- 4 files changed, 5 insertions(+), 1 deletion(-)
-
-Index: mkosi-22/mkosi.conf.d/20-opensuse.conf
-===================================================================
---- mkosi-22.orig/mkosi.conf.d/20-opensuse.conf
-+++ mkosi-22/mkosi.conf.d/20-opensuse.conf
-@@ -34,6 +34,7 @@ Packages=
-         openssh-server
-         openssl
-         ovmf
-+        patterns-base-minimal_base
-         perf
-         pesign
-         python3-pefile
-Index: mkosi-22/mkosi/distributions/opensuse.py
-===================================================================
---- mkosi-22.orig/mkosi/distributions/opensuse.py
-+++ mkosi-22/mkosi/distributions/opensuse.py
-@@ -69,7 +69,7 @@ class Installer(DistributionInstaller):
- 
-     @classmethod
-     def install(cls, context: Context) -> None:
--        cls.install_packages(context, ["filesystem", "distribution-release"], apivfs=False)
-+        cls.install_packages(context, ["filesystem"], apivfs=False)
- 
-     @classmethod
-     def install_packages(cls, context: Context, packages: Sequence[str], apivfs: bool = True) -> None:
-Index: mkosi-22/mkosi/resources/mkosi-initrd/mkosi.conf.d/10-opensuse.conf
-===================================================================
---- mkosi-22.orig/mkosi/resources/mkosi-initrd/mkosi.conf.d/10-opensuse.conf
-+++ mkosi-22/mkosi/resources/mkosi-initrd/mkosi.conf.d/10-opensuse.conf
-@@ -5,6 +5,8 @@ Distribution=opensuse
- 
- [Content]
- Packages=
-+        patterns-base-minimal_base
-+
-         # Various libraries that are dlopen'ed by systemd
-         libfido2-1
-         tpm2-0-tss
-Index: mkosi-22/mkosi/resources/mkosi-tools/mkosi.conf.d/10-opensuse.conf
-===================================================================
---- mkosi-22.orig/mkosi/resources/mkosi-tools/mkosi.conf.d/10-opensuse.conf
-+++ mkosi-22/mkosi/resources/mkosi-tools/mkosi.conf.d/10-opensuse.conf
-@@ -16,6 +16,7 @@ Packages=
-         grub2
-         openssh-clients
-         ovmf
-+        patterns-base-minimal_base
-         pesign
-         policycoreutils
-         python3-pefile