b3f88632de
The following packages are added: - kernel-abi-stablelists is used by find-requires.ksym in order to provide information regarding kABI symbol usage. It's purely informational and optional, however. - redhat-rpm-config and kernel-rpm-macros are added since the generted spec files use macros from these packages. - elfutils-libelf-devel is used during kmod build for ORC metadata generation (used by kernel for stack unwinding). - kmod programs are used by find-requires.ksyms and find-proivides.ksyms for parsing *.ko files during dependency generation. * kmodtool (get_rpm_template): Update the list of generated BuildRequires. * macros.kmp (%kernel_module_package_buildreqs): Update the list of default BuildRequires. Resolves: #2002887 Signed-off-by: Eugene Syromiatnikov <esyr@redhat.com>
51 lines
2.0 KiB
Plaintext
51 lines
2.0 KiB
Plaintext
# Use these macros to differentiate between RH and other KMP implementation(s).
|
|
redhat_kernel_module_package 1
|
|
kernel_module_package_release 1
|
|
|
|
%__find_provides /usr/lib/rpm/redhat/find-provides
|
|
%__find_requires /usr/lib/rpm/redhat/find-requires
|
|
|
|
#kernel_module_package [ -n name ] [ -v version ] [ -r release ] [ -s script ]
|
|
# [ -f filelist] [ -x ] [ -p preamble ] flavor flavor ...
|
|
|
|
%kernel_module_package_buildreqs %global kmodtool_generate_buildreqs 1 \
|
|
kernel-devel kernel-abi-stablelists redhat-rpm-config kernel-rpm-macros elfutils-libelf-devel kmod
|
|
|
|
%kernel_module_package(n:v:r:s:f:xp:) %{expand:%( \
|
|
%global kmodtool %{-s*}%{!-s:/usr/lib/rpm/redhat/kmodtool} \
|
|
%global kmod_version %{-v*}%{!-v:%{version}} \
|
|
%global kmod_release %{-r*}%{!-r:%{release}} \
|
|
%global latest_kernel %(rpm -q --qf '%{VERSION}-%{RELEASE}.%{ARCH}\\\\n' `rpm -qa | egrep "^kernel(-rt|-aarch64)?-devel" | /usr/lib/rpm/redhat/rpmsort -r | head -n 1` | head -n 1) \
|
|
%{!?kernel_version:%{expand:%%global kernel_version %{latest_kernel}}} \
|
|
%global kverrel %(%{kmodtool} verrel %{?kernel_version} 2>/dev/null) \
|
|
flavors="default" \
|
|
if [ -z "%*" ]; then \
|
|
flavors_to_build=$flavors \
|
|
elif [ -z "%{-x}" ]; then \
|
|
flavors_to_build="%*" \
|
|
else \
|
|
flavors_to_build=" $flavors "\
|
|
for i in %* \
|
|
do \
|
|
flavors_to_build=${flavors_to_build//$i /}
|
|
done \
|
|
fi \
|
|
echo "%%global flavors_to_build ${flavors_to_build:-%%nil}" \
|
|
echo "%%global kernel_source() /usr/src/kernels/%kverrel\\\$([ %%%%{1} = default ] || echo ".%%%%{1}")" \
|
|
echo "%%global kernel_module_package_moddir() extra" \
|
|
if [ ! -z "%{-f*}" ] \
|
|
then \
|
|
filelist="%{-f*}" \
|
|
fi \
|
|
if [ ! -z "%{-p*}" ] \
|
|
then \
|
|
preamble="%{-p*}" \
|
|
fi \
|
|
nobuildreqs="yes" \
|
|
if [ "x%{kmodtool_generate_buildreqs}" != "x1" ] \
|
|
then \
|
|
nobuildreqs="no" \
|
|
fi \
|
|
override_filelist="$filelist" override_preamble="$preamble" nobuildreqs="$nobuildreqs" kmod_version=%kmod_version kmod_release=%kmod_release %{kmodtool} rpmtemplate %{-n*}%{!-n:%name} %{kverrel} $flavors_to_build 2>/dev/null \
|
|
)}
|