From 3a81a3dee8ef34d5fef7a59ba50ec359078219df Mon Sep 17 00:00:00 2001 From: Jan Michalski Date: Wed, 19 Jul 2023 14:11:16 -0400 Subject: [PATCH] common: fix ndctl & jq detection for testconfig generation Signed-off-by: Jan Michalski --- utils/create-testconfig.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/utils/create-testconfig.sh b/utils/create-testconfig.sh index 76def92082b..e2342de2c1e 100755 --- a/utils/create-testconfig.sh +++ b/utils/create-testconfig.sh @@ -59,7 +59,7 @@ TM=1 # lookup all Device DAX devices in the system DEVICE_DAX_PATH= device_dax_path= -if [ `which ndctl` -a `which jq` ]; then +if which ndctl > /dev/null 2>&1 && which jq > /dev/null 2>&1; then DEVICE_DAX_PATH="$(ndctl list -X | jq -r '.[].daxregion.devices[].chardev' | awk '$0="/dev/"$0' | paste -sd' ')" device_dax_path="$(ndctl list -X | jq -r '.[].daxregion.devices[].chardev' | awk '$0="'\''/dev/"$0"'\''"' | paste -sd',')" fi