Projects
openEuler:23.03
kernel
Sign Up
Log In
Username
Password
We truncated the diff of some files because they were too big. If you want to see the full diff for every file,
click here
.
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
Expand all
Collapse all
Changes of Revision 7
View file
_service:tar_scm:kernel.spec
Changed
@@ -1,6 +1,8 @@ %global KernelVer %{version}-%{release}.%{_target_cpu} # The obs worker of RISC-V runs in cross-arch qemu virt, which support # multi-thread maxmium of 8. +%global with_perf 1 + %global _smp_mflags -j8 %define with_source 1 @@ -8,7 +10,6 @@ %global debug_package %{nil} - Name: kernel Version: 6.1.8 Release: 1 @@ -22,6 +23,8 @@ Source0: risc-v-kernel-%{version}.tar.bz2 Source1: openEuler_riscv64_defconfig Source2: extend_defconfig +Source3: cpupower.service +Source4: cpupower.config BuildRequires: module-init-tools, patch >= 2.5.4, bash >= 2.03, tar BuildRequires: bzip2, xz, findutils, gzip, m4, perl, make >= 3.78, diffutils, gawk @@ -67,6 +70,29 @@ %description devel This package provides kernel headers and makefiles sufficient to build modules. +%package tools +Summary: Assortment of tools for the Linux kernel +Provides: %{name}-tools-libs +Obsoletes: %{name}-tools-libs +Provides: cpufreq-utils = 1:009-0.6.p1 +Provides: cpufrequtils = 1:009-0.6.p1 +Obsoletes: cpufreq-utils < 1:009-0.6.p1 +Obsoletes: cpufrequtils < 1:009-0.6.p1 +Obsoletes: cpuspeed < 1:1.5-16 +%description tools +This package contains the tools/ directory from the kernel source +and the supporting documentation. + +%package tools-devel +Summary: Assortment of tools for the Linux kernel +Requires: kernel-tools = %{version}-%{release} +Requires: kernel-tools-libs = %{version}-%{release} +Provides: kernel-tools-libs-devel = %{version}-%{release} +Obsoletes: kernel-tools-libs-devel +%description tools-devel +This package contains the development files for the tools/ directory from +the kernel source. + %if 0%{?with_perf} %package -n perf Summary: Performance monitoring for the Linux kernel @@ -133,9 +159,16 @@ cp -a ../linux-%{KernelVer} ../linux-%{KernelVer}-source %endif +%if 0%{?with_perf} +cp -a tools/perf tools/python3-perf +%endif + + %build cd linux-%{KernelVer} +perl -p -i -e "s/^EXTRAVERSION.*/EXTRAVERSION = -%{release}.%{_target_cpu}/" Makefile + # merge additional configure to defconfig ARCH=$(head -1 %{arch_config} | gawk -F' ' '{print $2}') cat %{arch_config} >> arch/${ARCH}/configs/defconfig @@ -145,11 +178,50 @@ make ARCH=${ARCH} %{?_smp_mflags} make ARCH=${ARCH} %{?_smp_mflags} modules +## make tools +%if 0%{?with_perf} +# perf +%global perf_make make EXTRA_CFLAGS="-Wl,-z,now -g -Wall -fstack-protector-strong -fPIC" EXTRA_PERFLIBS="-fpie -pie" %{?_smp_mflags} -s V=1 WERROR=0 NO_LIBUNWIND=1 HAVE_CPLUS_DEMANGLE=1 NO_GTK2=1 NO_LIBNUMA=1 NO_STRLCPY=1 prefix=%{_prefix} + +%global perf_python3 -C tools/perf PYTHON=%{__python3} + + +chmod +x tools/perf/check-headers.sh +# perf +# make sure check-headers.sh is executable +chmod +x tools/python3-perf/check-headers.sh +%{perf_make} %{perf_python3} all + +pushd tools/perf/Documentation/ +make %{?_smp_mflags} man +popd +%endif + # bpftool pushd tools/bpf/bpftool make %{?_smp_mflags} popd +# cpupower +chmod +x tools/power/cpupower/utils/version-gen.sh +make %{?_smp_mflags} -C tools/power/cpupower CPUFREQ_BENCH=false +# thermal +pushd tools/thermal/tmon/ +make +popd +# iio +pushd tools/iio/ +make +popd +# gpio +pushd tools/gpio/ +make +popd +# kvm +pushd tools/kvm/kvm_stat/ +make %{?_smp_mflags} man +popd + %install %if 0%{?with_source} %define _python_bytecompile_errors_terminate_build 0 @@ -254,6 +326,68 @@ ln -sf build source popd +## install tools +# perf +# perf tool binary and supporting scripts/binaries +%{perf_make} %{perf_python3} DESTDIR=%{buildroot} lib=%{_lib} install-bin install-traceevent-plugins + +# remove the 'trace' symlink. +rm -f %{buildroot}%{_bindir}/trace + +# remove examples +rm -rf %{buildroot}/usr/lib/perf/examples +# remove the stray header file that somehow got packaged in examples +rm -rf %{buildroot}/usr/lib/perf/include/bpf/ + +# python-perf extension +%{perf_make} %{perf_python3} DESTDIR=%{buildroot} install-python_ext + +# perf man pages (note: implicit rpm magic compresses them later) +install -d %{buildroot}/%{_mandir}/man1 +install -pm0644 tools/kvm/kvm_stat/kvm_stat.1 %{buildroot}/%{_mandir}/man1/ +install -pm0644 tools/perf/Documentation/*.1 %{buildroot}/%{_mandir}/man1/ + +# bpftool +pushd tools/bpf/bpftool +make DESTDIR=%{buildroot} prefix=%{_prefix} bash_compdir=%{_sysconfdir}/bash_completion.d/ mandir=%{_mandir} install doc-install +popd +# cpupower +make -C tools/power/cpupower DESTDIR=%{buildroot} libdir=%{_libdir} mandir=%{_mandir} CPUFREQ_BENCH=false install +rm -f %{buildroot}%{_libdir}/*.{a,la} +%find_lang cpupower +mv cpupower.lang ../ +chmod 0755 %{buildroot}%{_libdir}/libcpupower.so* +mkdir -p %{buildroot}%{_unitdir} %{buildroot}%{_sysconfdir}/sysconfig +install -m644 %{SOURCE3} %{buildroot}%{_unitdir}/cpupower.service +install -m644 %{SOURCE4} %{buildroot}%{_sysconfdir}/sysconfig/cpupower +# thermal +pushd tools/thermal/tmon +make INSTALL_ROOT=%{buildroot} install +popd +# iio +pushd tools/iio +make DESTDIR=%{buildroot} install +popd +# gpio +pushd tools/gpio +make DESTDIR=%{buildroot} install +popd +# kvm +pushd tools/kvm/kvm_stat +make INSTALL_ROOT=%{buildroot} install-tools +popd + +%post -n kernel-tools +/sbin/ldconfig +%systemd_post cpupower.service + +%preun -n kernel-tools +%systemd_preun cpupower.service + +%postun -n kernel-tools +/sbin/ldconfig +%systemd_postun cpupower.service + %files %defattr (-, root, root) %doc @@ -282,6 +416,51 @@ %defattr (-, root, root) /usr/include/* +%if 0%{?with_perf} +%files -n perf +%{_bindir}/perf
View file
_service
Changed
@@ -2,7 +2,7 @@ <service name="tar_scm"> <param name="scm">git</param> <param name="url">git@gitee.com:geasscore/risc-v-kernel.git</param> - <param name="revision">kernel-6.1.8</param> + <param name="revision">kernel-6.1.x</param> <param name="submodules">disable</param> <param name="history-depth">1</param> <param name="exclude">*</param>
View file
_service:tar_scm:cpupower.config
Added
@@ -0,0 +1,3 @@ +# See 'cpupower help' and cpupower(1) for more info +CPUPOWER_START_OPTS="frequency-set -g performance" +CPUPOWER_STOP_OPTS="frequency-set -g ondemand"
View file
_service:tar_scm:cpupower.service
Added
@@ -0,0 +1,13 @@ +[Unit] +Description=Configure CPU power related settings +After=syslog.target + +[Service] +Type=oneshot +RemainAfterExit=yes +EnvironmentFile=/etc/sysconfig/cpupower +ExecStart=/usr/bin/cpupower $CPUPOWER_START_OPTS +ExecStop=/usr/bin/cpupower $CPUPOWER_STOP_OPTS + +[Install] +WantedBy=multi-user.target
Locations
Projects
Search
Status Monitor
Help
Open Build Service
OBS Manuals
API Documentation
OBS Portal
Reporting a Bug
Contact
Mailing List
Forums
Chat (IRC)
Twitter
Open Build Service (OBS)
is an
openSUSE project
.
浙ICP备2022010568号-2