未验证 提交 d2cb0c37 编写于 作者: O openeuler-ci-bot 提交者: Gitee

!195 kernel: add OPENEULER_VERSION_CODE to version.h

Merge Pull Request from: @xiexiuqi 
 
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 1                       // SP1
 #define OPENEULER_VERSION(a,b) (((a) << 8) + (b))
 #define OPENEULER_VERSION_CODE 563969 
 
Link:https://gitee.com/openeuler/kernel/pulls/195 
Reviewed-by: Zheng Zengkai <zhengzengkai@huawei.com> 
Reviewed-by: Laibin Qiu <qiulaibin@huawei.com> 
Signed-off-by: Zheng Zengkai <zhengzengkai@huawei.com> 
......@@ -4,6 +4,8 @@ PATCHLEVEL = 10
SUBLEVEL = 0
EXTRAVERSION =
NAME = Kleptomaniac Octopus
OPENEULER_MAJOR = 2203
OPENEULER_MINOR = 1
# *DOCUMENTATION*
# To see a list of typical targets execute "make help"
......@@ -1277,7 +1279,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)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册