Commit 513091aa authored by Christopher Covington's avatar Christopher Covington Committed by Pavel Emelyanov

zdtm: Make kernel version check more POSIX-like

Arrays and "&&" in test are not supported by Busybox v1.19.4. The
`set` command can put field-separated arguments into the positional
parameters, which is relatively equivalent to using an array.
Signed-off-by: 's avatarChristopher Covington <cov@codeaurora.org>
Acked-by: 's avatarAndrew Vagin <avagin@parallels.com>
Signed-off-by: 's avatarPavel Emelyanov <xemul@parallels.com>
parent 371a7092
...@@ -271,9 +271,6 @@ check_criu() ...@@ -271,9 +271,6 @@ check_criu()
check_mainstream() check_mainstream()
{ {
local -a ver_arr
local ver_str=`uname -r`
zdtm_sep "CRIU CHECK" zdtm_sep "CRIU CHECK"
$CRIU check && return 0 $CRIU check && return 0
...@@ -287,12 +284,12 @@ git://git.kernel.org/pub/scm/linux/kernel/git/gorcunov/linux-cr.git ...@@ -287,12 +284,12 @@ git://git.kernel.org/pub/scm/linux/kernel/git/gorcunov/linux-cr.git
=================================================================== ===================================================================
EOF EOF
ver_arr=(`echo ${ver_str//./ }`) set -- `uname -r | sed 's/\./ /g'`
[ "${ver_arr[0]}" -gt 3 ] && return 0 [ $1 -gt 3 ] && return 0
[[ "${ver_arr[0]}" -eq 3 && "${ver_arr[1]}" -ge 11 ]] && return 0 [ $1 -eq 3 -a $2 -ge 11 ] && return 0
echo "A version of kernel should be greater or equal to 3.11" >&2 echo "Kernel version should be greater than or equal to 3.11" >&2
return 1 return 1
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment