Pass device name instead of major:minor in for_each_host_dev_fs()

Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com>
master
Cong Wang 2011-12-20 14:09:59 +08:00 committed by Harald Hoyer
parent 426b68b20a
commit d0096de764
2 changed files with 11 additions and 11 deletions

11
dracut
View File

@ -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

View File

@ -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
}