Delete /usr/lib/udev/rules.d/64-md-raid-assembly.rules to avoid automatic mdadm scanning
authorMichael Prokop <mika@grml.org>
Fri, 26 May 2017 21:20:44 +0000 (23:20 +0200)
committerMichael Prokop <mika@grml.org>
Fri, 26 May 2017 21:20:44 +0000 (23:20 +0200)
We don't want to automatically enable any present mdadm devices.
The safest way is to just remove
/usr/lib/udev/rules.d/64-md-raid-assembly.rules, since it doesn't
seem to provide a stable and long-term working way how to adjust
its behavior.

Closes grml/grml#45

etc/grml/fai/config/scripts/GRMLBASE/52-mdadm [new file with mode: 0755]

diff --git a/etc/grml/fai/config/scripts/GRMLBASE/52-mdadm b/etc/grml/fai/config/scripts/GRMLBASE/52-mdadm
new file mode 100755 (executable)
index 0000000..c54e00f
--- /dev/null
@@ -0,0 +1,21 @@
+#!/bin/bash
+# Filename:      ${GRML_FAI_CONFIG}/config/scripts/GRMLBASE/52-mdadm
+# Purpose:       adjust mdadm configuration
+# Authors:       grml-team (grml.org), (c) Michael Prokop <mika@grml.org>
+# Bug-Reports:   see http://grml.org/bugs/
+# License:       This file is licensed under the GPL v2 or any later version.
+################################################################################
+
+set -u
+set -e
+
+if ! [ -r "${target}/usr/lib/udev/rules.d/64-md-raid-assembly.rules" ] ; then
+  echo "File /usr/lib/udev/rules.d/64-md-raid-assembly.rules doesn't exist, skipping execution of script."
+  exit 0
+fi
+
+echo "Removing /usr/lib/udev/rules.d/64-md-raid-assembly.rules to avoid automatic mdadm scanning"
+rm -f "${target}/usr/lib/udev/rules.d/64-md-raid-assembly.rules"
+
+## END OF FILE #################################################################
+# vim:ft=sh expandtab ai tw=80 tabstop=4 shiftwidth=2