Re-add redhat-rpm-config-9.1.0-fix-depmod-path.patch to RHEL 9

Apply contents of redhat-rpm-config-9.1.0-fix-depmod-path.patch from
RHEL 7 branch.

Commit message from the original commit:

    commit 98a159714814bfa24cb912eb3eb4c50186006ca4
    Author: Weiping Pan <wpan@redhat.com>
    Date:   Sun Sep 22 10:53:10 2013 +0800

        fix depmod path

        Since after kmod 5.1, depmod is in /usr/sbin/ instead of /sbin/,
        we have to follow it.
        kmod dis-git commit d398533b871d(version 5).

        Resolves: #1002618

        Signed-off-by: Weiping Pan <wpan@redhat.com>

Resolves: #2002887
Signed-off-by: Eugene Syromiatnikov <esyr@redhat.com>
This commit is contained in:
Eugene Syromiatnikov 2019-01-21 10:27:35 +01:00
parent 581680855a
commit 2a946ba85a

View File

@ -131,8 +131,8 @@ get_rpmtemplate ()
cat <<EOF
Provides: kernel-modules >= ${verrel}${dotvariant}
Provides: ${kmod_name}-kmod = %{?epoch:%{epoch}:}%{version}-%{release}
Requires(post): /sbin/depmod
Requires(postun): /sbin/depmod
Requires(post): /usr/sbin/depmod
Requires(postun): /usr/sbin/depmod
EOF
if [ "yes" != "$nobuildreqs" ]
@ -160,7 +160,7 @@ EOF
cat <<EOF
%post -n kmod-${kmod_name}${dashvariant}
if [ -e "/boot/System.map-${verrel}${dotvariant}" ]; then
/sbin/depmod -aeF "/boot/System.map-${verrel}${dotvariant}" "${verrel}${dotvariant}" > /dev/null || :
/usr/sbin/depmod -aeF "/boot/System.map-${verrel}${dotvariant}" "${verrel}${dotvariant}" > /dev/null || :
fi
modules=( \$(find /lib/modules/${verrel}${dotvariant}/extra/${kmod_name} | grep '\.ko$') )
@ -178,7 +178,7 @@ EOF
cat <<EOF
%postun -n kmod-${kmod_name}${dashvariant}
if [ -e "/boot/System.map-${verrel}${dotvariant}" ]; then
/sbin/depmod -aeF "/boot/System.map-${verrel}${dotvariant}" "${verrel}${dotvariant}" > /dev/null || :
/usr/sbin/depmod -aeF "/boot/System.map-${verrel}${dotvariant}" "${verrel}${dotvariant}" > /dev/null || :
fi
modules=( \$(cat /var/run/rpm-kmod-${kmod_name}${dashvariant}-modules) )