Skip to content

Commit d1213cb

Browse files
committed
Add multipath-tools and Trident CSI iSCSI support
1 parent c5e0d1b commit d1213cb

File tree

12 files changed

+247
-1
lines changed

12 files changed

+247
-1
lines changed

.kres.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ spec:
3333
- mdadm
3434
- mei
3535
- metal-agent
36+
- multipath-tools
3637
- nebula
3738
- netbird
3839
- newt
@@ -58,6 +59,7 @@ spec:
5859
- tailscale
5960
- tenstorrent
6061
- thunderbolt
62+
- trident-iscsi-tools
6163
- uinput
6264
- usb-modem-drivers
6365
- usb-audio-drivers

Makefile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,7 @@ TARGETS += lldpd
9090
TARGETS += mdadm
9191
TARGETS += mei
9292
TARGETS += metal-agent
93+
TARGETS += multipath-tools
9394
TARGETS += nebula
9495
TARGETS += netbird
9596
TARGETS += newt
@@ -115,6 +116,7 @@ TARGETS += stargz-snapshotter
115116
TARGETS += tailscale
116117
TARGETS += tenstorrent
117118
TARGETS += thunderbolt
119+
TARGETS += trident-iscsi-tools
118120
TARGETS += uinput
119121
TARGETS += usb-modem-drivers
120122
TARGETS += usb-audio-drivers
@@ -293,4 +295,3 @@ release-notes: $(ARTIFACTS)
293295
conformance:
294296
@docker pull $(CONFORMANCE_IMAGE)
295297
@docker run --rm -it -v $(PWD):/src -w /src $(CONFORMANCE_IMAGE) enforce
296-

storage/multipath-tools/bindings

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# Multipath bindings, Version : 1.0
2+
# NOTE: this file is automatically maintained by the multipath program.
3+
# You should not need to edit this file in normal circumstances.
4+
#
5+
# Format:
6+
# alias wwid
7+
#
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: multipath-tools
4+
version: "{{ .VERSION }}"
5+
author: Institute for Networks and Security (INS) at OST
6+
description: |
7+
[{{ .TIER }}] This system extension provides multipath-tools.
8+
compatibility:
9+
talos:
10+
version: ">= v1.9.0"
Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
name: multipathd
2+
container:
3+
security:
4+
maskedPaths: []
5+
readonlyPaths: []
6+
writeableRootfs: true
7+
entrypoint: /usr/local/sbin/multipathd
8+
args:
9+
- -d
10+
- -v3
11+
mounts:
12+
# ld-musl-x86_64.so.1
13+
- source: /lib
14+
destination: /lib
15+
type: bind
16+
options:
17+
- bind
18+
- ro
19+
# /etc/multipath.conf /etc/multipath/bindings
20+
- source: /usr/local/lib/containers/multipathd/etc
21+
destination: /etc
22+
type: bind
23+
options:
24+
- bind
25+
- rw
26+
# libs
27+
- source: /usr/local/lib/
28+
destination: /usr/local/lib/
29+
type: bind
30+
options:
31+
- bind
32+
- ro
33+
# /user/bin
34+
- source: /usr/local/bin
35+
destination: /usr/local/bin
36+
type: bind
37+
options:
38+
- bind
39+
- ro
40+
- source: /usr/local/sbin
41+
destination: /usr/local/sbin
42+
type: bind
43+
options:
44+
- bind
45+
- ro
46+
# /dev/mapper and multipath disk
47+
- source: /dev
48+
destination: /dev
49+
type: bind
50+
options:
51+
- bind
52+
- rw
53+
- source: /sys
54+
destination: /sys
55+
type: bind
56+
options:
57+
- bind
58+
- rw
59+
depends:
60+
- network:
61+
- addresses
62+
- connectivity
63+
- hostname
64+
- etcfiles
65+
- service: udevd
66+
- path: /dev/mapper/control
67+
- service: cri
68+
# - configuration: true
69+
restart: always
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
diff --git a/Makefile.inc b/Makefile.inc
2+
index 729618bd..91118ec9 100644
3+
--- a/Makefile.inc
4+
+++ b/Makefile.inc
5+
@@ -115,8 +115,7 @@ CPPFLAGS := $(FORTIFY_OPT) $(CPPFLAGS) $(D_URCU_VERSION) \
6+
-DRUNTIME_DIR=\"$(runtimedir)\" -DCONFIG_DIR=\"$(TGTDIR)$(configdir)\" \
7+
-DDEFAULT_CONFIGFILE=\"$(TGTDIR)$(configfile)\" -DSTATE_DIR=\"$(TGTDIR)$(statedir)\" \
8+
-DEXTRAVERSION=\"$(EXTRAVERSION)\" -MMD -MP
9+
-CFLAGS := -std=gnu99 $(CFLAGS) $(OPTFLAGS) $(WARNFLAGS) -pipe \
10+
- -fexceptions
11+
+CFLAGS := -std=gnu99 $(CFLAGS) $(OPTFLAGS) $(WARNFLAGS) -pipe
12+
BIN_CFLAGS := -fPIE -DPIE
13+
LIB_CFLAGS := -fPIC
14+
SHARED_FLAGS := -shared

