dracut.sh/dracut-functions.sh: handle root on non-block device

master
Harald Hoyer 2013-08-05 11:25:45 +02:00
parent 226e3710b4
commit a4f7b50471
2 changed files with 7 additions and 2 deletions

View File

@ -421,7 +421,9 @@ find_mp_fstype() {
find_dev_fstype() {
local _find_dev _fs
_find_dev="$1"
[[ "$_find_dev" = /dev* ]] || _find_dev="/dev/block/$_find_dev"
if ! [[ "$_find_dev" = /dev* ]]; then
[[ -b "/dev/block/$_find_dev" ]] && _find_dev="/dev/block/$_find_dev"
fi

if [[ $use_fstab != yes ]]; then
findmnt -e -v -n -o 'FSTYPE' --source "$_find_dev" | { \

View File

@ -871,7 +871,10 @@ if [[ $hostonly ]]; then
do
mp=$(readlink -f "$mp")
mountpoint "$mp" >/dev/null 2>&1 || continue
_dev="$(readlink -f "/dev/block/$(find_block_device "$mp")")"
_dev=$(find_block_device "$mp")
_bdev=$(readlink -f "/dev/block/$dev")
[[ -b $_bdev ]] && _dev=$_bdev
push host_devs $_dev
[[ "$_mp" == "/" ]] && root_dev="$_dev"
push host_devs "$_dev"
done