Appimage/zh: Difference between revisions
Created page with "=== 将 AppImage 文件作为二进制类型注册到 binfmt_misc ===" |
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 === | ||
您可以通过 [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> 作为解释器运行。 | |||
从 [https://nixos.org/manual/nixos/stable/release-notes#sec-release-24.05-new-services NixOS 24.05] 开始,有一个 binfmt 选项: | |||
<syntaxhighlight lang="nixos"> | <syntaxhighlight lang="nixos"> | ||