storage/multipath-tools/pkg.yaml

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
name: multipath-tools
2+
variant: scratch
3+
shell: /bin/bash
4+
dependencies:
5+
- stage: base
6+
- image: "{{ .BUILD_ARG_PKGS_PREFIX }}/systemd-udevd:{{ .BUILD_ARG_PKGS }}"
7+
- image: "{{ .BUILD_ARG_PKGS_PREFIX }}/libjson-c:{{ .BUILD_ARG_PKGS }}"
8+
- image: "{{ .BUILD_ARG_PKGS_PREFIX }}/lvm2:{{ .BUILD_ARG_PKGS }}"
9+
- image: "{{ .BUILD_ARG_PKGS_PREFIX }}/liburcu:{{ .BUILD_ARG_PKGS }}"
10+
- image: "{{ .BUILD_ARG_PKGS_PREFIX }}/libaio:{{ .BUILD_ARG_PKGS }}"
11+
steps:
12+
- sources:
13+
- url: https://github.com/opensvc/multipath-tools/archive/refs/tags/{{ .MULTIPATH_TOOLS_VERSION }}.tar.gz
14+
destination: multipath-tools.tar.gz
15+
sha256: {{ .MULTIPATH_TOOLS_SHA256 }}
16+
sha512: {{ .MULTIPATH_TOOLS_SHA512 }}
17+
env:
18+
PKG_CONFIG_PATH: /usr/lib/pkgconfig
19+
prepare:
20+
- |
21+
sed -i 's#$VERSION#{{ .VERSION }}#' /pkg/manifest.yaml
22+
- |
23+
tar -xzf multipath-tools.tar.gz --strip-components=1
24+
# This removes a dependency on libgcc
25+
- |
26+
patch -p1 < /pkg/patches/disable-exception-handling.patch
27+
build:
28+
- |
29+
make -j $(nproc) prefix="/usr/local" \
30+
sysconfdir="/etc" \
31+
configdir="/etc/multipath/conf.d" \
32+
mandir="/usr/share/man" \
33+
infodir="/usr/share/info" \
34+
statedir="/etc/multipath" \
35+
etc_prefix="" \
36+
LIB=lib \
37+
SYSTEMD=""
38+
install:
39+
- |
40+
mkdir -p /rootfs/usr/local/lib/containers/multipathd/etc/multipath
41+
cp /pkg/bindings /rootfs/usr/local/lib/containers/multipathd/etc/multipath/bindings
42+
make prefix="/usr/local" DESTDIR=/rootfs LIB=lib install
43+
- |
44+
mkdir -p /rootfs/usr/local/etc/containers
45+
cp /pkg/multipathd.yaml /rootfs/usr/local/etc/containers/
46+
# Remove kernel module loading config
47+
- |
48+
rm /rootfs/usr/lib/modules-load.d/multipath.conf
49+
rmdir /rootfs/usr/lib/modules-load.d
50+
# Remove unnecessary docs and includes
51+
- |
52+
rm -rf /rootfs/usr/local/share
53+
rm -rf /rootfs/usr/local/include
54+
# This file tries to create a tmpfs mount at `/var/run/multipath`.
55+
- |
56+
rm /rootfs/usr/lib/tmpfiles.d/multipath.conf
57+
rmdir /rootfs/usr/lib/tmpfiles.d
58+
# Removed but might be needed by other users of multipath-tools
59+
- |
60+
rm /rootfs/usr/lib/udev/kpartx_id
61+
test:
62+
- |
63+
mkdir -p /extensions-validator-rootfs
64+
cp -r /rootfs/ /extensions-validator-rootfs/rootfs
65+
cp /pkg/manifest.yaml /extensions-validator-rootfs/manifest.yaml
66+
/extensions-validator validate --rootfs=/extensions-validator-rootfs --pkg-name="${PKG_NAME}"
67+
finalize:
68+
- from: /rootfs
69+
to: /rootfs
70+
- from: /pkg/manifest.yaml
71+
to: /

