Package: mdadm
Version: 3.3.2-5
Severity: important
Tags: patch

/lib/udev/rules.d/64-md-raid-assembly.rules says:

# remember you can limit what gets auto/incrementally assembled by
# mdadm.conf(5)'s 'AUTO' and selectively whitelist using 'ARRAY'

However, in an initramfs, AUTO lines are NOT copied from /etc/mdadm/mdadm.conf.
In /usr/share/initramfs-tools/hooks/mdadm, install_config contains:

# only copy ARRAY/DEVICE/HOMEHOST lines, and merge continuation lines into one

Disabling auto-assembly won't work, which can make the system 
unbootable/unworkable,
for instance if you have multiple filesystems having the same label.

Trivial patch included.


-- System Information:
Debian Release: 8.0
  APT prefers stable-updates
  APT policy: (500, 'stable-updates'), (500, 'stable')
Architecture: amd64 (x86_64)

Kernel: Linux 3.16.0-4-amd64 (SMP w/12 CPU cores)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)
diff -ru mdadm-3.3.2/debian/initramfs/hook mdadm-3.3.2~/debian/initramfs/hook
--- mdadm-3.3.2/debian/initramfs/hook	2014-10-04 18:27:41.000000000 +0200
+++ mdadm-3.3.2~/debian/initramfs/hook	2015-05-12 13:07:41.000000000 +0200
@@ -90,9 +90,9 @@
 {
   # install the configuration file
   mkdir -p ${2%/*}
-  # only copy ARRAY/DEVICE/HOMEHOST lines, and merge continuation lines into one
+  # only copy ARRAY/DEVICE/HOMEHOST/AUTO lines, and merge continuation lines into one
   if [ -f "$1" ] ; then
-    sed -e :a -re '$!N;s/\n[[:space:]]+/ /;ta' -ne '/^(ARRAY|DEVICE|HOMEHOST)/P;D' $1 > $2
+    sed -e :a -re '$!N;s/\n[[:space:]]+/ /;ta' -ne '/^(ARRAY|DEVICE|HOMEHOST|AUTO)/P;D' $1 > $2
   fi
 }
 

Reply via email to