3 # First argument is the path to the kernel headers.
6 if [ ! -f "${KPATH}/include/generated/autoconf.h" ]; then
11 # Check if we are building against a Suse kernel
12 SUSE_KERNEL
="$(sed -rn 's/^#define CONFIG_SUSE_KERNEL (.*)/\1/p' "${KPATH}/include
/generated
/autoconf.h
")"
14 if [ "$SUSE_KERNEL" != "1" ]; then
20 if [ ! -f "${KPATH}/include/generated/utsrelease.h" ]; then
25 SLE_RELEASE
="$(sed -rn 's/^#define UTS_RELEASE "(.
*)-([0-9\.
]+)-(.
*)"/\2/p' "${KPATH}/include
/generated
/utsrelease.h
")"
27 SLE_RELEASE_MAJOR
="$(echo "${SLE_RELEASE}" | sed -rn 's/^([0-9]+)(.*)$/\1/p')"
28 SLE_RELEASE_MINOR
="$(echo "${SLE_RELEASE}" | sed -rn 's/^([0-9]+)\.([0-9]+)(.*)$/\2/p')"
29 SLE_RELEASE_PATCH
="$(echo "${SLE_RELEASE}" | sed -rn 's/^([0-9]+)\.([0-9]+)\.([0-9]+)(.*)$/\3/p')"
31 # Minor and patch versions can be omitted
32 if [ "x$SLE_RELEASE_MINOR" = "x" ]; then
35 if [ "x$SLE_RELEASE_PATCH" = "x" ]; then
39 # Combine all update numbers into one
40 SLE_API_VERSION
="$((SLE_RELEASE_MAJOR * 10000 + SLE_RELEASE_MINOR * 100 + SLE_RELEASE_PATCH))"
42 echo ${SLE_API_VERSION}
This page took 0.036918 seconds and 5 git commands to generate.