summaryrefslogtreecommitdiffstats
path: root/scripts/kernel-version.sh
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/kernel-version.sh')
-rw-r--r--scripts/kernel-version.sh8
1 files changed, 8 insertions, 0 deletions
diff --git a/scripts/kernel-version.sh b/scripts/kernel-version.sh
new file mode 100644
index 000000000..36e00194b
--- /dev/null
+++ b/scripts/kernel-version.sh
@@ -0,0 +1,8 @@
+VER=$(grep patch sources | head -n1 | awk '{ print $2 }' | sed s/patch-// | sed s/-git.*// | sed s/.xz//)
+
+if [ -z "$VER" ] ;
+then
+ VER=$(grep linux sources | head -1 | awk '{ print $2 }' | sed s/linux-// | sed s/.tar.xz//)
+fi
+
+