Browse Source

batman: Remove legacy magic to install BATMAN v14 modules.

Signed-off-by: Maximilian Wilhelm <max@sdn.clinic>
Maximilian Wilhelm 5 years ago
parent
commit
f27c9c0624
3 changed files with 0 additions and 143 deletions
  1. 0 70
      batman/ff_fix_batman
  2. 0 14
      batman/ff_fix_batman.service
  3. 0 59
      batman/init.sls

+ 0 - 70
batman/ff_fix_batman

@@ -1,70 +0,0 @@
-#!/bin/sh
-#
-# Maximilian Wilhelm <max@rfc2324.org>
-#  --  Thu 07 Jul 2016 03:28:44 PM CEST
-#
-# Make sure that the correct B.A.T.M.A.N version is installed on this machine,
-# reconfigure batman interfaces and restart services depending on batman (alfred
-# and fastd). Beware that this restarts ALL fastd instances. As we are only using
-# fastd for batman'ish things currently, that's fine.
-#
-
-batman_version_wanted="2013.4.0"
-
-# Bail on error
-set -e
-
-only_fix_module=false
-if [ "$1" = "--only-fix-module" ]; then
-	only_fix_module=true
-fi
-export only_fix_module
-
-batman_version_installed=$(modinfo batman-adv | awk -F: '/^version:/ { print $2 }' | tr -d '[:space:]')
-my_name="ff_fix_batman"
-logfile="/var/log/ff_fix_batman-$(date +%Y.%m.%d-%H:%M).log"
-
-if [ "${batman_version_wanted}" = "${batman_version_installed}" ]; then
-	msg="Version ${batman_version_wanted} of batman-adv already installed."
-	echo ${msg}
-	logger -t "${my_name}" "${msg}"
-	exit 0
-fi
-
-msg="Version ${batman_version_wanted} of batman-adv wanted, but ${batman_version_installed} found. Fixing, see ${logfile} for details."
-echo "${msg}"
-logger -t "${my_name}" "${msg}"
-
-(
-
-# Be safe and shutdown all batman interfaces before removing the module
-for iface in $(ip l | awk -F: '/^[0-9]/ { print $2 }' | tr -d ' ' | grep ^bat); do
-	ifdown "${iface}" || true
-done
-
-if lsmod | grep batman-adv; then
-	rmmod batman-adv
-fi
-
-dkms remove  "batman-adv/${batman_version_wanted}" --all || true
-dkms install "batman-adv/${batman_version_wanted}" --force
-
-# Load the newly compiled B.A.T.M.A.N. module
-modprobe batman-adv
-
-if [ ! "${only_fix_module}" ]; then
-	# Configure all B.A.T.M.A.N. broken before
-	ifup -a
-	
-	# Restart fastd, if installed
-	if dpkg -l fastd >/dev/null 2>/dev/null; then
-		service fastd restart
-	fi
-	
-	# Restart alfred, if installed
-	if dpkg -l alfred >/dev/null 2>/dev/null; then
-		service alfred restart
-	fi
-fi
-
-) >>"${logfile}" 2>>"${logfile}"

+ 0 - 14
batman/ff_fix_batman.service

@@ -1,14 +0,0 @@
-[Unit]
-Description=Fix B.A.T.M.A.N. Kernel module version
-ConditionFileIsExecutable=/usr/local/sbin/ff_fix_batman
-Before=network.target
-
-[Service]
-Type=forking
-ExecStart=/usr/local/sbin/ff_fix_batman --only-fix-module
-TimeoutSec=0
-RemainAfterExit=yes
-SysVStartPriority=99
-
-[Install]
-WantedBy=multi-user.target

+ 0 - 59
batman/init.sls

@@ -22,52 +22,6 @@ batctl:
     - template: jinja
 
 
-  {% if salt['ffho.re_search'] ('-v14', grains['id']) %}
-batman-adv-dkms:
-  pkg.installed:
-    - require:
-      - pkgrepo: apt-neoraider
-
-# The ff_fix_batman script ensures that the preferred (currently older) version
-# of the batman_adv kernel module is compiled via DKMS and installed into the
-# system.
-/usr/local/sbin/ff_fix_batman:
-  file.managed:
-    - source: salt://batman/ff_fix_batman
-    - user: root
-    - group: root
-    - mode: 744
-    - require:
-      - pkg: batctl
-
-ff_fix_batman:
-  cmd.wait:
-    - name: /usr/local/sbin/ff_fix_batman
-    - require:
-      - file: /usr/local/sbin/ff_fix_batman
-    - watch:
-      - pkg: batman-adv-dkms
-
-
-# Install and enable a ff-fix-batman service which runs at boot time
-# to fix the kernel module after a kernel upgrade + reboot if neccessary.
-/lib/systemd/system/ff-fix-batman.service:
-  file.managed:
-    - source: salt://batman/ff_fix_batman.service
-    - user: root
-    - group: root
-    - mode: 644
-    - require:
-      - file: /usr/local/sbin/ff_fix_batman
-
-enable-ff-fix-batman-service:
-  service.enabled:
-    - name: ff-fix-batman
-    - require:
-      - file: /lib/systemd/system/ff-fix-batman.service
-
-  {% endif %}
-
 # Make sure the batman_adv module is loaded at boot time
 /etc/modules-load.d/batman-adv.conf:
   file.managed:
@@ -104,19 +58,6 @@ batctl:
 batman-adv-dkms:
   pkg.purged
 
-/usr/local/sbin/ff_fix_batman:
-  file.absent
-
-disable-ff-fix-batman-service:
-  service.disabled:
-    - name: ff-fix-batman
-
-/lib/systemd/system/ff-fix-batman.service:
-  file.absent
-
-/etc/modules-load.d/batman-adv.conf:
-  file.absent
-
 /etc/bat-hosts:
   file.absent