unbind.sh: fix ioat unbind to work with 'set -e'
Since the grep would fail for most devices and the result wasn't checked, the script would exit on the first device ID that didn't match. Also initialize $rootdir so ioat_pci.h can be located. Change-Id: I6a714772e22692ab002e1971134d2a86edc81d92 Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
This commit is contained in:
parent
3c10754a8d
commit
53d6437bb5
@ -2,6 +2,8 @@
|
|||||||
|
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
|
rootdir=$(readlink -f $(dirname $0))/..
|
||||||
|
|
||||||
function prep_nvme {
|
function prep_nvme {
|
||||||
TMP=`mktemp`
|
TMP=`mktemp`
|
||||||
# Get vendor_id:device_id by nvme's class_id and subcalss_id
|
# Get vendor_id:device_id by nvme's class_id and subcalss_id
|
||||||
@ -24,8 +26,7 @@ function prep_ioat {
|
|||||||
|
|
||||||
for device in `cat $TMP`
|
for device in `cat $TMP`
|
||||||
do
|
do
|
||||||
result=`lspci -n | grep "$vendor:$device"`
|
if lspci -n | grep "$vendor:$device"
|
||||||
if [ "$result" ]
|
|
||||||
then
|
then
|
||||||
echo $vendor $device > /sys/bus/pci/drivers/uio_pci_generic/new_id
|
echo $vendor $device > /sys/bus/pci/drivers/uio_pci_generic/new_id
|
||||||
fi
|
fi
|
||||||
|
Loading…
Reference in New Issue
Block a user