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