setup.sh: fix linux_iter_pci_class_code and linux_iter_pci_dev_id
Another atempt to fix setup.sh On Ubuntu 16.04 that use GNU Awk 4.1.3. Eg when subsystem vendor name and subsystem name are empty: $ lspci -mm -n -D ... 0000:00:05.0 "0880" "8086" "0e28" -r04 "8086" "3582" 0000:00:05.1 "0880" "8086" "0e29" -r04 "" "" 0000:00:05.2 "0880" "8086" "0e2a" -r04 "8086" "3582" ... tr -d '"' part is brekaing whole awk script. So lets try to escape vendor and device ID to comapre them as whole string. Change-Id: Ic41e82c41347c6e0a8246b445f86eddf56780089 Signed-off-by: Pawel Wodkowski <pawelx.wodkowski@intel.com> Reviewed-on: https://review.gerrithub.io/374462 Tested-by: SPDK Automated Test System <sys_sgsw@intel.com> Reviewed-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com> Reviewed-by: Jim Harris <james.r.harris@intel.com> Reviewed-by: Ben Walker <benjamin.walker@intel.com>
This commit is contained in:
parent
c60a0bef93
commit
d783ad1f29
@ -6,13 +6,13 @@ rootdir=$(readlink -f $(dirname $0))/..
|
||||
|
||||
function linux_iter_pci_class_code {
|
||||
# Argument is the class code
|
||||
lspci -mm -n -D | tr -d '"' | awk -v cc="$1" -F " " '{if (cc ~ $2) print $1}'
|
||||
lspci -mm -n -D | awk -v cc="\"$1\"" -F " " '{if (cc ~ $2) print $1}' | tr -d '"'
|
||||
}
|
||||
|
||||
function linux_iter_pci_dev_id {
|
||||
# Argument 1 is the vendor id
|
||||
# Argument 2 is the device id
|
||||
lspci -mm -n -D | tr -d '"' | awk -v ven="$1" -v dev="$2" -F " " '{if (ven ~ $3 && dev ~ $4) print $1}'
|
||||
lspci -mm -n -D | awk -v ven="\"$1\"" -v dev="\"$2\"" -F " " '{if (ven ~ $3 && dev ~ $4) print $1}' | tr -d '"'
|
||||
}
|
||||
|
||||
function linux_bind_driver() {
|
||||
|
Loading…
x
Reference in New Issue
Block a user