]> git.ipfire.org Git - thirdparty/dracut.git/commitdiff
dasd: only install /etc/dasd.conf if present
authorSebastian Mitterle <smitterl@redhat.com>
Thu, 19 Mar 2020 11:12:50 +0000 (12:12 +0100)
committerHarald Hoyer <harald@hoyer.xyz>
Thu, 19 Mar 2020 17:05:30 +0000 (18:05 +0100)
`dasd.conf` needn't be present on system even if modules have been loaded.

Check if file exists to avoid error message during kernel update
```bash
dracut-install: ERROR: installing '/etc/dasd.conf'
dracut: FAILED: /usr/lib/dracut/dracut-install -D /var/tmp/dracut.YvVRx5/initramfs -H /etc/dasd.conf
```

modules.d/95dasd/module-setup.sh

index 2c49cd26f8d72fc10ec0fc8a97ff42ada171de37..c71c8a08d96b2b082a5827fefbf7ff7e8a405e9c 100755 (executable)
@@ -18,8 +18,9 @@ depends() {
 install() {
     inst_hook cmdline 30 "$moddir/parse-dasd.sh"
     inst_multiple dasdinfo dasdconf.sh normalize_dasd_arg
-    if [[ $hostonly ]]; then
-        inst -H /etc/dasd.conf
+    conf=/etc/dasd.conf
+    if [[ $hostonly && -f $conf ]] ; then
+        inst -H $conf
     fi
     inst_rules 56-dasd.rules
     inst_rules 59-dasd.rules