Fix: scsi: sd: Atomic write support added in 6.11-rc1
[lttng-modules.git] / scripts / abi-rhel-version.sh
... / ...
CommitLineData
1#!/bin/sh
2# SPDX-License-Identifier: (GPL-2.0-only OR LGPL-2.1-only)
3# SPDX-FileCopyrightText: 2016-2018 EfficiOS Inc.
4
5# First argument is the path to the kernel headers.
6KPATH="$1"
7
8if [ ! -f "${KPATH}/include/generated/uapi/linux/version.h" ]; then
9 echo 0
10 exit 0
11fi
12
13# Assuming KPATH is the target kernel headers directory
14RHEL_RELEASE=$(sed -rn 's/^#define RHEL_RELEASE "(.*)"/\1/p' "${KPATH}/include/generated/uapi/linux/version.h")
15
16RHEL_RELEASE_MAJOR=$(echo "${RHEL_RELEASE}" | sed -r 's/^([0-9]+)\.([0-9]+)\.([0-9]+)/\1/')
17RHEL_RELEASE_MINOR=$(echo "${RHEL_RELEASE}" | sed -r 's/^([0-9]+)\.([0-9]+)\.([0-9]+)/\2/')
18RHEL_RELEASE_PATCH=$(echo "${RHEL_RELEASE}" | sed -r 's/^([0-9]+)\.([0-9]+)\.([0-9]+)/\3/')
19
20# Combine all update numbers into one
21RHEL_API_VERSION=$((RHEL_RELEASE_MAJOR * 10000 + RHEL_RELEASE_MINOR * 100 + RHEL_RELEASE_PATCH))
22
23echo ${RHEL_API_VERSION}
This page took 0.024315 seconds and 5 git commands to generate.