gen_nvme: Be FreeBSD friendly
Since sysfs is not used by the FreeBSD the following error can be seen each time gen_nvme.sh is run: grep: /sys/bus/pci/devices/$bdf/uevent: No such file or directory Avoid that by looking up the pci address in a way specific to FreeBSD. Change-Id: If81e71cece52c2f27dcf68f7a7eba3dd7d8ce10f Signed-off-by: Michal Berger <michalx.berger@intel.com> Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/2227 Community-CI: Mellanox Build Bot Tested-by: SPDK CI Jenkins <sys_sgci@intel.com> Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com> Reviewed-by: Jim Harris <james.r.harris@intel.com>
This commit is contained in:
parent
d51345c0b9
commit
c8c4f71efe
@ -39,10 +39,11 @@ bdfs=()
|
|||||||
# then most likely PCI_WHITELIST option was used for setup.sh
|
# then most likely PCI_WHITELIST option was used for setup.sh
|
||||||
# and we do not want to use that disk.
|
# and we do not want to use that disk.
|
||||||
for bdf in $(iter_pci_class_code 01 08 02); do
|
for bdf in $(iter_pci_class_code 01 08 02); do
|
||||||
driver=$(grep DRIVER /sys/bus/pci/devices/$bdf/uevent | awk -F"=" '{print $2}')
|
if [[ -e /sys/bus/pci/drivers/nvme/$bdf ]] \
|
||||||
if [ "$driver" != "nvme" ]; then
|
|| [[ $(uname -s) == FreeBSD && $(pciconf -l "pci$bdf") == nvme* ]]; then
|
||||||
bdfs+=("$bdf")
|
continue
|
||||||
fi
|
fi
|
||||||
|
bdfs+=("$bdf")
|
||||||
done
|
done
|
||||||
|
|
||||||
if [ "$1" = "--json" ]; then
|
if [ "$1" = "--json" ]; then
|
||||||
|
Loading…
Reference in New Issue
Block a user