aboutsummaryrefslogtreecommitdiffstats
path: root/packaging/utils/kernelversion
diff options
context:
space:
mode:
Diffstat (limited to 'packaging/utils/kernelversion')
-rwxr-xr-xpackaging/utils/kernelversion10
1 files changed, 10 insertions, 0 deletions
diff --git a/packaging/utils/kernelversion b/packaging/utils/kernelversion
new file mode 100755
index 000000000..a021398af
--- /dev/null
+++ b/packaging/utils/kernelversion
@@ -0,0 +1,10 @@
+#! /bin/sh
+# determine kernel version code, mostly for use in RPM building
+
+awk 'BEGIN { FS = " *= *" }
+ NF != 2 { next }
+ $1 == "VERSION" { maj = $2 }
+ $1 == "PATCHLEVEL" { mid = $2 }
+ $1 == "SUBLEVEL" { min = $2 }
+ $1 == "EXTRAVERSION" { ext = $2 }
+ END { print maj "." mid "." min ext }' $*