Disable automatic 'ATA over Ethernet discovery'
authorMichael Prokop <mika@grml.org>
Thu, 18 May 2017 15:00:41 +0000 (17:00 +0200)
committerMichael Prokop <mika@grml.org>
Thu, 18 May 2017 15:05:21 +0000 (17:05 +0200)
/usr/lib/modules-load.d/aoetools.conf by default contains:

| ## If you need to restrict the interfaces aoe will use, copy this
| ## file to /etc/modules-load.d/ and use this example:
| # aoe aoe_iflist="eth0,eth1"
|
| ## Load aoe driver with no interface restriction:
| aoe

and /lib/systemd/system/aoe-discover.service contains:

| [Unit]
| Description=ATA over Ethernet discovery
| BindsTo=sys-devices-virtual-aoe-discover.device
| DefaultDependencies=no
| Conflicts=shutdown.target
| After=network-online.target
|
| [Service]
| Type=oneshot
| ExecStart=/sbin/aoe-discover

Since the aeotools.conf file tells systemd to load the aoe module
which then triggers the udev rule we end up with automatic
aoe-discover execution on default Grml boot, even though we
disable the aoe-discover service (since enabling/disabling only
affects starting via transitive dependencies, but the udev rule
is doing the equivalent of `systemctl start $unit`). By removing
/usr/lib/modules-load.d/aoetools.conf we ensure that automatic
'ATA over Ethernet discovery' is NOT executed, though if a user
runs 'modprobe aoe' it executes aoe-discover as intended.

Thanks: Felipe Sateler + Darshaka Pathirana for help in coming up with a solution
Closes grml/grml#32

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

diff --git a/etc/grml/fai/config/scripts/GRMLBASE/55-aoetools b/etc/grml/fai/config/scripts/GRMLBASE/55-aoetools
new file mode 100755 (executable)
index 0000000..fdabd22
--- /dev/null
@@ -0,0 +1,21 @@
+#!/bin/bash
+# Filename:      ${GRML_FAI_CONFIG}/config/scripts/GRMLBASE/55-aoetools
+# Purpose:       adjust aoetools 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/modules-load.d/aoetools.conf" ] ; then
+  echo "File /usr/lib/modules-load.d/aoetools.conf doesn't exist, skipping execution of script."
+  exit 0
+fi
+
+echo "Removing /usr/lib/modules-load.d/aoetools.conf to avoid automatic aoe discovery"
+rm -f "${target}/usr/lib/modules-load.d/aoetools.conf"
+
+## END OF FILE #################################################################
+# vim:ft=sh expandtab ai tw=80 tabstop=4 shiftwidth=2