mkosi: 25.3 -> 26 (#472427)

This commit is contained in:
Moritz Sanft
2025-12-21 11:06:44 +01:00
committed by GitHub
4 changed files with 36 additions and 45 deletions
@@ -9,14 +9,14 @@ Signed-off-by: Moritz Sanft <58110325+msanft@users.noreply.github.com>
---
mkosi/__init__.py | 17 +++++++----------
mkosi/bootloader.py | 3 +--
mkosi/run.py | 8 ++++----
3 files changed, 12 insertions(+), 16 deletions(-)
mkosi/run.py | 6 +++---
3 files changed, 11 insertions(+), 15 deletions(-)
diff --git a/mkosi/__init__.py b/mkosi/__init__.py
index 65cac772bf1fc9feabec5740ed89a958ba406125..c0debc09a76f36ae878bd172294eee6637b95bcb 100644
index f4766ae71244a21caa5bcbf5b5376f617c706b33..8f85f923b41feaa7716ae409cc2e983a73579ea8 100644
--- a/mkosi/__init__.py
+++ b/mkosi/__init__.py
@@ -570,7 +570,7 @@ def finalize_host_scripts(
@@ -613,7 +613,7 @@ def finalize_host_scripts(
if context.config.find_binary(binary):
scripts[binary] = (binary, "--root", "/buildroot")
if ukify := context.config.find_binary("ukify"):
@@ -25,7 +25,7 @@ index 65cac772bf1fc9feabec5740ed89a958ba406125..c0debc09a76f36ae878bd172294eee66
return finalize_scripts(context.config, scripts | dict(helpers))
@@ -702,7 +702,7 @@ def script_maybe_chroot_sandbox(
@@ -755,7 +755,7 @@ def script_maybe_chroot_sandbox(
helpers = {
"mkosi-chroot": [
@@ -34,7 +34,7 @@ index 65cac772bf1fc9feabec5740ed89a958ba406125..c0debc09a76f36ae878bd172294eee66
"--bind", "/buildroot", "/",
"--bind", "/var/tmp", "/var/tmp",
*apivfs_options(root=Path("/")),
@@ -1593,7 +1593,7 @@ def run_ukify(
@@ -1587,7 +1587,7 @@ def run_ukify(
sign: bool = True,
json_out: bool = False,
) -> dict[str, Any]:
@@ -43,7 +43,7 @@ index 65cac772bf1fc9feabec5740ed89a958ba406125..c0debc09a76f36ae878bd172294eee66
if not ukify:
die("Could not find ukify")
@@ -1605,7 +1605,6 @@ def run_ukify(
@@ -1599,7 +1599,6 @@ def run_ukify(
(context.workspace / "cmdline").write_text(f"{' '.join(cmdline)}\x00")
cmd = [
@@ -51,7 +51,7 @@ index 65cac772bf1fc9feabec5740ed89a958ba406125..c0debc09a76f36ae878bd172294eee66
ukify,
"build",
*arguments,
@@ -1700,7 +1699,7 @@ def build_uki(
@@ -1694,7 +1693,7 @@ def build_uki(
profiles: Sequence[Path],
output: Path,
) -> dict[str, Any]:
@@ -60,15 +60,15 @@ index 65cac772bf1fc9feabec5740ed89a958ba406125..c0debc09a76f36ae878bd172294eee66
die("Could not find ukify")
json_out = False
@@ -1759,7 +1758,6 @@ def build_uki(
# TODO: bump version to 258 once it is released
@@ -1755,7 +1754,6 @@ def build_uki(
if (
systemd_tool_version(
- python_binary(context.config),
ukify,
sandbox=context.sandbox,
)
@@ -1819,7 +1817,6 @@ def build_uki(
@@ -1815,7 +1813,6 @@ def build_uki(
# new .ucode section support?
if (
systemd_tool_version(
@@ -76,16 +76,16 @@ index 65cac772bf1fc9feabec5740ed89a958ba406125..c0debc09a76f36ae878bd172294eee66
ukify,
sandbox=context.sandbox,
)
@@ -1887,7 +1884,7 @@ def want_uki(context: Context) -> bool:
@@ -1883,7 +1880,7 @@ def want_uki(context: Context) -> bool:
or (
context.config.unified_kernel_images == ConfigFeature.auto
context.config.unified_kernel_images == UnifiedKernelImage.auto
and systemd_stub_binary(context).exists()
- and context.config.find_binary("ukify", "/usr/lib/systemd/ukify") is not None
+ and context.config.find_binary("ukify", "@UKIFY@") is not None
)
)
@@ -2769,9 +2766,9 @@ def check_ukify(
@@ -2799,9 +2796,9 @@ def check_ukify(
reason: str,
hint: Optional[str] = None,
) -> None:
@@ -98,10 +98,10 @@ index 65cac772bf1fc9feabec5740ed89a958ba406125..c0debc09a76f36ae878bd172294eee66
die(
f"Found '{ukify}' with version {v} but version {version} or newer is required to {reason}.",
diff --git a/mkosi/bootloader.py b/mkosi/bootloader.py
index 6f112b854f72a8863dc5e7348f0154851d3dda96..28b32b9c8fcaa7c49a7d69e7e303ccf332d47d58 100644
index 7d434bb4776980c6fa58ae8f7795f3ffc319baeb..8960a6d17d153b06b029f9072a464a12f5cafe65 100644
--- a/mkosi/bootloader.py
+++ b/mkosi/bootloader.py
@@ -270,8 +270,7 @@ def find_signed_grub_image(context: Context) -> Optional[Path]:
@@ -316,8 +316,7 @@ def find_signed_grub_image(context: Context) -> Optional[Path]:
def python_binary(config: Config) -> PathString:
# If there's no tools tree, prefer the interpreter from MKOSI_INTERPRETER. If there is a tools
# tree, just use the default python3 interpreter.
@@ -112,10 +112,19 @@ index 6f112b854f72a8863dc5e7348f0154851d3dda96..28b32b9c8fcaa7c49a7d69e7e303ccf3
def extract_pe_section(context: Context, binary: Path, section: str, output: Path) -> Path:
diff --git a/mkosi/run.py b/mkosi/run.py
index 422006d889802182d7e2f1734b2c342318583e7b..b9a1490bcd7780fea75d834e3ea4fb9a7033cc51 100644
index 159b75c1af1b5d84e409426e566e098571086c8e..7ade34fc6a9d53e010f5f45cce53a9c92407f49d 100644
--- a/mkosi/run.py
+++ b/mkosi/run.py
@@ -277,7 +277,7 @@ def finalize_path(
@@ -238,7 +238,7 @@ def spawn(
module = stack.enter_context(resource_path(sys.modules[__package__ or __name__]))
prefix = [
*(["strace", "--detach-on=execve", "--string-limit=256"] if ARG_DEBUG_SANDBOX.get() else []),
- sys.executable, "-SI", os.fspath(module / "sandbox.py"),
+ @MKOSI_SANDBOX@,
*sbx,
] # fmt: skip
@@ -321,7 +321,7 @@ def finalize_path(
# Make sure that /usr/bin and /usr/sbin are always in $PATH.
path += [s for s in ("/usr/bin", "/usr/sbin") if s not in path]
else:
@@ -124,16 +133,7 @@ index 422006d889802182d7e2f1734b2c342318583e7b..b9a1490bcd7780fea75d834e3ea4fb9a
if prefix_usr:
path = [os.fspath(root / s.lstrip("/")) if s in ("/usr/bin", "/usr/sbin") else s for s in path]
@@ -463,7 +463,7 @@ def sandbox_cmd(
cmdline: list[PathString] = [
*setup,
*(["strace", "--detach-on=execve"] if ARG_DEBUG_SANDBOX.get() else []),
- sys.executable, "-SI", module / "sandbox.py",
+ @MKOSI_SANDBOX@,
"--proc", "/proc",
# We mounted a subdirectory of TMPDIR to /var/tmp so we unset TMPDIR so that /tmp or /var/tmp are
# used instead.
@@ -633,7 +633,7 @@ def chroot_options() -> list[PathString]:
@@ -690,7 +690,7 @@ def chroot_options() -> list[PathString]:
"--unshare-ipc",
"--setenv", "container", "mkosi",
"--setenv", "HOME", "/",
@@ -142,12 +142,3 @@ index 422006d889802182d7e2f1734b2c342318583e7b..b9a1490bcd7780fea75d834e3ea4fb9a
"--setenv", "BUILDROOT", "/",
] # fmt: skip
@@ -647,7 +647,7 @@ def chroot_cmd(
) -> Iterator[list[PathString]]:
with vartmpdir() as dir, resource_path(sys.modules[__package__ or __name__]) as module:
cmdline: list[PathString] = [
- sys.executable, "-SI", module / "sandbox.py",
+ @MKOSI_SANDBOX@,
*root("/"),
# We mounted a subdirectory of TMPDIR to /var/tmp so we unset TMPDIR so that /tmp or /var/tmp are
# used instead.
@@ -11,10 +11,10 @@ Signed-off-by: Moritz Sanft <58110325+msanft@users.noreply.github.com>
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/mkosi/sandbox.py b/mkosi/sandbox.py
index c79b48739f3d7127375274bc0b1ef3463cae9032..1d7ad421f4534e25c6456c3a169ea9189668aefd 100755
index 4a41f333a764bc41abbd36302bd9fe86baa45a3f..1ce102597f1935deadcec475ec873eab9ca03c22 100755
--- a/mkosi/sandbox.py
+++ b/mkosi/sandbox.py
@@ -92,7 +92,7 @@ class cap_user_data_t(ctypes.Structure):
@@ -124,7 +124,7 @@ class cap_user_data_t(ctypes.Structure):
]
@@ -23,7 +23,7 @@ index c79b48739f3d7127375274bc0b1ef3463cae9032..1d7ad421f4534e25c6456c3a169ea918
libc.syscall.restype = ctypes.c_long
libc.unshare.argtypes = (ctypes.c_int,)
@@ -221,7 +221,7 @@ def seccomp_suppress(*, chown: bool = False, sync: bool = False) -> None:
@@ -291,7 +291,7 @@ def seccomp_suppress(*, chown: bool = False, sync: bool = False) -> None:
if not chown and not sync:
return
@@ -9,10 +9,10 @@ Signed-off-by: Moritz Sanft <58110325+msanft@users.noreply.github.com>
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/mkosi/qemu.py b/mkosi/qemu.py
index 0c406d818a9fa9dcce3be97d0c89e9df0d2a96fa..c134ab4a8bfba1e3564c831a5069be52d90ee15a 100644
index 4d1bec15605ca36d66a05add0744afdfbdc4853d..d10007ed58ebc16271b313b1a846ca2c24d8ae81 100644
--- a/mkosi/qemu.py
+++ b/mkosi/qemu.py
@@ -211,7 +211,7 @@ def find_ovmf_firmware(config: Config, firmware: Firmware) -> Optional[OvmfConfi
@@ -189,7 +189,7 @@ def find_ovmf_firmware(config: Config, firmware: Firmware) -> Optional[OvmfConfi
if not firmware.is_uefi():
return None
+3 -3
View File
@@ -58,7 +58,7 @@ let
in
python3Packages.buildPythonApplication rec {
pname = "mkosi";
version = "25.3";
version = "26";
format = "pyproject";
outputs = [
@@ -69,8 +69,8 @@ python3Packages.buildPythonApplication rec {
src = fetchFromGitHub {
owner = "systemd";
repo = "mkosi";
rev = "21850673a7f75125d516268ce379dae776dd816a";
hash = "sha256-3dhr9lFJpI8aN8HILaMvGuuTbmTVUqdaLAGxSpqciTs=";
tag = "v${version}";
hash = "sha256-6DVIyFsEV2VkQ/kesn6cN+iH9MW+mmAZw5i0R5C4xaU=";
};
patches = [