Compare commits
14 Commits
| Author | SHA256 | Date | |
|---|---|---|---|
| 43bf02682c | |||
| 6a67f4f370 | |||
| 9c184d5708 | |||
| acc6659a46 | |||
| b3f9106753 | |||
| b5c9c2c1b7 | |||
| 691817db55 | |||
| 2d3e382ba9 | |||
| 9632886623 | |||
| fcaa89c875 | |||
| d368c84fd3 | |||
| 3892d660d3 | |||
| 1378625671 | |||
| 2e99933c43 |
@@ -0,0 +1,51 @@
|
||||
From d53761c4dd2fe4a86a203d81c5bf1bbcf4e06ead Mon Sep 17 00:00:00 2001
|
||||
From: Antonio Alvarez Feijoo <antonio.feijoo@suse.com>
|
||||
Date: Fri, 19 Dec 2025 12:14:11 +0100
|
||||
Subject: [PATCH] distribution: do not default to release=VERSION_ID for
|
||||
openSUSE Tumbleweed
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
`config_default_release()` calls `detect_distribution()` to get the default
|
||||
release if it's not set, which picks the value from os-release's `VERSION_ID`.
|
||||
In openSUSE Tumbleweed this property has the snapshot number. Since
|
||||
`mkosi-initrd` does not set `Release=` via config, mkosi thinks that it's Leap
|
||||
and fails:
|
||||
|
||||
```
|
||||
$ mkosi-initrd
|
||||
‣ Validating certificates and keys
|
||||
‣ Building main image
|
||||
‣ Copying in sandbox trees…
|
||||
‣ Installing openSUSE
|
||||
Warning: Enforced setting: $releasever=20251217
|
||||
Loading repository data...
|
||||
Reading installed packages...
|
||||
'Leap-release' not found in package names. Trying capabilities.
|
||||
No provider of 'Leap-release' found.
|
||||
‣ "zypper --installroot=/buildroot --cache-dir=/var/cache/zypp --non-interactive --no-refresh --releasever=20251217 --no-gpg-checks install --download in-advance --no-recommends --force-resolution filesystem Leap-release" returned non-zero exit code 104.
|
||||
‣ "mkosi --force --directory= --format=cpio --output=initrd --output-directory=/tmp/tmpcvx9let7 --extra-tree=/usr/lib/modules/6.17.0-2-default:/usr/lib/modules/6.17.0-2-default --extra-tree=/usr/lib/firmware:/usr/lib/firmware '--remove-files=/usr/lib/firmware/*-ucode' --build-sources= --include=mkosi-initrd --kernel-modules=host --extra-tree=/usr/lib/modules/6.17.0-1-default/updates/hdaps.ko:/usr/lib/modules/6.17.0-1-default/updates/hdaps.ko --extra-tree=/usr/lib/modules/6.17.0-1-default/updates/thinkpad_ec.ko:/usr/lib/modules/6.17.0-1-default/updates/thinkpad_ec.ko --extra-tree=/usr/lib/modules/6.17.0-1-default/updates/tp_smapi.ko:/usr/lib/modules/6.17.0-1-default/updates/tp_smapi.ko --package-cache-dir=/var --cache-only=metadata --output-mode=600 --include /usr/lib/mkosi-initrd --include /etc/mkosi-initrd --sandbox-tree=/tmp/tmp0tjr7mwr --extra-tree=/etc/vconsole.conf:/etc/vconsole.conf" returned non-zero exit code 104.
|
||||
```
|
||||
|
||||
Fixes 0b701c690ddcf3543bc1a698a1977ea390dbfd36
|
||||
---
|
||||
mkosi/distribution/__init__.py | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/mkosi/distribution/__init__.py b/mkosi/distribution/__init__.py
|
||||
index 2b8b632b..e59025ac 100644
|
||||
--- a/mkosi/distribution/__init__.py
|
||||
+++ b/mkosi/distribution/__init__.py
|
||||
@@ -162,7 +162,7 @@ def detect_distribution(root: Path = Path("/")) -> tuple[Optional[Distribution],
|
||||
|
||||
dist_id = os_release.get("ID", "linux")
|
||||
dist_id_like = os_release.get("ID_LIKE", "").split()
|
||||
- version_id = os_release.get("VERSION_ID", None)
|
||||
+ version_id = os_release.get("VERSION_ID", None) if dist_id != "opensuse-tumbleweed" else "tumbleweed"
|
||||
version_codename = os_release.get("VERSION_CODENAME", None)
|
||||
|
||||
quirks = {
|
||||
--
|
||||
2.51.0
|
||||
|
||||
@@ -1,3 +0,0 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:e1c66e296f9df6628d942dc6139605f7aead2496d6edb84e17f8ddcc11823ca4
|
||||
size 404535
|
||||
3
mkosi-26.tar.gz
Normal file
3
mkosi-26.tar.gz
Normal file
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:567719cefdbf8a8a95920ed7d7f5e388bb16d44ec5c1978e5423eb22c1e6e84e
|
||||
size 448422
|
||||
@@ -17,6 +17,7 @@ RemoveFiles=
|
||||
/usr/share/zsh
|
||||
/usr/etc/services
|
||||
/var/adm
|
||||
/var/tmp
|
||||
|
||||
# Keep only C.utf-8 locale
|
||||
/usr/lib/locale/*_*/
|
||||
@@ -57,3 +58,6 @@ RemoveFiles=
|
||||
|
||||
# dracut modules installed by other packages
|
||||
/usr/lib/dracut
|
||||
|
||||
# filesystem tmpfiles
|
||||
/usr/lib/tmpfiles.d/fs-usr-local.conf
|
||||
|
||||
@@ -1,3 +1,95 @@
|
||||
-------------------------------------------------------------------
|
||||
Mon Dec 22 09:37:12 UTC 2025 - Antonio Feijoo <antonio.feijoo@suse.com>
|
||||
|
||||
- Add 0001-distribution-do-not-default-to-release-VERSION_ID-fo.patch:
|
||||
* Backport upstream patch to fix mkosi-initrd in openSUSE Tumbleweed.
|
||||
Without this patch, mkosi thinks that it's Leap and the call fails.
|
||||
|
||||
- Update to 26:
|
||||
* Extra options to commands invoked by mkosi (e.g. when using mkosi boot
|
||||
or mkosi shell) should now be delimited from regular options using
|
||||
--. Options passed after the verb without using the -- delimiter
|
||||
are now interpreted as regular mkosi options.
|
||||
* Boolean options specified on the command line now always expect a
|
||||
boolean argument. For example, --repository-key-check needs to
|
||||
become --repository-key-check=yes. The reason for this change is to
|
||||
remove ambiguity when parsing e.g. --repository-key-check build
|
||||
where build would be interpreted as the argument for
|
||||
--repository-key-check whereas now it'll be properly interpreted as
|
||||
the verb.
|
||||
* Teach --verity a new hash value, which skips the verity signature
|
||||
partition for extension / portable images. To align the possible values,
|
||||
yes is renamed to signed.
|
||||
* Teach --verity a new defer value, which defers creation of the
|
||||
verity signature partition for disk, extension and portable images (but
|
||||
still allocates space for it). This is useful to implement offline
|
||||
signing of the verity roothash.
|
||||
* A new way to specify modules included in the initrd has been added.
|
||||
The new default is that modules need to be specified to be included.
|
||||
Previous separate Include and Exclude options that take regexps are now
|
||||
deprecated and are replaced by a single option that takes a list of
|
||||
positive and negative globs. The new options are KernelModules=
|
||||
and KernelInitrdModules=.
|
||||
* A new way to specify firmware files included in the initrd has been added.
|
||||
Previous separate Include and Exclude options that take regexps are now
|
||||
deprecated and are replaced by a single option that takes a list of
|
||||
positive and negative globs. The new option is FirmwareFiles=.
|
||||
* The RuntimeScratch= option has been dropped. Use RuntimeSize=
|
||||
instead to grow the image before booting it.
|
||||
* The CDROM= option has been dropped.
|
||||
* Unknown settings now generate a warning message instead of failing the
|
||||
image build. This allows configs to work across a wider range of mkosi
|
||||
versions while still taking advantage of newer settings. MinimumVersion
|
||||
can still be used to enforce a minimum version of mkosi that knows all
|
||||
required settings.
|
||||
|
||||
- Remove 0002-Include-sys-conf-ext-info-in-metadata-file.patch, merged in
|
||||
version 26.
|
||||
|
||||
- Remove 0001-Drop-microsecond-resolution-for-datetime.now.patch, merged in
|
||||
version 26.
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Mon Aug 25 12:35:04 UTC 2025 - Antonio Feijoo <antonio.feijoo@suse.com>
|
||||
|
||||
- Add 0002-Include-sys-conf-ext-info-in-metadata-file.patch
|
||||
* Backport upstream patch to include sysext and confext information in
|
||||
the metadata file. This change allows sysext images to be built with
|
||||
mkosi-generated manifest files in OBS without needing the current *.json
|
||||
hack.
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Thu Aug 7 11:56:38 UTC 2025 - Antonio Feijoo <antonio.feijoo@suse.com>
|
||||
|
||||
- Add 0001-Drop-microsecond-resolution-for-datetime.now.patch
|
||||
* Backport upstream patch to address an issue in OBS, where a manifest is
|
||||
sometimes not created if the image contains only one RPM package on
|
||||
architectures with fast CPUs. The root cause is rounding errors when
|
||||
comparing the RPM INSTALLTIME attribute (int) and datetime.now (float).
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Mon Jun 16 14:57:00 UTC 2025 - Antonio Feijoo <antonio.feijoo@suse.com>
|
||||
|
||||
- Do not create /usr/local tmpfiles in mkosi-initrd images.
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Thu May 15 12:21:40 UTC 2025 - Antonio Feijoo <antonio.feijoo@suse.com>
|
||||
|
||||
- Call macros to regenerate initrd on %post, %postun, %posttrans of the
|
||||
mkosi-initrd package.
|
||||
- Remove also /var/tmp from mkosi-initrd images.
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Thu Apr 3 11:21:58 UTC 2025 - Dirk Müller <dmueller@suse.com>
|
||||
|
||||
- move pandoc dependency to a build condititional for inclusion
|
||||
in SL16
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Thu Mar 13 08:22:55 UTC 2025 - Thorsten Kukuk <kukuk@suse.com>
|
||||
|
||||
- Only install the real man pages, not the mandoc source files
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Sat Feb 1 18:25:18 UTC 2025 - Antonio Feijoo <antonio.feijoo@suse.com>
|
||||
|
||||
@@ -473,7 +565,7 @@ Tue Jun 4 13:59:06 UTC 2024 - Franck Bui <fbui@suse.com>
|
||||
-------------------------------------------------------------------
|
||||
Mon May 27 15:50:17 UTC 2024 - Alberto Planas Dominguez <aplanas@suse.com>
|
||||
|
||||
- Add opensuse-dont-install-distribution-release-by-default.patch
|
||||
- Add opensuse-dont-install-distribution-release-by-default.patch
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Tue Mar 26 14:37:39 UTC 2024 - Richard Brown <rbrown@suse.com>
|
||||
|
||||
54
mkosi.spec
54
mkosi.spec
@@ -18,8 +18,17 @@
|
||||
|
||||
%define pythons python3
|
||||
|
||||
%if 0%{?suse_version} > 1600
|
||||
%ifarch x86_64 aarch64
|
||||
%bcond_without pandoc
|
||||
%else
|
||||
%bcond_with pandoc
|
||||
%endif
|
||||
%bcond_with pandoc
|
||||
%endif
|
||||
|
||||
Name: mkosi
|
||||
Version: 25.3
|
||||
Version: 26
|
||||
Release: 0
|
||||
Summary: Build bespoke OS Images
|
||||
License: LGPL-2.1-or-later
|
||||
@@ -27,12 +36,14 @@ Group: System/Management
|
||||
URL: https://github.com/systemd/mkosi
|
||||
Source0: https://github.com/systemd/mkosi/archive/v%{version}.tar.gz#/%{name}-%{version}.tar.gz
|
||||
Source1: mkosi-initrd.conf
|
||||
# PATCH-FIX-UPSTREAM https://github.com/systemd/mkosi/pull/4079
|
||||
Patch0: 0001-distribution-do-not-default-to-release-VERSION_ID-fo.patch
|
||||
BuildRequires: %{python_module pip}
|
||||
BuildRequires: %{python_module pytest}
|
||||
BuildRequires: %{python_module wheel}
|
||||
BuildRequires: %{pythons}
|
||||
BuildRequires: fdupes
|
||||
%ifarch x86_64 aarch64
|
||||
%if %{with pandoc}
|
||||
BuildRequires: pandoc
|
||||
%endif
|
||||
BuildRequires: python-rpm-macros
|
||||
@@ -77,8 +88,10 @@ system.
|
||||
|
||||
%package initrd
|
||||
Summary: Build initrds locally using mkosi
|
||||
BuildRequires: rpm-config-SUSE
|
||||
Requires: %{name} = %{version}-%{release}
|
||||
Requires: coreutils
|
||||
Requires(post): suse-module-tools-scriptlets
|
||||
|
||||
%description initrd
|
||||
This package provides the mkosi-initrd wrapper to build initrds with mkosi
|
||||
@@ -88,7 +101,7 @@ locally.
|
||||
%autosetup -p1
|
||||
|
||||
%build
|
||||
%ifarch x86_64 aarch64
|
||||
%if %{with pandoc}
|
||||
tools/make-man-page.sh
|
||||
%endif
|
||||
%pyproject_wheel
|
||||
@@ -98,16 +111,16 @@ bin/mkosi completion bash > mkosi.bash
|
||||
%pyproject_install
|
||||
%python_expand %fdupes %{buildroot}/%{$python_sitelib}/mkosi
|
||||
|
||||
%ifarch x86_64 aarch64
|
||||
%if %{with pandoc}
|
||||
# Install man pages
|
||||
mkdir -p %{buildroot}%{_mandir}/man1
|
||||
cp %{buildroot}%{python3_sitelib}/mkosi/resources/man/mkosi.1* \
|
||||
cp %{buildroot}%{python3_sitelib}/mkosi/resources/man/mkosi.1 \
|
||||
%{buildroot}%{_mandir}/man1/
|
||||
cp %{buildroot}%{python3_sitelib}/mkosi/resources/man/mkosi-addon.1* \
|
||||
cp %{buildroot}%{python3_sitelib}/mkosi/resources/man/mkosi-addon.1 \
|
||||
%{buildroot}%{_mandir}/man1/
|
||||
cp %{buildroot}%{python3_sitelib}/mkosi/resources/man/mkosi-initrd.1* \
|
||||
cp %{buildroot}%{python3_sitelib}/mkosi/resources/man/mkosi-initrd.1 \
|
||||
%{buildroot}%{_mandir}/man1/
|
||||
cp %{buildroot}%{python3_sitelib}/mkosi/resources/man/mkosi-sandbox.1* \
|
||||
cp %{buildroot}%{python3_sitelib}/mkosi/resources/man/mkosi-sandbox.1 \
|
||||
%{buildroot}%{_mandir}/man1/
|
||||
%endif
|
||||
|
||||
@@ -127,10 +140,17 @@ if [ ! -e %{_sysconfdir}/mkosi-initrd/mkosi.conf ]; then
|
||||
# See man mkosi(1) for details.
|
||||
#[Content]
|
||||
#ExtraTrees=
|
||||
#KernelModulesInclude=
|
||||
#KernelModulesExclude=
|
||||
#FirmwareFiles=
|
||||
#KernelModules=
|
||||
EOF
|
||||
fi
|
||||
%{?regenerate_initrd_post}
|
||||
|
||||
%postun initrd
|
||||
%{?regenerate_initrd_post}
|
||||
|
||||
%posttrans initrd
|
||||
%{?regenerate_initrd_posttrans}
|
||||
|
||||
%check
|
||||
%pytest
|
||||
@@ -140,9 +160,9 @@ fi
|
||||
%license LICENSES
|
||||
%{_bindir}/mkosi
|
||||
%{_bindir}/mkosi-sandbox
|
||||
%ifarch x86_64 aarch64
|
||||
%{_mandir}/man1/mkosi.1*
|
||||
%{_mandir}/man1/mkosi-sandbox.1*
|
||||
%if %{with pandoc}
|
||||
%{_mandir}/man1/mkosi.1%{?ext_man}
|
||||
%{_mandir}/man1/mkosi-sandbox.1%{?ext_man}
|
||||
%endif
|
||||
%{python3_sitelib}/mkosi
|
||||
%{python3_sitelib}/mkosi-%{version}.dist-info
|
||||
@@ -152,14 +172,14 @@ fi
|
||||
|
||||
%files addon
|
||||
%{_bindir}/mkosi-addon
|
||||
%ifarch x86_64 aarch64
|
||||
%{_mandir}/man1/mkosi-addon.1*
|
||||
%if %{with pandoc}
|
||||
%{_mandir}/man1/mkosi-addon.1%{?ext_man}
|
||||
%endif
|
||||
|
||||
%files initrd
|
||||
%{_bindir}/mkosi-initrd
|
||||
%ifarch x86_64 aarch64
|
||||
%{_mandir}/man1/mkosi-initrd.1*
|
||||
%if %{with pandoc}
|
||||
%{_mandir}/man1/mkosi-initrd.1%{?ext_man}
|
||||
%endif
|
||||
%dir %{_prefix}/lib/mkosi-initrd
|
||||
%{_prefix}/lib/mkosi-initrd/mkosi.conf
|
||||
|
||||
Reference in New Issue
Block a user