storage/multipath-tools/vars.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
VERSION: v0.0.1
2+
3+
# renovate: datasource=git-tags extractVersion=^multipath-tools-(?<version>.*)$ depName=git://https://github.com/opensvc/multipath-tools.git
4+
MULTIPATH_TOOLS_VERSION: 0.10.0
5+
MULTIPATH_TOOLS_SHA256: f2e67a1d2167f3945afab6f0697207a03678f5b2bd80f1f45958c6fa1dfb8eef
6+
MULTIPATH_TOOLS_SHA512: 8f545609fa20df7547428f2929571dc0df87c17d9f61f11aad3559446c2e94755e18b1c4b3780b3de92ec2cbc450939ca15a9d6c95551eee4084064d83874b2d
7+
8+
TIER: "contrib"
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: trident-iscsi-tools
4+
version: "{{ .VERSION }}"
5+
author: Institute for Networks and Security (INS) at OST
6+
description: |
7+
[{{ .TIER }}] This system extension provides the tools and binaries used by the NetApp Trident CSI for iSCSI. It contains lsscsi, ls, free, pgrep, cat and dd.
8+
compatibility:
9+
talos:
10+
version: ">= v1.9.0"
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
name: trident-iscsi-tools
2+
variant: scratch
3+
shell: /bin/bash
4+
dependencies:
5+
- stage: base
6+
steps:
7+
- sources:
8+
- url: "https://sg.danny.cz/scsi/lsscsi-{{ .LSSCSI_VERSION }}.tar.gz"
9+
destination: lsscsi.tar.gz
10+
sha256: {{ .LSSCSI_SHA256 }}
11+
sha512: {{ .LSSCSI_SHA512 }}
12+
prepare:
13+
- |
14+
sed -i 's#$VERSION#{{ .VERSION }}#' /pkg/manifest.yaml
15+
- |
16+
tar -xzf lsscsi.tar.gz --strip-components=1
17+
build:
18+
- |
19+
./configure --prefix=/usr/local --exec-prefix=/usr/local
20+
# make -j $(nproc) DESTDIR=/rootfs
21+
install:
22+
- |
23+
make DESTDIR=/rootfs install
24+
# Remove man pages and info pages to save space
25+
- |
26+
rm -rf /rootfs/usr/local/share
27+
- |
28+
mkdir -p /rootfs/usr/local/bin
29+
mkdir -p /rootfs/usr/local/sbin
30+
cp /usr/bin/ls /rootfs/usr/local/bin
31+
cp /usr/bin/free /rootfs/usr/local/bin
32+
cp /usr/bin/pgrep /rootfs/usr/local/bin
33+
cp /usr/bin/cat /rootfs/usr/local/bin
34+
cp /usr/bin/dd /rootfs/usr/local/bin
35+
cp /usr/sbin/blockdev /rootfs/usr/local/sbin
36+
test:
37+
- |
38+
mkdir -p /extensions-validator-rootfs
39+
cp -r /rootfs/ /extensions-validator-rootfs/rootfs
40+
cp /pkg/manifest.yaml /extensions-validator-rootfs/manifest.yaml
41+
/extensions-validator validate --rootfs=/extensions-validator-rootfs --pkg-name="${PKG_NAME}"
42+
finalize:
43+
- from: /rootfs
44+
to: /rootfs
45+
- from: /pkg/manifest.yaml
46+
to: /

0 commit comments

Comments
 (0)