aboutsummaryrefslogtreecommitdiffstats
path: root/version-check.sh
diff options
context:
space:
mode:
Diffstat (limited to 'version-check.sh')
-rwxr-xr-xversion-check.sh6
1 files changed, 6 insertions, 0 deletions
diff --git a/version-check.sh b/version-check.sh
new file mode 100755
index 0000000..a85f023
--- /dev/null
+++ b/version-check.sh
@@ -0,0 +1,6 @@
+#!/bin/bash
+set -e
+[[ -n $1 && -f $1/Makefile ]]
+[[ $(< "$1/Makefile") =~ VERSION[[:space:]]*=[[:space:]]*([0-9]+).*PATCHLEVEL[[:space:]]*=[[:space:]]*([0-9]+).*SUBLEVEL[[:space:]]*=[[:space:]]*([0-9]+) ]]
+LINUX_VERSION_CODE=$(( (${BASH_REMATCH[1]} << 16) | (${BASH_REMATCH[2]} << 8) | ${BASH_REMATCH[3]} ))
+(( LINUX_VERSION_CODE >= ((3 << 16) | (10 << 8) | 0) ))