Harald Hoyer d9da66
From 3a6a8d5c83af952f66c7786f17e59da6012da0b6 Mon Sep 17 00:00:00 2001
Harald Hoyer d9da66
From: Harald Hoyer <harald@hoyer.xyz>
Harald Hoyer d9da66
Date: Thu, 11 Jan 2018 12:34:40 +0100
Harald Hoyer d9da66
Subject: [PATCH] Merge pull request #346 from danimo/95dcssblk
Harald Hoyer d9da66
Harald Hoyer d9da66
95dcssblk: Add new module for DCSS block devices
Harald Hoyer d9da66
---
Harald Hoyer d9da66
 modules.d/95dcssblk/module-setup.sh  | 28 ++++++++++++++++++++++++++++
Harald Hoyer d9da66
 modules.d/95dcssblk/parse-dcssblk.sh |  8 ++++++++
Harald Hoyer d9da66
 2 files changed, 36 insertions(+)
Harald Hoyer d9da66
Harald Hoyer d9da66
diff --git a/modules.d/95dcssblk/module-setup.sh b/modules.d/95dcssblk/module-setup.sh
Harald Hoyer d9da66
new file mode 100644
Harald Hoyer d9da66
index 00000000..11e38490
Harald Hoyer d9da66
--- /dev/null
Harald Hoyer d9da66
+++ b/modules.d/95dcssblk/module-setup.sh
Harald Hoyer d9da66
@@ -0,0 +1,28 @@
Harald Hoyer d9da66
+#!/bin/bash
Harald Hoyer d9da66
+# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
Harald Hoyer d9da66
+# ex: ts=8 sw=4 sts=4 et filetype=sh
Harald Hoyer d9da66
+
Harald Hoyer d9da66
+# called by dracut
Harald Hoyer d9da66
+check() {
Harald Hoyer d9da66
+    local _arch=$(uname -m)
Harald Hoyer d9da66
+    [ "$_arch" = "s390" -o "$_arch" = "s390x" ] || return 1
Harald Hoyer d9da66
+    return 0
Harald Hoyer d9da66
+}
Harald Hoyer d9da66
+
Harald Hoyer d9da66
+# called by dracut
Harald Hoyer d9da66
+installkernel() {
Harald Hoyer d9da66
+    if [ -e /sys/devices/dcssblk/*/block/dcssblk* ];then
Harald Hoyer d9da66
+	hostonly='' instmods dcssblk
Harald Hoyer d9da66
+    fi
Harald Hoyer d9da66
+}
Harald Hoyer d9da66
+
Harald Hoyer d9da66
+# called by dracut
Harald Hoyer d9da66
+install() {
Harald Hoyer d9da66
+    inst_hook cmdline 30 "$moddir/parse-dcssblk.sh"
Harald Hoyer d9da66
+    # If there is a config file which contains avail (best only of root device)
Harald Hoyer d9da66
+    # disks to activate add it and use it during boot -> then we do not need
Harald Hoyer d9da66
+    # a kernel param anymore
Harald Hoyer d9da66
+    #if [[ $hostonly ]]; then
Harald Hoyer d9da66
+    #    inst /etc/dcssblk.conf
Harald Hoyer d9da66
+    #fi
Harald Hoyer d9da66
+}
Harald Hoyer d9da66
diff --git a/modules.d/95dcssblk/parse-dcssblk.sh b/modules.d/95dcssblk/parse-dcssblk.sh
Harald Hoyer d9da66
new file mode 100644
Harald Hoyer d9da66
index 00000000..8f174408
Harald Hoyer d9da66
--- /dev/null
Harald Hoyer d9da66
+++ b/modules.d/95dcssblk/parse-dcssblk.sh
Harald Hoyer d9da66
@@ -0,0 +1,8 @@
Harald Hoyer d9da66
+#!/bin/sh
Harald Hoyer d9da66
+# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
Harald Hoyer d9da66
+# ex: ts=8 sw=4 sts=4 et filetype=sh
Harald Hoyer d9da66
+dcssblk_arg=$(getarg rd.dcssblk=)
Harald Hoyer d9da66
+if [ $? == 0 ];then
Harald Hoyer d9da66
+	info "Loading dcssblk segments=$dcssblk_arg"
Harald Hoyer d9da66
+	modprobe dcssblk segments=$dcssblk_arg
Harald Hoyer d9da66
+fi
Harald Hoyer d9da66