From bddfe6887f4ba94a8d5bc7ce4fb3fab2be8b2356 Mon Sep 17 00:00:00 2001 From: ndbrew <3947833+ndbrew@users.noreply.github.com> Date: Thu, 17 Aug 2023 12:56:01 -0700 Subject: [PATCH] feat: add device-mapper extension Add a new extension for device-mapper kernel drivers Signed-off-by: ndbrew <3947833+ndbrew@users.noreply.github.com> --- Makefile | 1 + storage/device-mapper/README.md | 17 +++++++++++++++++ storage/device-mapper/manifest.yaml | 10 ++++++++++ storage/device-mapper/pkg.yaml | 22 ++++++++++++++++++++++ storage/device-mapper/vars.yaml | 2 ++ 5 files changed, 52 insertions(+) create mode 100644 storage/device-mapper/README.md create mode 100644 storage/device-mapper/manifest.yaml create mode 100644 storage/device-mapper/pkg.yaml create mode 100644 storage/device-mapper/vars.yaml diff --git a/Makefile b/Makefile index 5549b649..bc8016de 100644 --- a/Makefile +++ b/Makefile @@ -42,6 +42,7 @@ TARGETS = \ amd-ucode \ bnx2-bnx2x \ btrfs \ + device-mapper \ drbd \ gasket-driver \ gvisor \ diff --git a/storage/device-mapper/README.md b/storage/device-mapper/README.md new file mode 100644 index 00000000..f232ec96 --- /dev/null +++ b/storage/device-mapper/README.md @@ -0,0 +1,17 @@ +# device-mapper + +This extension provides kernel modules needed for non-stock device-mapper functionality. + +## Installation + +Add the extension to your machine config and enable the modules. + +```yaml +machine: + install: + extensions: + - image: ghcr.io/siderolabs/device-mapper: + kernel: + modules: + - name: dm-thin-pool +``` \ No newline at end of file diff --git a/storage/device-mapper/manifest.yaml b/storage/device-mapper/manifest.yaml new file mode 100644 index 00000000..6a81cbb7 --- /dev/null +++ b/storage/device-mapper/manifest.yaml @@ -0,0 +1,10 @@ +version: v1alpha1 +metadata: + name: device-mapper + version: "$VERSION" + author: Nathan Brewer + description: | + This system extension provides extra device-mapper kernel module drivers. + compatibility: + talos: + version: ">= v1.5.0" diff --git a/storage/device-mapper/pkg.yaml b/storage/device-mapper/pkg.yaml new file mode 100644 index 00000000..74d90f0c --- /dev/null +++ b/storage/device-mapper/pkg.yaml @@ -0,0 +1,22 @@ +name: device-mapper +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//pkg/machinery/gendata/data/pkgs + - image: "{{ .PKGS_PREFIX }}/device-mapper-pkg:{{ .BUILD_ARG_PKGS }}" +steps: + - prepare: + - | + sed -i 's#$VERSION#{{ .VERSION }}#' /pkg/manifest.yaml + - install: + - | + mkdir -p /rootfs/lib/modules + + cp -R /lib/modules/* /rootfs/lib/modules +finalize: + - from: /rootfs + to: /rootfs + - from: /pkg/manifest.yaml + to: / diff --git a/storage/device-mapper/vars.yaml b/storage/device-mapper/vars.yaml new file mode 100644 index 00000000..df6cc8d5 --- /dev/null +++ b/storage/device-mapper/vars.yaml @@ -0,0 +1,2 @@ +# the first part is the driver version and the second the talos version for which the module is built against +VERSION: "{{ .BUILD_ARG_TAG }}"