aarch64: support standalone 64kb PAGE_SIZE build

Signed-off-by: zhaoxiaoqiang11 <zhaoxiaoqiang11@jd.com>
This commit is contained in:
zhaoxiaoqiang11 2023-12-06 17:18:05 +08:00
parent 358c99536c
commit ed51625dae

View File

@ -5,14 +5,13 @@
%global Arch $(echo %{_host_cpu} | sed -e s/i.86/x86/ -e s/x86_64/x86/ -e s/aarch64.*/arm64/) %global Arch $(echo %{_host_cpu} | sed -e s/i.86/x86/ -e s/x86_64/x86/ -e s/aarch64.*/arm64/)
%global KernelVer %{version}-%{release}.%{_target_cpu}
%global debuginfodir /usr/lib/debug %global debuginfodir /usr/lib/debug
%global upstream_version 5.10 %global upstream_version 5.10
%global upstream_sublevel 0 %global upstream_sublevel 0
%global devel_release 176 %global devel_release 176
%global maintenance_release .0.0 %global maintenance_release .0.0
%global pkg_release .89 %global pkg_release .90
%define with_debuginfo 1 %define with_debuginfo 1
# Do not recompute the build-id of vmlinux in find-debuginfo.sh # Do not recompute the build-id of vmlinux in find-debuginfo.sh
@ -33,11 +32,15 @@
%define with_64kb %{?_with_64kb: 1} %{?!_with_64kb: 0} %define with_64kb %{?_with_64kb: 1} %{?!_with_64kb: 0}
%if %{with_64kb} %if %{with_64kb}
%global package64kb -64kb %global package64kb -64kb
%global kv_suffix +64kb
%define with_kabichk 0
%endif %endif
%else %else
%define with_64kb 0 %define with_64kb 0
%endif %endif
%global KernelVer %{version}-%{release}.%{_target_cpu}%{?kv_suffix}
#default is enabled. You can disable it with --without option #default is enabled. You can disable it with --without option
%define with_perf %{?_without_perf: 0} %{?!_without_perf: 1} %define with_perf %{?_without_perf: 0} %{?!_without_perf: 1}
@ -156,6 +159,7 @@ Requires: perl findutils
This package provides kernel headers and makefiles sufficient to build modules This package provides kernel headers and makefiles sufficient to build modules
against the %{KernelVer} kernel package. against the %{KernelVer} kernel package.
%if !%{with_64kb}
%package tools %package tools
Summary: Assortment of tools for the Linux kernel Summary: Assortment of tools for the Linux kernel
Provides: %{name}-tools-libs Provides: %{name}-tools-libs
@ -209,6 +213,7 @@ language to use the interface to manipulate perf events.
Summary: the kernel source Summary: the kernel source
%description source %description source
This package contains vaious source files from the kernel. This package contains vaious source files from the kernel.
%endif
%if 0%{?with_debuginfo} %if 0%{?with_debuginfo}
%define _debuginfo_template %{nil} %define _debuginfo_template %{nil}
@ -226,6 +231,10 @@ Debug information is useful when developing applications that use this\
package or when debugging this package.\ package or when debugging this package.\
%{nil} %{nil}
%if %{with_64kb}
%debuginfo_template -n kernel-64kb
%files -n kernel-64kb-debuginfo -f debugfiles.list
%else
%debuginfo_template -n kernel %debuginfo_template -n kernel
%files -n kernel-debuginfo -f debugfiles.list %files -n kernel-debuginfo -f debugfiles.list
@ -249,7 +258,8 @@ 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} %{expand:%%global _find_debuginfo_opts %{?_find_debuginfo_opts} -p '.*%{python3_sitearch}/perf.*(.debug)?|XXX' -o python3-perf-debugfiles.list}
#with_perf #with_perf
%endif %endif
#with_64kb
%endif
%endif %endif
%prep %prep
@ -320,7 +330,7 @@ cp -a tools/perf tools/python3-perf
%build %build
cd linux-%{KernelVer} cd linux-%{KernelVer}
perl -p -i -e "s/^EXTRAVERSION.*/EXTRAVERSION = -%{release}.%{_target_cpu}/" Makefile perl -p -i -e "s/^EXTRAVERSION.*/EXTRAVERSION = -%{release}.%{_target_cpu}%{?kv_suffix}/" Makefile
## make linux ## make linux
make mrproper %{_smp_mflags} make mrproper %{_smp_mflags}
@ -429,6 +439,7 @@ make BPFTOOL=../../tools/bpf/bpftool/bpftool
popd popd
%install %install
%if !%{with_64kb}
%if 0%{?with_source} %if 0%{?with_source}
%define _python_bytecompile_errors_terminate_build 0 %define _python_bytecompile_errors_terminate_build 0
mkdir -p $RPM_BUILD_ROOT/usr/src/ mkdir -p $RPM_BUILD_ROOT/usr/src/
@ -436,6 +447,7 @@ popd
cp linux-%{KernelVer}/.config $RPM_BUILD_ROOT/usr/src/linux-%{KernelVer}/ cp linux-%{KernelVer}/.config $RPM_BUILD_ROOT/usr/src/linux-%{KernelVer}/
cp linux-%{KernelVer}/.scmversion $RPM_BUILD_ROOT/usr/src/linux-%{KernelVer}/ cp linux-%{KernelVer}/.scmversion $RPM_BUILD_ROOT/usr/src/linux-%{KernelVer}/
%endif %endif
%endif
cd linux-%{KernelVer} cd linux-%{KernelVer}
@ -642,6 +654,7 @@ popd
## install tools ## install tools
%if !%{with_64kb}
%if %{with_perf} %if %{with_perf}
# perf # perf
# perf tool binary and supporting scripts/binaries # perf tool binary and supporting scripts/binaries
@ -719,6 +732,7 @@ popd
pushd tools/netacc pushd tools/netacc
make INSTALL_ROOT=%{buildroot} install make INSTALL_ROOT=%{buildroot} install
popd popd
%endif
%define __spec_install_post\ %define __spec_install_post\
%{?__debug_package:%{__debug_install_post}}\ %{?__debug_package:%{__debug_install_post}}\
@ -775,6 +789,7 @@ then
done) done)
fi fi
%if !%{with_64kb}
%post -n %{name}-tools %post -n %{name}-tools
/sbin/ldconfig /sbin/ldconfig
%systemd_post cpupower.service %systemd_post cpupower.service
@ -785,6 +800,7 @@ fi
%postun -n %{name}-tools %postun -n %{name}-tools
/sbin/ldconfig /sbin/ldconfig
%systemd_postun cpupower.service %systemd_postun cpupower.service
%endif
%files %files
%defattr (-, root, root) %defattr (-, root, root)
@ -815,6 +831,7 @@ fi
%defattr (-, root, root) %defattr (-, root, root)
/usr/include/* /usr/include/*
%if !%{with_64kb}
%if %{with_perf} %if %{with_perf}
%files -n perf %files -n perf
%{_bindir}/perf %{_bindir}/perf
@ -886,7 +903,13 @@ fi
/usr/src/linux-%{KernelVer}/.scmversion /usr/src/linux-%{KernelVer}/.scmversion
%endif %endif
#with_64kb
%endif
%changelog %changelog
* Tue Dec 12 2023 zhaoxiaoqiang11 <zhaoxiaoqiang11@jd.com> - 5.10.0-176.0.0.90
- adapt spec for arm64 64kb page build
* Thu Dec 07 2023 Jialin Zhang <zhangjialin11@huawei.com> - 5.10.0-176.0.0.89 * Thu Dec 07 2023 Jialin Zhang <zhangjialin11@huawei.com> - 5.10.0-176.0.0.89
- !3226 hinic: ethtool: Allow userspace to set more aggregation params - !3226 hinic: ethtool: Allow userspace to set more aggregation params
- !3259 mbigen: vtimer: isolate mbigen vtimer funcs with macro - !3259 mbigen: vtimer: isolate mbigen vtimer funcs with macro