summaryrefslogtreecommitdiffstats
path: root/main/alpine-conf/0002-setup-disk-add-raidmodules-to-etc-modules-if-needed.patch
blob: 08c2964f3e3ac14f02e129276843b24319b4ba4f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
From 1a62591fa4176e9068e89f52194c4bac29e529a0 Mon Sep 17 00:00:00 2001
From: Natanael Copa <ncopa@alpinelinux.org>
Date: Tue, 3 May 2011 08:34:01 +0000
Subject: [PATCH 2/2] setup-disk: add raidmodules to /etc/modules if needed

---
 setup-disk.in |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/setup-disk.in b/setup-disk.in
index ffbbc43..b27f76b 100644
--- a/setup-disk.in
+++ b/setup-disk.in
@@ -564,12 +564,20 @@ setup_var() {
 	rmdir /.var
 
 	/etc/init.d/syslog --quiet restart
+	setup_mdadm_conf
 }
 
 setup_mdadm_conf() {
+	local mods= mod=
 	if [ -n "$USE_RAID" ]; then
 		mdadm --detail --scan > /etc/mdadm.conf
 		rc-update --quiet add mdadm-raid boot
+		mods=$(awk '/^raid/ {print $1}' /proc/modules)
+		for mod in $mods; do
+			if ! grep -q "^$mod" /etc/modules; then
+				echo $mod >> /etc/modules
+			fi
+		done
 	fi
 }
 
-- 
1.7.4.5