Set openEuler version release for 24.03 LTS, 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 24.03 LTS
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 7c2847b..b96f0e9 100644 --- a/kernel.spec +++ b/kernel.spec @@ -44,6 +44,22 @@ rm -f test_openEuler_sign.ko test_openEuler_sign.ko.sig %global maintenance_release .0.0 %global pkg_release .30
+%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 @@ -369,6 +385,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 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/kernel.spec b/kernel.spec index b96f0e9..c9a958f 100644 --- a/kernel.spec +++ b/kernel.spec @@ -44,8 +44,8 @@ rm -f test_openEuler_sign.ko test_openEuler_sign.ko.sig %global maintenance_release .0.0 %global pkg_release .30
-%global openeuler_lts 0 -%global openeuler_major 0 +%global openeuler_lts 1 +%global openeuler_major 2403 %global openeuler_minor 0
#