From: Prarit Bhargava prarit@redhat.com
redhat: build and include memfd to kernel-selftests-internal
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=2027506 Upstream Status: RHEL9 only Tested: by reporter
This patch adds memfd to the list of selftests built and packaged in kernel-selftests-internal.
Signed-off-by: Aristeu Rozanski arozansk@redhat.com Signed-off-by: Prarit Bhargava prarit@redhat.com
diff --git a/redhat/kernel.spec.template b/redhat/kernel.spec.template index blahblah..blahblah 100755 --- a/redhat/kernel.spec.template +++ b/redhat/kernel.spec.template @@ -630,7 +630,7 @@ BuildRequires: python3-docutils BuildRequires: zlib-devel binutils-devel %endif %if %{with_selftests} -BuildRequires: clang llvm +BuildRequires: clang llvm fuse-devel %ifnarch %{arm} BuildRequires: numactl-devel %endif @@ -1077,7 +1077,7 @@ This package provides debug information for the bpftool package. %package selftests-internal Summary: Kernel samples and selftests License: GPLv2 -Requires: binutils, bpftool, iproute-tc, nmap-ncat, python3 +Requires: binutils, bpftool, iproute-tc, nmap-ncat, python3, fuse-libs %description selftests-internal Kernel sample programs and selftests.
@@ -2356,7 +2356,7 @@ pushd tools/testing/selftests # We need to install here because we need to call make with ARCH set which # doesn't seem possible to do in the install section.
-%{make} %{?_smp_mflags} ARCH=$Arch V=1 TARGETS="bpf vm livepatch net net/forwarding net/mptcp netfilter tc-testing" SKIP_TARGETS="" FORCE_TARGETS=%{selftests_must_build} INSTALL_PATH=%{buildroot}%{_libexecdir}/kselftests VMLINUX_H="${RPM_VMLINUX_H}" install +%{make} %{?_smp_mflags} ARCH=$Arch V=1 TARGETS="bpf vm livepatch net net/forwarding net/mptcp netfilter tc-testing memfd" SKIP_TARGETS="" FORCE_TARGETS=%{selftests_must_build} INSTALL_PATH=%{buildroot}%{_libexecdir}/kselftests VMLINUX_H="${RPM_VMLINUX_H}" install
# 'make install' for bpf is broken and upstream refuses to fix it. # Install the needed files manually. @@ -2694,6 +2694,13 @@ find -type d -exec install -d %{buildroot}%{_libexecdir}/kselftests/netfilter/{} find -type f -executable -exec install -D -m755 {} %{buildroot}%{_libexecdir}/kselftests/netfilter/{} ; find -type f ! -executable -exec install -D -m644 {} %{buildroot}%{_libexecdir}/kselftests/netfilter/{} ; popd + +# install memfd selftests +pushd tools/testing/selftests/memfd +find -type d -exec install -d %{buildroot}%{_libexecdir}/kselftests/memfd/{} ; +find -type f -executable -exec install -D -m755 {} %{buildroot}%{_libexecdir}/kselftests/memfd/{} ; +find -type f ! -executable -exec install -D -m644 {} %{buildroot}%{_libexecdir}/kselftests/memfd/{} ; +popd %endif
###
-- https://gitlab.com/cki-project/kernel-ark/-/merge_requests/2021