Set openEuler version release for master, which will appear in <linux/version.h> like:
#define LINUX_VERSION_CODE 394752 #define KERNEL_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + ((c) > 255 ? 255 : (c))) #define LINUX_VERSION_MAJOR 6 #define LINUX_VERSION_PATCHLEVEL 6 #define LINUX_VERSION_SUBLEVEL 0 #define OPENEULER_LTS 1 #define OPENEULER_MAJOR 2403 #define OPENEULER_MINOR 0 #define OPENEULER_VERSION(a,b) (((a) << 8) + (b)) #define OPENEULER_VERSION_CODE 615168 #define OPENEULER_RELEASE "26.0.0.30"
https://gitee.com/openeuler/kernel/issues/I9PZYW
Xie XiuQi (2): kernel.spec: support set openeuler release version via kernel.spec kernel.spec: set openEuler version for master branch
kernel.spec | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+)
反馈: 您发送到kernel-build@openeuler.org的补丁/补丁集,转换为PR失败! 邮件列表地址:https://mailweb.openeuler.org/hyperkitty/list/kernel-build@openeuler.org/mes... 失败原因:应用补丁/补丁集失败,Patch failed at 0001 kernel.spec: support set openeuler release version via kernel.spec 建议解决方法:请查看失败原因, 确认补丁是否可以应用在当前期望分支的最新代码上
FeedBack: The patch(es) which you have sent to kernel-build@openeuler.org has been converted to PR failed! Mailing list address: https://mailweb.openeuler.org/hyperkitty/list/kernel-build@openeuler.org/mes... Failed Reason: apply patch(es) failed, Patch failed at 0001 kernel.spec: support set openeuler release version via kernel.spec Suggest Solution: please checkout if the failed patch(es) can work on the newest codes in expected branch
Support specific openEuler version code via kernel.spec and rpmbuild parameters.
Signed-off-by: Xie XiuQi xiexiuqi@huawei.com --- kernel.spec | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+)
diff --git a/kernel.spec b/kernel.spec index 4adc48c..8c8278c 100644 --- a/kernel.spec +++ b/kernel.spec @@ -27,6 +27,22 @@ %global maintenance_release .0.0 %global pkg_release .10
+%global openeuler_lts 0 +%global openeuler_major 0 +%global openeuler_minor 0 + +# +# Support input parameter to overwrite the preceding version numbers. +# + +%bcond_with openeuler_version + +%if %{with openeuler_version} +%global openeuler_lts %{?_openeuler_lts} %{?!_openeuler_lts: 0} +%global openeuler_major %{?_openeuler_major} %{?!_openeuler_major: 0} +%global openeuler_minor %{?_openeuler_minor} %{?!_openeuler_minor: 0} +%endif + %define with_debuginfo 1 # Do not recompute the build-id of vmlinux in find-debuginfo.sh %global _missing_build_ids_terminate_build 1 @@ -353,6 +369,10 @@ cp -a tools/perf tools/python3-perf cd linux-%{KernelVer}
perl -p -i -e "s/^EXTRAVERSION.*/EXTRAVERSION = -%{release}.%{_target_cpu}/" Makefile +perl -p -i -e "s/^OPENEULER_LTS.*/OPENEULER_LTS = %{openeuler_lts}/" Makefile.oever +perl -p -i -e "s/^OPENEULER_MAJOR.*/OPENEULER_MAJOR = %{openeuler_major}/" Makefile.oever +perl -p -i -e "s/^OPENEULER_MINOR.*/OPENEULER_MINOR = %{openeuler_minor}/" Makefile.oever +perl -p -i -e "s/^OPENEULER_RELEASE.*/OPENEULER_RELEASE = "%{release}"/" Makefile.oever
## make linux make mrproper %{_smp_mflags}
Signed-off-by: Xie XiuQi xiexiuqi@huawei.com --- kernel.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/kernel.spec b/kernel.spec index 8c8278c..07c8c39 100644 --- a/kernel.spec +++ b/kernel.spec @@ -28,7 +28,7 @@ %global pkg_release .10
%global openeuler_lts 0 -%global openeuler_major 0 +%global openeuler_major 9999 %global openeuler_minor 0
#