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(+)
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 dff9283..7c4efab 100644 --- a/kernel.spec +++ b/kernel.spec @@ -27,6 +27,22 @@ %global maintenance_release .0.0 %global pkg_release .15
+%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 @@ -357,6 +373,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 7c4efab..7f26158 100644 --- a/kernel.spec +++ b/kernel.spec @@ -27,8 +27,8 @@ %global maintenance_release .0.0 %global pkg_release .15
-%global openeuler_lts 0 -%global openeuler_major 0 +%global openeuler_lts 1 +%global openeuler_major 2403 %global openeuler_minor 0
#