scripts/setup: Fix check for mounted devices
The previous approach didn't take into the account systems where root partition is representend in a virtual form of /dev/root (see clearlinux). In case the device was bound to virtio this would fool setup.sh into thinking nothing is mounted and proceed with unbinding the entire rootfs. Fix this by checking the maj:min numbers of the device instead of its name against the mountinfo list. Change-Id: I0feb2584869f6bb72df3e9a4e619620240cfce3b Signed-off-by: Michal Berger <michalx.berger@intel.com> Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/4046 Reviewed-by: Karol Latecki <karol.latecki@intel.com> Reviewed-by: Maciej Wawryk <maciejx.wawryk@intel.com> Reviewed-by: Jim Harris <james.r.harris@intel.com> Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com> Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
This commit is contained in:
parent
44775a8062
commit
d6c499f3ee
@ -160,7 +160,8 @@ function get_mounted_part_dev_from_bdf_block() {
|
||||
|
||||
for block in "${blocks[@]}"; do
|
||||
for part in "/sys/block/$block/$block"*; do
|
||||
if [[ $(< /proc/mounts) == *"/dev/${part##*/} "* ]]; then
|
||||
[[ -b /dev/${part##*/} ]] || continue
|
||||
if [[ $(< /proc/self/mountinfo) == *" $(< "$part/dev") "* ]]; then
|
||||
echo "${part##*/}"
|
||||
fi
|
||||
done
|
||||
|
Loading…
Reference in New Issue
Block a user