-
Notifications
You must be signed in to change notification settings - Fork 117
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add binfmt-misc kernel support. Signed-off-by: Serge Logvinov <serge.logvinov@sinextra.dev>
- Loading branch information
1 parent
336397b
commit 46a3004
Showing
8 changed files
with
74 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
# binfmt_misc | ||
|
||
Miscellaneous Binary Format is a capability of the Linux kernel that allows arbitrary executable file formats to be recognized and passed to certain user space applications, such as emulators and virtual machines. | ||
|
||
## Installation | ||
|
||
Add the extension to your machine config and enable the modules. | ||
|
||
```yaml | ||
machine: | ||
install: | ||
extensions: | ||
- image: ghcr.io/siderolabs/binfmt-misc:<VERSION> | ||
kernel: | ||
modules: | ||
- name: binfmt_misc | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
modules.order | ||
modules.builtin | ||
modules.builtin.modinfo | ||
kernel/fs/binfmt_misc.ko |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
version: v1alpha1 | ||
metadata: | ||
name: binfmt-misc | ||
version: "$VERSION" | ||
author: Serge Logvinov | ||
description: | | ||
This system extension provides kernel module driver for binfmt-misc built against a specific Talos version. | ||
compatibility: | ||
talos: | ||
version: ">= v1.5.0" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
name: binfmt-misc | ||
variant: scratch | ||
shell: /toolchain/bin/bash | ||
dependencies: | ||
- stage: base | ||
# The pkgs version for a particular release of Talos as defined in | ||
# https://github.com/siderolabs/talos/blob/<talos version>/pkg/machinery/gendata/data/pkgs | ||
- image: "{{ .PKGS_PREFIX }}/kernel:{{ .BUILD_ARG_PKGS }}" | ||
steps: | ||
- prepare: | ||
- | | ||
sed -i 's#$VERSION#{{ .VERSION }}#' /pkg/manifest.yaml | ||
- install: | ||
- | | ||
export KERNELRELEASE=$(find /lib/modules -type d -name "*-talos" -exec basename {} \+) | ||
mkdir -p /rootfs | ||
xargs -a /pkg/files/modules.txt -I {} install -D /lib/modules/${KERNELRELEASE}/{} /rootfs/lib/modules/${KERNELRELEASE}/{} | ||
depmod -b /rootfs ${KERNELRELEASE} | ||
- test: | ||
- | | ||
# https://www.kernel.org/doc/html/v4.15/admin-guide/module-signing.html#signed-modules-and-stripping | ||
find /rootfs/lib/modules -name '*.ko' -exec grep -FL '~Module signature appended~' {} \+ | ||
finalize: | ||
- from: /rootfs | ||
to: /rootfs | ||
- from: /pkg/manifest.yaml | ||
to: / |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
VERSION: "{{ .BUILD_ARG_TAG }}" |