[PATCH 4/6] Pass device name instead of major:minor in for_each_host_dev_fs()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Cong Wang <xiyou.wangcong@xxxxxxxxx>

Signed-off-by: Cong Wang <xiyou.wangcong@xxxxxxxxx>
---
 dracut           |   11 +++++------
 dracut-functions |   11 ++++++-----
 2 files changed, 11 insertions(+), 11 deletions(-)

diff --git a/dracut b/dracut
index 452067d..85228b8 100755
--- a/dracut
+++ b/dracut
@@ -528,9 +528,8 @@ chmod 755 "$initdir"
 for line in "${fstab_lines[@]}"; do
     set -- $line
     #dev mp fs fsopts
-    dev="$(get_maj_min $1)"
-    push host_devs "${dev:-$1}"
-    push host_fs_types "$dev|$3"
+    push host_devs "$1"
+    push host_fs_types "$1|$3"
 done
 
 for f in $add_fstab; do
@@ -556,13 +555,13 @@ if [[ $hostonly ]]; then
 
     for mp in "${host_mp[@]}"; do
         mountpoint "$mp" >/dev/null 2>&1 || continue
-        push host_devs $(find_block_device "$mp")
+        push host_devs $(readlink -f "/dev/block/$(find_block_device "$mp")")
     done
 fi
 
 _get_fs_type() (
     [[ $1 ]] || return
-    if [[ -b /dev/block/$1 ]] && get_fs_env /dev/block/$1; then
+    if [[ -b $1 ]] && get_fs_env $1; then
         echo "$1|$ID_FS_TYPE"
         return 1
     fi
@@ -576,7 +575,7 @@ _get_fs_type() (
 for dev in "${host_devs[@]}"; do
     unset fs_type
     for fstype in $(_get_fs_type $dev) \
-        $(check_block_and_slaves _get_fs_type $dev); do
+        $(check_block_and_slaves _get_fs_type $(get_maj_min $dev)); do
         if ! strstr " ${host_fs_types[*]} " " $fstype ";then
             push host_fs_types "$fstype"
         fi
diff --git a/dracut-functions b/dracut-functions
index 618e884..3dd72e9 100755
--- a/dracut-functions
+++ b/dracut-functions
@@ -247,16 +247,17 @@ find_root_block_device() { find_block_device /; }
 for_each_host_dev_fs()
 {
     local _func="$1"
+    local _dev
+    local _fs
     for f in ${host_fs_types[@]}; do
         OLDIFS="$IFS"
         IFS="|"
         set -- $f
         IFS="$OLDIFS"
-        dev=$1
-        [[ -b /dev/block/$dev ]] && dev="/dev/block/$dev"
-        [[ -b $dev ]] || continue
-        fs="$2"
-        $_func $dev $fs
+        _dev="$1"
+        [[ -b "$_dev" ]] || continue
+        _fs="$2"
+        $_func $_dev $_fs
     done
 }
 
-- 
1.7.7.4

--
To unsubscribe from this list: send the line "unsubscribe initramfs" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux SCSI]

  Powered by Linux