Appimage/zh: Difference between revisions

Ardenet (talk | contribs)
Created page with "=== 将 AppImage 文件作为二进制类型注册到 binfmt_misc ==="
Ardenet (talk | contribs)
Created page with "从 [https://nixos.org/manual/nixos/stable/release-notes#sec-release-24.05-new-services NixOS 24.05] 开始,有一个 binfmt 选项:"
Line 68: Line 68:
=== 将 AppImage 文件作为二进制类型注册到 binfmt_misc ===
=== 将 AppImage 文件作为二进制类型注册到 binfmt_misc ===


<div lang="en" dir="ltr" class="mw-content-ltr">
您可以通过 [https://en.wikipedia.org/wiki/Binfmt_misc#External_links binfmt_misc] 来告诉 Linux 内核在执行某些二进制文件时使用哪个解释器(例如 <code>appimage-run</code>),具体方式可以通过文件扩展名或魔数匹配来实现。下面的 NixOS 配置会注册 AppImage 文件(魔数为“AI”+ 0x02 的 ELF 文件),并使用 <code>appimage-run</code> 作为解释器运行。
You can tell the Linux kernel to use an interpreter (e.g. <code>appimage-run</code>) when executing certain binary files through the use of [https://en.wikipedia.org/wiki/Binfmt_misc#External_links binfmt_misc], either by filename extension or magic number matching. Below NixOS configuration registers AppImage files (ELF files with magic number "AI" + 0x02) to be run with <code>appimage-run</code> as interpreter.
</div>


<div lang="en" dir="ltr" class="mw-content-ltr">
[https://nixos.org/manual/nixos/stable/release-notes#sec-release-24.05-new-services NixOS 24.05] 开始,有一个 binfmt 选项:
Since [https://nixos.org/manual/nixos/stable/release-notes#sec-release-24.05-new-services NixOS 24.05], there is a binfmt option:
</div>


<syntaxhighlight lang="nixos">
<syntaxhighlight lang="nixos">