From 7be8255426234eb3c4cf9a1ff0be7884a182d5dc Mon Sep 17 00:00:00 2001 From: Zheng Zengkai Date: Fri, 6 Sep 2024 11:43:52 +0800 Subject: [PATCH 1/4] kernel.spec: avoid kernel package name dependency by other software packages for 64KB page size kernel To avoid build errors of other software packages caused by name dependency on kernel sub-packages, like kernel-headers, adapt kernel.spec for 64KB page size iso build based on branch openEuler-22.03-LTS-SP4. Signed-off-by: Zheng Zengkai --- kernel.spec | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/kernel.spec b/kernel.spec index 44595da..782d0d1 100644 --- a/kernel.spec +++ b/kernel.spec @@ -11,7 +11,7 @@ %global upstream_sublevel 0 %global devel_release 248 %global maintenance_release .0.0 -%global pkg_release .147 +%global pkg_release .148 %define with_debuginfo 1 # Do not recompute the build-id of vmlinux in find-debuginfo.sh @@ -31,15 +31,13 @@ %ifarch aarch64 %define with_64kb %{?_with_64kb: 1} %{?!_with_64kb: 0} %if %{with_64kb} -%global package64kb -64kb -%global kv_suffix +64kb %define with_kabichk 0 %endif %else %define with_64kb 0 %endif -%global KernelVer %{version}-%{release}.%{_target_cpu}%{?kv_suffix} +%global KernelVer %{version}-%{release}.%{_target_cpu} #default is enabled. You can disable it with --without option %define with_perf %{?_without_perf: 0} %{?!_without_perf: 1} @@ -242,8 +240,8 @@ package or when debugging this package.\ %{nil} %if %{with_64kb} -%debuginfo_template -n kernel-64kb -%files -n kernel-64kb-debuginfo -f debugfiles.list +%debuginfo_template -n kernel +%files -n kernel-debuginfo -f debugfiles.list %else %debuginfo_template -n kernel %files -n kernel-debuginfo -f debugfiles.list @@ -344,7 +342,7 @@ cp -a tools/perf tools/python3-perf %build cd linux-%{KernelVer} -perl -p -i -e "s/^EXTRAVERSION.*/EXTRAVERSION = -%{release}.%{_target_cpu}%{?kv_suffix}/" Makefile +perl -p -i -e "s/^EXTRAVERSION.*/EXTRAVERSION = -%{release}.%{_target_cpu}/" Makefile ## make linux make mrproper %{_smp_mflags} @@ -952,6 +950,9 @@ fi %endif %changelog +* Thu Feb 06 2025 Zheng Zengkai - 5.10.0-248.0.0.148 +- kernel.spec: avoid kernel package name dependency by other software packages for 64KB page size kernel + * Thu Feb 06 2025 Li Nan - 5.10.0-248.0.0.147 - !14995 mm/compaction: fix UBSAN shift-out-of-bounds warning - mm/compaction: fix UBSAN shift-out-of-bounds warning From ed4b685c300d9235905aa3036413947234f90b0c Mon Sep 17 00:00:00 2001 From: Zheng Zengkai Date: Fri, 6 Sep 2024 17:26:56 +0800 Subject: [PATCH 2/4] kernel.spec: build kernel tools for 64KB version In order to build kernel tools for 64KB version, partially revert commit 61bb128dae4c0 ("aarch64: support standalone 64kb PAGE_SIZE build"). Signed-off-by: Zheng Zengkai --- kernel.spec | 23 ++++------------------- 1 file changed, 4 insertions(+), 19 deletions(-) diff --git a/kernel.spec b/kernel.spec index 782d0d1..14d397b 100644 --- a/kernel.spec +++ b/kernel.spec @@ -11,7 +11,7 @@ %global upstream_sublevel 0 %global devel_release 248 %global maintenance_release .0.0 -%global pkg_release .148 +%global pkg_release .149 %define with_debuginfo 1 # Do not recompute the build-id of vmlinux in find-debuginfo.sh @@ -161,7 +161,6 @@ Requires: perl findutils This package provides kernel headers and makefiles sufficient to build modules against the %{KernelVer} kernel package. -%if !%{with_64kb} %package tools Summary: Assortment of tools for the Linux kernel Provides: %{name}-tools-libs @@ -221,7 +220,6 @@ manipulation of eBPF programs and maps. Summary: the kernel source %description source This package contains vaious source files from the kernel. -%endif %if 0%{?with_debuginfo} %define _debuginfo_template %{nil} @@ -239,10 +237,6 @@ Debug information is useful when developing applications that use this\ package or when debugging this package.\ %{nil} -%if %{with_64kb} -%debuginfo_template -n kernel -%files -n kernel-debuginfo -f debugfiles.list -%else %debuginfo_template -n kernel %files -n kernel-debuginfo -f debugfiles.list @@ -270,8 +264,6 @@ package or when debugging this package.\ %{expand:%%global _find_debuginfo_opts %{?_find_debuginfo_opts} -p '.*%{python3_sitearch}/perf.*(.debug)?|XXX' -o python3-perf-debugfiles.list} #with_perf %endif -#with_64kb -%endif %endif %prep @@ -456,7 +448,6 @@ make BPFTOOL=../../tools/bpf/bpftool/bpftool popd %install -%if !%{with_64kb} %if 0%{?with_source} %define _python_bytecompile_errors_terminate_build 0 mkdir -p $RPM_BUILD_ROOT/usr/src/ @@ -464,7 +455,6 @@ popd cp linux-%{KernelVer}/.config $RPM_BUILD_ROOT/usr/src/linux-%{KernelVer}/ cp linux-%{KernelVer}/.scmversion $RPM_BUILD_ROOT/usr/src/linux-%{KernelVer}/ %endif -%endif cd linux-%{KernelVer} @@ -673,7 +663,6 @@ popd ## install tools -%if !%{with_64kb} %if %{with_perf} # perf # perf tool binary and supporting scripts/binaries @@ -755,7 +744,6 @@ popd pushd tools/netacc make INSTALL_ROOT=%{buildroot} install popd -%endif %define __spec_install_post\ %{?__debug_package:%{__debug_install_post}}\ @@ -812,7 +800,6 @@ then done) fi -%if !%{with_64kb} %post -n %{name}-tools /sbin/ldconfig %systemd_post cpupower.service @@ -823,7 +810,6 @@ fi %postun -n %{name}-tools /sbin/ldconfig %systemd_postun cpupower.service -%endif %files %defattr (-, root, root) @@ -856,7 +842,6 @@ fi %defattr (-, root, root) /usr/include/* -%if !%{with_64kb} %if %{with_perf} %files -n perf %{_bindir}/perf @@ -946,10 +931,10 @@ fi /usr/src/linux-%{KernelVer}/.scmversion %endif -#with_64kb -%endif - %changelog +* Thu Feb 06 2025 Zheng Zengkai - 5.10.0-248.0.0.149 +- kernel.spec: build kernel tools for 64KB version + * Thu Feb 06 2025 Zheng Zengkai - 5.10.0-248.0.0.148 - kernel.spec: avoid kernel package name dependency by other software packages for 64KB page size kernel From 89e22d31ac843af0d5b6979b6709612b033baaf4 Mon Sep 17 00:00:00 2001 From: Zheng Zengkai Date: Mon, 9 Sep 2024 09:46:40 +0800 Subject: [PATCH 3/4] kernel.spec: fix posttrans kernel scriptlet failed for 64KB version As commit 17c97290621 ("Enable kabi checking and adapt the check-kabi script") dropped /boot/symvers-*.gz if with_kabichk was unset(64K situation), the error that "Symvers dump file is not found in /boot/symvers-*.gz" is reported during kernel rpm install, causing posttrans kernel scriptlet failed. Signed-off-by: Zheng Zengkai --- kernel.spec | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/kernel.spec b/kernel.spec index 14d397b..2a3bc79 100644 --- a/kernel.spec +++ b/kernel.spec @@ -11,7 +11,7 @@ %global upstream_sublevel 0 %global devel_release 248 %global maintenance_release .0.0 -%global pkg_release .149 +%global pkg_release .150 %define with_debuginfo 1 # Do not recompute the build-id of vmlinux in find-debuginfo.sh @@ -492,9 +492,7 @@ popd install -m 644 .config $RPM_BUILD_ROOT/boot/config-%{KernelVer} install -m 644 System.map $RPM_BUILD_ROOT/boot/System.map-%{KernelVer} -%if 0%{?with_kabichk} - gzip -c9 < Module.symvers > $RPM_BUILD_ROOT/boot/symvers-%{KernelVer}.gz -%endif +gzip -c9 < Module.symvers > $RPM_BUILD_ROOT/boot/symvers-%{KernelVer}.gz mkdir -p $RPM_BUILD_ROOT%{_sbindir} install -m 755 %{SOURCE200} $RPM_BUILD_ROOT%{_sbindir}/mkgrub-menu-%{devel_release}.sh @@ -818,9 +816,7 @@ fi %ifarch aarch64 /boot/dtb-* %endif -%if 0%{?with_kabichk} /boot/symvers-* -%endif /boot/System.map-* /boot/vmlinuz-* %ghost /boot/initramfs-%{KernelVer}.img @@ -932,6 +928,9 @@ fi %endif %changelog +* Thu Feb 06 2025 Zheng Zengkai - 5.10.0-248.0.0.150 +- kernel.spec: fix posttrans kernel scriptlet failed for 64KB version + * Thu Feb 06 2025 Zheng Zengkai - 5.10.0-248.0.0.149 - kernel.spec: build kernel tools for 64KB version From 190249f8a54d82f45c1f380b9f3350acea832a4b Mon Sep 17 00:00:00 2001 From: Zheng Zengkai Date: Thu, 2 Jan 2025 21:59:23 +0800 Subject: [PATCH 4/4] kernel.spec: remove the PA VA bits change for 64KB kernel As there is no need to change CONFIG_ARM64_PA_BITS and CONFIG_ARM64_VA_BITS to 52 for 64KB page size kernel. Remove these CONFIG modification. BTW, Remove the redundant package64kb suffix for kernel as well. Signed-off-by: Zheng Zengkai --- kernel.spec | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/kernel.spec b/kernel.spec index 2a3bc79..f4f99d8 100644 --- a/kernel.spec +++ b/kernel.spec @@ -11,7 +11,7 @@ %global upstream_sublevel 0 %global devel_release 248 %global maintenance_release .0.0 -%global pkg_release .150 +%global pkg_release .151 %define with_debuginfo 1 # Do not recompute the build-id of vmlinux in find-debuginfo.sh @@ -42,7 +42,7 @@ #default is enabled. You can disable it with --without option %define with_perf %{?_without_perf: 0} %{?!_without_perf: 1} -Name: kernel%{?package64kb} +Name: kernel Version: %{upstream_version}.%{upstream_sublevel} Release: %{devel_release}%{?maintenance_release}%{?pkg_release}%{?extra_release} Summary: Linux Kernel @@ -341,10 +341,6 @@ make mrproper %{_smp_mflags} %if %{with_64kb} sed -i arch/arm64/configs/openeuler_defconfig -e 's/^CONFIG_ARM64_4K_PAGES.*/CONFIG_ARM64_64K_PAGES=y/' -sed -i arch/arm64/configs/openeuler_defconfig -e 's/^CONFIG_ARM64_PA_BITS=.*/CONFIG_ARM64_PA_BITS=52/' -sed -i arch/arm64/configs/openeuler_defconfig -e 's/^CONFIG_ARM64_PA_BITS_.*/CONFIG_ARM64_PA_BITS_52=y/' -sed -i arch/arm64/configs/openeuler_defconfig -e 's/^CONFIG_ARM64_VA_BITS=.*/CONFIG_ARM64_VA_BITS=52/' -sed -i arch/arm64/configs/openeuler_defconfig -e 's/^CONFIG_ARM64_VA_BITS_.*/CONFIG_ARM64_VA_BITS_52=y/' %endif make ARCH=%{Arch} openeuler_defconfig @@ -928,6 +924,9 @@ fi %endif %changelog +* Thu Feb 06 2025 Zheng Zengkai - 5.10.0-248.0.0.151 +- kernel.spec: remove the PA/VA BITS change for 64KB page size kernel + * Thu Feb 06 2025 Zheng Zengkai - 5.10.0-248.0.0.150 - kernel.spec: fix posttrans kernel scriptlet failed for 64KB version