Harald Hoyer 308914
From defb1611c771d9f05780aebb101baefde2f66874 Mon Sep 17 00:00:00 2001
Harald Hoyer 308914
From: Sebastian Mitterle <smitterl@redhat.com>
Harald Hoyer 308914
Date: Thu, 19 Mar 2020 12:12:50 +0100
Harald Hoyer 308914
Subject: [PATCH] dasd: only install /etc/dasd.conf if present
Harald Hoyer 308914
Harald Hoyer 308914
`dasd.conf` needn't be present on system even if modules have been loaded.
Harald Hoyer 308914
Harald Hoyer 308914
Check if file exists to avoid error message during kernel update
Harald Hoyer 308914
```bash
Harald Hoyer 308914
dracut-install: ERROR: installing '/etc/dasd.conf'
Harald Hoyer 308914
dracut: FAILED: /usr/lib/dracut/dracut-install -D /var/tmp/dracut.YvVRx5/initramfs -H /etc/dasd.conf
Harald Hoyer 308914
```
Harald Hoyer 308914
---
Harald Hoyer 308914
 modules.d/95dasd/module-setup.sh | 5 +++--
Harald Hoyer 308914
 1 file changed, 3 insertions(+), 2 deletions(-)
Harald Hoyer 308914
Harald Hoyer 308914
diff --git a/modules.d/95dasd/module-setup.sh b/modules.d/95dasd/module-setup.sh
Harald Hoyer 308914
index 2c49cd26..c71c8a08 100755
Harald Hoyer 308914
--- a/modules.d/95dasd/module-setup.sh
Harald Hoyer 308914
+++ b/modules.d/95dasd/module-setup.sh
Harald Hoyer 308914
@@ -18,8 +18,9 @@ depends() {
Harald Hoyer 308914
 install() {
Harald Hoyer 308914
     inst_hook cmdline 30 "$moddir/parse-dasd.sh"
Harald Hoyer 308914
     inst_multiple dasdinfo dasdconf.sh normalize_dasd_arg
Harald Hoyer 308914
-    if [[ $hostonly ]]; then
Harald Hoyer 308914
-        inst -H /etc/dasd.conf
Harald Hoyer 308914
+    conf=/etc/dasd.conf
Harald Hoyer 308914
+    if [[ $hostonly && -f $conf ]] ; then
Harald Hoyer 308914
+        inst -H $conf
Harald Hoyer 308914
     fi
Harald Hoyer 308914
     inst_rules 56-dasd.rules
Harald Hoyer 308914
     inst_rules 59-dasd.rules
Harald Hoyer 308914