Add kmodtool fix to detect different System.map location

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Marcin Skarbek <git@skarbek.name>
Closes #7807 
Closes #11836
This commit is contained in:
Marcin Skarbek 2021-04-07 19:17:39 +02:00 committed by GitHub
parent cfd4a25fce
commit 7367be0da9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -182,9 +182,21 @@ BuildRequires: kernel-devel-uname-r = ${kernel_uname_r}
%{?KmodsRequires:Requires: %{KmodsRequires}-uname-r = ${kernel_uname_r}} %{?KmodsRequires:Requires: %{KmodsRequires}-uname-r = ${kernel_uname_r}}
%{?KmodsRequires:BuildRequires: %{KmodsRequires}-uname-r = ${kernel_uname_r}} %{?KmodsRequires:BuildRequires: %{KmodsRequires}-uname-r = ${kernel_uname_r}}
%post -n kmod-${kmodname}-${kernel_uname_r} %post -n kmod-${kmodname}-${kernel_uname_r}
if [[ -f "/boot/System.map-${kernel_uname_r}" ]]; then
${prefix}${depmod_path} -aeF /boot/System.map-${kernel_uname_r} ${kernel_uname_r} > /dev/null || : ${prefix}${depmod_path} -aeF /boot/System.map-${kernel_uname_r} ${kernel_uname_r} > /dev/null || :
elif [[ -f "/lib/modules/${kernel_uname_r}/System.map" ]]; then
${prefix}${depmod_path} -aeF /lib/modules/${kernel_uname_r}/System.map ${kernel_uname_r} > /dev/null || :
else
${prefix}${depmod_path} -ae ${kernel_uname_r} &> /dev/null || :
fi
%postun -n kmod-${kmodname}-${kernel_uname_r} %postun -n kmod-${kmodname}-${kernel_uname_r}
if [[ -f "/boot/System.map-${kernel_uname_r}" ]]; then
${prefix}${depmod_path} -aF /boot/System.map-${kernel_uname_r} ${kernel_uname_r} &> /dev/null || : ${prefix}${depmod_path} -aF /boot/System.map-${kernel_uname_r} ${kernel_uname_r} &> /dev/null || :
elif [[ -f "/lib/modules/${kernel_uname_r}/System.map" ]]; then
${prefix}${depmod_path} -aF /lib/modules/${kernel_uname_r}/System.map ${kernel_uname_r} &> /dev/null || :
else
${prefix}${depmod_path} -a ${kernel_uname_r} &> /dev/null || :
fi
EOF EOF
else else