Fix: uprobes: make uprobe_register() return struct uprobe * (v6.12)
[lttng-modules.git] / scripts / abi-sle-version.sh
... / ...
CommitLineData
1#!/bin/sh
2# SPDX-License-Identifier: (GPL-2.0-only OR LGPL-2.1-only)
3# SPDX-FileCopyrightText: 2016-2021 EfficiOS Inc.
4
5# First argument is the path to the kernel headers.
6KPATH=$1
7
8if [ ! -f "${KPATH}/include/generated/autoconf.h" ]; then
9 echo 0
10 exit 0
11fi
12
13# Check if we are building against a Suse kernel
14SUSE_KERNEL="$(sed -rn 's/^#define CONFIG_SUSE_KERNEL (.*)/\1/p' "${KPATH}/include/generated/autoconf.h")"
15
16if [ "$SUSE_KERNEL" != "1" ]; then
17 echo 0
18 exit 0
19fi
20
21
22if [ ! -f "${KPATH}/include/generated/utsrelease.h" ]; then
23 echo 0
24 exit 0
25fi
26
27SLE_RELEASE="$(sed -rn 's/^#define UTS_RELEASE "(.*)-([0-9a-zA-Z\.]+)-(.*)"/\2/p' "${KPATH}/include/generated/utsrelease.h")"
28
29SLE_RELEASE_MAJOR="$(echo "${SLE_RELEASE}" | sed -rn 's/^([0-9]+)(.*)$/\1/p')"
30SLE_RELEASE_MINOR="$(echo "${SLE_RELEASE}" | sed -rn 's/^([0-9]+)\.([0-9]+)(.*)$/\2/p')"
31SLE_RELEASE_PATCH="$(echo "${SLE_RELEASE}" | sed -rn 's/^([0-9]+)\.([0-9]+)\.([0-9]+)(.*)$/\3/p')"
32
33# Minor and patch versions can be omitted
34if [ "x$SLE_RELEASE_MINOR" = "x" ]; then
35 SLE_RELEASE_MINOR=0
36fi
37if [ "x$SLE_RELEASE_PATCH" = "x" ]; then
38 SLE_RELEASE_PATCH=0
39fi
40
41echo "${SLE_RELEASE_MAJOR} ${SLE_RELEASE_MINOR} ${SLE_RELEASE_PATCH}"
This page took 0.024628 seconds and 5 git commands to generate.