2 # SPDX-License-Identifier: (GPL-2.0-only OR LGPL-2.1-only)
4 # First argument is the path to the kernel headers.
7 if [ ! -f "${KPATH}/include/generated/autoconf.h" ]; then
12 # Check if we are building against a Suse kernel
13 SUSE_KERNEL
="$(sed -rn 's/^#define CONFIG_SUSE_KERNEL (.*)/\1/p' "${KPATH}/include
/generated
/autoconf.h
")"
15 if [ "$SUSE_KERNEL" != "1" ]; then
21 if [ ! -f "${KPATH}/include/generated/utsrelease.h" ]; then
26 SLE_RELEASE
="$(sed -rn 's/^#define UTS_RELEASE "(.
*)-([0-9a-zA-Z\.
]+)-(.
*)"/\2/p' "${KPATH}/include
/generated
/utsrelease.h
")"
28 SLE_RELEASE_MAJOR
="$(echo "${SLE_RELEASE}" | sed -rn 's/^([0-9]+)(.*)$/\1/p')"
29 SLE_RELEASE_MINOR
="$(echo "${SLE_RELEASE}" | sed -rn 's/^([0-9]+)\.([0-9]+)(.*)$/\2/p')"
30 SLE_RELEASE_PATCH
="$(echo "${SLE_RELEASE}" | sed -rn 's/^([0-9]+)\.([0-9]+)\.([0-9]+)(.*)$/\3/p')"
32 # Minor and patch versions can be omitted
33 if [ "x$SLE_RELEASE_MINOR" = "x" ]; then
36 if [ "x$SLE_RELEASE_PATCH" = "x" ]; then
40 # Combine all update numbers into one
41 SLE_API_VERSION
="$((SLE_RELEASE_MAJOR * 10000 + SLE_RELEASE_MINOR * 100 + SLE_RELEASE_PATCH))"
43 echo ${SLE_API_VERSION}
This page took 0.038404 seconds and 5 git commands to generate.