Skip to content

Commit

Permalink
fix(dracut.sh): do not add device if find_block_device fails
Browse files Browse the repository at this point in the history
  • Loading branch information
dalto8 authored and LaszloGombos committed Apr 12, 2024
1 parent 5303dcf commit 0f6c46a
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions dracut.sh
Original file line number Diff line number Diff line change
Expand Up @@ -1668,10 +1668,13 @@ if [[ $hostonly ]] && [[ $hostonly_default_device != "no" ]]; then
mp=$(readlink -f "$dracutsysrootdir$mp")
mountpoint "$mp" > /dev/null 2>&1 || continue
_dev=$(find_block_device "$mp")
_bdev=$(readlink -f "/dev/block/$_dev")
[[ -b $_bdev ]] && _dev=$_bdev
[[ $mp == "/" ]] && root_devs+=("$_dev")
push_host_devs "$_dev"
# shellcheck disable=SC2181
if [[ $? -eq 0 ]]; then
_bdev=$(readlink -f "/dev/block/$_dev")
[[ -b $_bdev ]] && _dev=$_bdev
[[ $mp == "/" ]] && root_devs+=("$_dev")
push_host_devs "$_dev"
fi
if [[ $(find_mp_fstype "$mp") == btrfs ]]; then
for i in $(btrfs_devs "$mp"); do
[[ $mp == "/" ]] && root_devs+=("$i")
Expand Down

0 comments on commit 0f6c46a

Please sign in to comment.