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