]> git.ipfire.org Git - thirdparty/dracut.git/commitdiff
dracut.sh:_get_fs_type() if block device exists return early
authorHarald Hoyer <harald@redhat.com>
Mon, 2 Dec 2013 09:32:00 +0000 (10:32 +0100)
committerHarald Hoyer <harald@redhat.com>
Tue, 29 Jul 2014 09:52:03 +0000 (11:52 +0200)
even, if no ID_FS_TYPE was found, return if the block device exists

dracut.sh

index c6a388ab482e281326f9e7a927811bd65971ec1b..5f14d503ee0b84cd018dec90d22050c721da703a 100755 (executable)
--- a/dracut.sh
+++ b/dracut.sh
@@ -985,12 +985,12 @@ unset rest
 
 _get_fs_type() {
     [[ $1 ]] || return
-    if [[ -b /dev/block/$1 ]] && ID_FS_TYPE=$(get_fs_env "/dev/block/$1"); then
-        host_fs_types["$(readlink -f "/dev/block/$1")"]="$ID_FS_TYPE"
+    if [[ -b /dev/block/$1 ]]; then
+        ID_FS_TYPE=$(get_fs_env "/dev/block/$1") && host_fs_types["$(readlink -f "/dev/block/$1")"]="$ID_FS_TYPE"
         return 1
     fi
-    if [[ -b $1 ]] && ID_FS_TYPE=$(get_fs_env "$1"); then
-        host_fs_types["$(readlink -f "$1")"]="$ID_FS_TYPE"
+    if [[ -b $1 ]]; then
+        ID_FS_TYPE=$(get_fs_env "$1") && host_fs_types["$(readlink -f "$1")"]="$ID_FS_TYPE"
         return 1
     fi
     if fstype=$(find_dev_fstype "$1"); then