Subject: [alpine-devel] [PATCH 1/4] features: raid: add mdadm files

From: Jesse Young <[email-masked]>
Date: Sun, 13 Sep 2015 15:41:46 -0500

---
 Makefile              | 1 +
 features.d/raid.files | 2 ++
 2 files changed, 3 insertions(+)
 create mode 100644 features.d/raid.files

diff --git a/Makefile b/Makefile
index ab50e8e..dc013de 100644
--- a/Makefile
+++ b/Makefile
@@ -32,6 +32,7 @@ CONF_FILES	:= mkinitfs.conf \
 		features.d/network.files \
 		features.d/network.modules \
 		features.d/ocfs2.modules \
+		features.d/raid.files\
 		features.d/raid.modules \
 		features.d/reiserfs.modules \
 		features.d/scsi.modules \
diff --git a/features.d/raid.files b/features.d/raid.files
new file mode 100644
index 0000000..c393dc4
--- /dev/null
+++ b/features.d/raid.files
@@ -0,0 +1,2 @@
+/etc/mdadm.conf
+/sbin/mdadm
-- 
2.4.1

---
Unsubscribe:  [email-masked]
Help:         [email-masked]
---

---

From: Jesse Young <[email-masked]>
Date: Sun, 13 Sep 2015 15:41:47 -0500

mdadm otherwise complains about not being able to lock
/run/mdadm/map.lock
---
 mkinitfs.in | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/mkinitfs.in b/mkinitfs.in
index 04dc99c..ced6792 100755
--- a/mkinitfs.in
+++ b/mkinitfs.in
@@ -36,7 +36,7 @@ feature_files() {
 
 initfs_base() {
 	local i= dirs= glob= file=
-	for i in dev proc sys sbin bin .modloop lib/modules media/cdrom \
+	for i in dev proc sys sbin bin run .modloop lib/modules media/cdrom \
 	    etc/apk media/floppy media/usb newroot; do
 		dirs="$dirs $tmpdir/$i"
 	done
-- 
2.4.1

---

---

From: Jesse Young <[email-masked]>
Date: Sun, 13 Sep 2015 15:41:48 -0500

---
 initramfs-init.in | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/initramfs-init.in b/initramfs-init.in
index d687e64..78500aa 100755
--- a/initramfs-init.in
+++ b/initramfs-init.in
@@ -227,12 +227,14 @@ setup_inittab_console(){
 
 start_raid() {
 	local n= i=
+	local mdadm_flags=
 	case "$KOPT_root" in
 		/dev/md*) n=${KOPT_root#/dev/md} ;;
 	esac
 	case "$KOPT_autoraid" in
 		[0-9]*) n="$n $(echo $KOPT_autoraid | tr ',' ' ')" ;;
 	esac
+	[ "$KOPT_quiet" = yes ] && mdadm_flags="$mdadm_flags -q"
 	# if kernel can autostart the raid he will
 	for i in $n; do
 		mknod /dev/md$i b 9 $i
@@ -241,7 +243,7 @@ start_raid() {
 	# kernel cannot autostart newer versions of mdadm metadata
 	# so we also check if mdadm binary is there
 	if [ -x /sbin/mdadm ]; then
-		mdadm --assemble --scan
+		mdadm $mdadm_flags --assemble --scan
 	fi
 }
 
-- 
2.4.1

---

---

From: Jesse Young <[email-masked]>
Date: Sun, 13 Sep 2015 15:41:49 -0500

---
 features.d/lvm.modules | 1 +
 1 file changed, 1 insertion(+)

diff --git a/features.d/lvm.modules b/features.d/lvm.modules
index 92f0721..3af8ef9 100644
--- a/features.d/lvm.modules
+++ b/features.d/lvm.modules
@@ -1 +1,2 @@
 kernel/drivers/md/dm-mod.ko
+kernel/drivers/md/dm-snapshot.ko
-- 
2.4.1

---