summaryrefslogtreecommitdiff
path: root/kernel/driver/find_kernel_headers
blob: 3d0e505e6153b242d172a5c61fa69495d163225b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
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