From 4ce9f947f11901595d9353b0d2f1a4e30867cb82 Mon Sep 17 00:00:00 2001 From: Xie XiuQi Date: Fri, 28 Oct 2022 07:32:16 +0000 Subject: [PATCH] kernel: add OPENEULER_VERSION_CODE to version.h hulk inclusion bugzilla: https://gitee.com/openeuler/kernel/issues/I575IT Add OPENEULER_VERSION_CODE to version.h, so modules or applications can identify the specific kernel version. The version information is generated in "linux/version.h", as bellow: include/generated/uapi/linux/version.h #define OPENEULER_MAJOR 2203 // openEuler 22.03 #define OPENEULER_MINOR 0 #define OPENEULER_VERSION(a,b) (((a) << 8) + (b)) #define OPENEULER_VERSION_CODE 563968 Signed-off-by: Xie XiuQi --- Makefile | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 3cc1aaed9644..a1f863ff6c9b 100644 --- a/Makefile +++ b/Makefile @@ -4,6 +4,8 @@ PATCHLEVEL = 10 SUBLEVEL = 0 EXTRAVERSION = NAME = Kleptomaniac Octopus +OPENEULER_MAJOR = 2203 +OPENEULER_MINOR = 0 # *DOCUMENTATION* # To see a list of typical targets execute "make help" @@ -1276,7 +1278,12 @@ define filechk_version.h expr $(VERSION) \* 65536 + $(PATCHLEVEL) \* 256 + $(SUBLEVEL)); \ fi; \ echo '#define KERNEL_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + \ - ((c) > 255 ? 255 : (c)))' + ((c) > 255 ? 255 : (c)))'; \ + echo '#define OPENEULER_MAJOR $(OPENEULER_MAJOR)'; \ + echo '#define OPENEULER_MINOR $(OPENEULER_MINOR)'; \ + echo '#define OPENEULER_VERSION(a,b) (((a) << 8) + (b))'; \ + echo '#define OPENEULER_VERSION_CODE \ + $(shell expr $(OPENEULER_MAJOR) \* 256 + $(OPENEULER_MINOR))' endef $(version_h): PATCHLEVEL := $(if $(PATCHLEVEL), $(PATCHLEVEL), 0) -- Gitee