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