return ${1:-0}
}
-# int KV_to_int(string)
-#
-# Convert a string type kernel version (2.4.0) to an int (132096)
-# for easy compairing or versions ...
-#
-KV_to_int() {
- [ -z "$1" ] && return 1
-
- local KV_MAJOR="$(KV_major "$1")"
- local KV_MINOR="$(KV_minor "$1")"
- local KV_MICRO="$(KV_micro "$1")"
- local KV_int=$(( KV_MAJOR * 65536 + KV_MINOR * 256 + KV_MICRO ))
-
- # We make version 2.2.0 the minimum version we will handle as
- # a sanity check ... if its less, we fail ...
- if [ "${KV_int}" -ge 131584 ] ; then
- printf "${KV_int}\n"
- return 0
- fi
-
- return 1
-}
-
# int get_KV()
#
# Return the kernel version (major, minor and micro concated) as an integer.