Commit | Line | Data |
---|---|---|
b4c8e4d3 MJ |
1 | #!/bin/sh |
2 | ||
3 | # First argument is the path to the kernel headers. | |
bbba79f5 | 4 | KPATH="$1" |
b4c8e4d3 MJ |
5 | |
6 | VERSIONFILE="" | |
7 | ||
8 | if [ -f "${KPATH}/localversion-rt" ]; then | |
9 | VERSIONFILE="${KPATH}/localversion-rt" | |
10 | ||
11 | elif [ -f "${KPATH}/source/localversion-rt" ]; then | |
12 | VERSIONFILE="${KPATH}/source/localversion-rt" | |
13 | else | |
14 | echo 0 | |
15 | exit 0 | |
16 | fi | |
17 | ||
18 | RT_PATCH_VERSION=$(sed -rn 's/^-rt([0-9]+)$/\1/p' "${VERSIONFILE}") | |
19 | ||
20 | if [ "x${RT_PATCH_VERSION}" = "x" ]; then | |
21 | echo 0 | |
22 | exit 0 | |
23 | fi | |
24 | ||
bbba79f5 | 25 | echo "${RT_PATCH_VERSION}" |