Skip to content

Commit bddfe68

Browse files
ndbrewndbrew
authored andcommitted
feat: add device-mapper extension
Add a new extension for device-mapper kernel drivers Signed-off-by: ndbrew <3947833+ndbrew@users.noreply.github.com>
1 parent 0284425 commit bddfe68

5 files changed

Lines changed: 52 additions & 0 deletions

File tree

Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ TARGETS = \
4242
amd-ucode \
4343
bnx2-bnx2x \
4444
btrfs \
45+
device-mapper \
4546
drbd \
4647
gasket-driver \
4748
gvisor \

storage/device-mapper/README.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# device-mapper
2+
3+
This extension provides kernel modules needed for non-stock device-mapper functionality.
4+
5+
## Installation
6+
7+
Add the extension to your machine config and enable the modules.
8+
9+
```yaml
10+
machine:
11+
install:
12+
extensions:
13+
- image: ghcr.io/siderolabs/device-mapper:<VERSION>
14+
kernel:
15+
modules:
16+
- name: dm-thin-pool
17+
```
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
version: v1alpha1
2+
metadata:
3+
name: device-mapper
4+
version: "$VERSION"
5+
author: Nathan Brewer
6+
description: |
7+
This system extension provides extra device-mapper kernel module drivers.
8+
compatibility:
9+
talos:
10+
version: ">= v1.5.0"

storage/device-mapper/pkg.yaml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
name: device-mapper
2+
variant: scratch
3+
shell: /toolchain/bin/bash
4+
dependencies:
5+
- stage: base
6+
# The pkgs version for a particular release of Talos as defined in
7+
# https://github.com/siderolabs/talos/blob/<talos version>/pkg/machinery/gendata/data/pkgs
8+
- image: "{{ .PKGS_PREFIX }}/device-mapper-pkg:{{ .BUILD_ARG_PKGS }}"
9+
steps:
10+
- prepare:
11+
- |
12+
sed -i 's#$VERSION#{{ .VERSION }}#' /pkg/manifest.yaml
13+
- install:
14+
- |
15+
mkdir -p /rootfs/lib/modules
16+
17+
cp -R /lib/modules/* /rootfs/lib/modules
18+
finalize:
19+
- from: /rootfs
20+
to: /rootfs
21+
- from: /pkg/manifest.yaml
22+
to: /

storage/device-mapper/vars.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# the first part is the driver version and the second the talos version for which the module is built against
2+
VERSION: "{{ .BUILD_ARG_TAG }}"

0 commit comments

Comments
 (0)