Skip to content

Commit

Permalink
feat(mdadm): configure mdadm.conf path for use with extensionconfig
Browse files Browse the repository at this point in the history
  • Loading branch information
Thomas Rosenstein committed Jul 18, 2024
1 parent b48d3a6 commit 7a3866f
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 2 deletions.
2 changes: 1 addition & 1 deletion storage/mdadm/files/udev-md-raid-arrays.rules
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ TEST!="md/array_state", GOTO="md_end"
ATTR{md/array_state}=="clear*|inactive", GOTO="md_end"
LABEL="md_ignore_state"

IMPORT{program}="/usr/local/sbin/mdadm --detail --no-devices --export $devnode"
IMPORT{program}="/usr/local/sbin/mdadm --detail -c /usr/local/etc/mdadm.conf --no-devices --export $devnode"
ENV{DEVTYPE}=="disk", ENV{MD_NAME}=="?*", SYMLINK+="disk/by-id/md-name-$env{MD_NAME}", OPTIONS+="string_escape=replace"
ENV{DEVTYPE}=="disk", ENV{MD_UUID}=="?*", SYMLINK+="disk/by-id/md-uuid-$env{MD_UUID}"
ENV{DEVTYPE}=="disk", ENV{MD_DEVNAME}=="?*", SYMLINK+="md/$env{MD_DEVNAME}"
Expand Down
2 changes: 1 addition & 1 deletion storage/mdadm/files/udev-md-raid-assembly.rules
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ LABEL="md_inc"

# remember you can limit what gets auto/incrementally assembled by
# mdadm.conf(5)'s 'AUTO' and selectively whitelist using 'ARRAY'
ACTION=="add|change", IMPORT{program}="/usr/local/sbin/mdadm --incremental --export $devnode --offroot $env{DEVLINKS}"
ACTION=="add|change", IMPORT{program}="/usr/local/sbin/mdadm --incremental -c /usr/local/etc/mdadm.conf --export $devnode --offroot $env{DEVLINKS}"
ACTION=="remove", ENV{ID_PATH}=="?*", RUN+="/usr/local/sbin/mdadm -If $name --path $env{ID_PATH}"
ACTION=="remove", ENV{ID_PATH}!="?*", RUN+="/usr/local/sbin/mdadm -If $name"

Expand Down
11 changes: 11 additions & 0 deletions storage/mdadm/patches/change-sysconfdir.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
--- mdadm.orig/Makefile
+++ mdadm/Makefile
@@ -89,7 +89,7 @@

PKG_CONFIG ?= pkg-config

-SYSCONFDIR = /etc
+SYSCONFDIR = /usr/local/etc
CONFFILE = $(SYSCONFDIR)/mdadm.conf
CONFFILE2 = $(SYSCONFDIR)/mdadm/mdadm.conf
MAILCMD =/usr/sbin/sendmail -t
2 changes: 2 additions & 0 deletions storage/mdadm/pkg.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,13 @@ steps:
patch -p1 < /pkg/patches/no-werror.patch
patch -p1 < /pkg/patches/musl-125.patch
patch -p1 < /pkg/patches/exit-gracefully-when-md-device-not-found.patch
patch -p1 < /pkg/patches/change-sysconfdir.patch
build:
- |
mkdir -p /run/mdadm
CXFLAGS=-D_LARGEFILE64_SOURCE \
make -j $(nproc) mdadm
make -j $(nproc) mdmon
install:
Expand Down

0 comments on commit 7a3866f

Please sign in to comment.