summaryrefslogtreecommitdiff
path: root/kernel/driver/find_kernel_headers
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/driver/find_kernel_headers')
-rwxr-xr-xkernel/driver/find_kernel_headers21
1 files changed, 21 insertions, 0 deletions
diff --git a/kernel/driver/find_kernel_headers b/kernel/driver/find_kernel_headers
new file mode 100755
index 00000000..3d0e505e
--- /dev/null
+++ b/kernel/driver/find_kernel_headers
@@ -0,0 +1,21 @@
+#!/bin/bash
+
+if test -n "${KDIR}"; then
+ if test -f ${KDIR}/include/linux/version.h; then
+ echo ${KDIR}
+ exit 0
+ else
+ exit 1
+ fi
+else
+ if test -f /usr/src/linux/include/linux/version.h; then
+ echo /usr/src/linux
+ exit 0
+ elif test -f /lib/modules/`uname -r`/build/include/linux/version.h; then
+ echo /lib/modules/`uname -r`/build
+ exit 0
+ else
+ exit 1
+ fi
+fi
+ \ No newline at end of file