scripts/setup: Revert back to using lsblk for mount checks
lsblk will include all the potential holders|virtual devices given block device may be part of. This is relevant in case a nvme|virtio device is part of the lvm|md setup. Change-Id: I32198ddcf71746c3cbad4a96496a1762a5c201cd Signed-off-by: Michal Berger <michalx.berger@intel.com> Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/5167 Community-CI: Mellanox Build Bot Tested-by: SPDK CI Jenkins <sys_sgci@intel.com> Reviewed-by: Changpeng Liu <changpeng.liu@intel.com> Reviewed-by: Jim Harris <james.r.harris@intel.com> Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
This commit is contained in:
parent
657e50a032
commit
06058e9bdb
@ -182,17 +182,15 @@ function get_block_dev_from_bdf() {
|
||||
|
||||
function get_mounted_part_dev_from_bdf_block() {
|
||||
local bdf=$1
|
||||
local blocks block part
|
||||
local blocks block mounts
|
||||
|
||||
blocks=($(get_block_dev_from_bdf "$bdf"))
|
||||
|
||||
for block in "${blocks[@]}"; do
|
||||
for part in "/sys/block/$block/$block"*; do
|
||||
[[ -b /dev/${part##*/} ]] || continue
|
||||
if [[ $(< /proc/self/mountinfo) == *" $(< "$part/dev") "* ]]; then
|
||||
echo "${part##*/}"
|
||||
fi
|
||||
done
|
||||
mounts=$(lsblk -n -o MOUNTPOINT "/dev/$block")
|
||||
if [[ -n $mounts ]]; then
|
||||
echo "$block"
|
||||
fi
|
||||
done
|
||||
}
|
||||
|
||||
@ -264,7 +262,8 @@ function collect_driver() {
|
||||
|
||||
function verify_bdf_mounts() {
|
||||
local bdf=$1
|
||||
local blknames=($(get_mounted_part_dev_from_bdf_block "$bdf"))
|
||||
local blknames
|
||||
blknames=($(get_mounted_part_dev_from_bdf_block "$bdf")) || return 1
|
||||
|
||||
if ((${#blknames[@]} > 0)); then
|
||||
for name in "${blknames[@]}"; do
|
||||
|
Loading…
Reference in New Issue
Block a user