]> git.ipfire.org Git - thirdparty/dracut.git/commitdiff
dracut.sh: handle empty $initrd/etc/cmdline.d
authorHarald Hoyer <harald@redhat.com>
Wed, 21 Jan 2015 08:32:20 +0000 (09:32 +0100)
committerHarald Hoyer <harald@redhat.com>
Wed, 21 Jan 2015 08:32:20 +0000 (09:32 +0100)
dracut.sh

index 07e49658fbe1feeec147d51015b6dfc4e06c0706..df016b6913fea3271906130fd8b878a57ff76b88 100755 (executable)
--- a/dracut.sh
+++ b/dracut.sh
@@ -1622,12 +1622,16 @@ if ! ( echo $PARMS_TO_STORE > $initdir/lib/dracut/build-parameter.txt ); then
 fi
 
 if [[ $hostonly_cmdline ]] ; then
+    unset _stored_cmdline
     if [ -d $initdir/etc/cmdline.d ];then
         dinfo "Stored kernel commandline:"
         for conf in $initdir/etc/cmdline.d/*.conf ; do
+            [ -e "$conf" ] || continue
             dinfo "$(< $conf)"
+            _stored_cmdline=1
         done
-    else
+    fi
+    if ! [[ $_stored_cmdline ]]; then
         dinfo "No dracut internal kernel commandline stored in initrd"
     fi
 fi