From: Stephan Wiesand Date: Wed, 7 May 2014 13:20:51 +0000 (+0200) Subject: redhat: Use the right path to depmod X-Git-Tag: upstream/1.6.10_pre1^2~114 X-Git-Url: https://git.michaelhowe.org/gitweb/?a=commitdiff_plain;h=6609a7dfa4884f8996102e220546ac2023719ad4;p=packages%2Fo%2Fopenafs.git redhat: Use the right path to depmod As of Fedora 17 and RHEL 7, depmod has moved from /sbin to /usr/sbin. The full path to depmod is used in package scripts and as a dependency. This hasn't caused problems in most cases because on an installed system a link /sbin -> /usr/sbin is present and during ordinary package installations yum/rpm correctly then figure out that /sbin/depmod is actually provided. But in other situations, the dependency check is not that clever and (incorrectly) fails. Add a macro to the spec defining the full path to depmod, use the macro rather than plain /sbin/depmod throughout the spec, and also pass it to kmodtool when required to generate the kmod package scripts and requirements. FIXES 131860 Reviewed-on: http://gerrit.openafs.org/11128 Tested-by: BuildBot Reviewed-by: Benjamin Kaduk Reviewed-by: Perry Ruiter Reviewed-by: D Brashear (cherry picked from commit c20c01185ed748b2bc823369a8f28cf004b7d1c9) Change-Id: Ib9e0bfe586de668ddba6fb82ff1ea2a081277150 Reviewed-on: http://gerrit.openafs.org/11171 Tested-by: BuildBot Reviewed-by: Andrew Deason Reviewed-by: Perry Ruiter Reviewed-by: Ken Dreyer Reviewed-by: Stephan Wiesand --- diff --git a/src/packaging/RedHat/openafs-kmodtool b/src/packaging/RedHat/openafs-kmodtool index b9ae6661b..88d10b2c5 100644 --- a/src/packaging/RedHat/openafs-kmodtool +++ b/src/packaging/RedHat/openafs-kmodtool @@ -100,17 +100,17 @@ Provides: ${kmod_name}-kmod = %{?epoch:%{epoch}:}%{version}-%{release} Provides: openafs-kernel = %{PACKAGE_VERSION} Requires: ${kdep} Requires: ${kmod_name}-kmod-common >= %{?epoch:%{epoch}:}%{version} -Requires(post): /sbin/depmod -Requires(postun): /sbin/depmod +Requires(post): ${depmod} +Requires(postun): ${depmod} Release: %{pkgrel}.%(echo ${verrel} | tr - _) BuildRequires: kernel${dashvariant}-devel-%{_target_cpu} = ${verrel} %description -n kmod-${kmod_name}${dashvariant} This package provides the ${kmod_name} kernel modules built for the Linux kernel ${kname} for the %{_target_cpu} family of processors. %post -n kmod-${kmod_name}${dashvariant} -/sbin/depmod -aeF /boot/System.map-${kname} ${kname} > /dev/null || : +${depmod} -aeF /boot/System.map-${kname} ${kname} > /dev/null || : %postun -n kmod-${kmod_name}${dashvariant} -/sbin/depmod -aF /boot/System.map-${kname} ${kname} &> /dev/null || : +${depmod} -aF /boot/System.map-${kname} ${kname} &> /dev/null || : %files -n kmod-${kmod_name}${dashvariant} %defattr(644,root,root,755) /lib/modules/${kname}/extra/${kmod_name}/ @@ -125,12 +125,17 @@ print_rpmtemplate () kver="${1}" get_verrel "${1}" shift + depmod="${1}" + shift if [ -z "${kmod_name}" ] ; then echo "Please provide the kmodule-name as first parameter." >&2 exit 2 elif [ -z "${kver}" ] ; then echo "Please provide the kver as second parameter." >&2 exit 2 + elif [ -z "${depmod}" ] ; then + echo "Please provide the full path to depmod as third parameter." >&2 + exit 2 elif [ -z "${verrel}" ] ; then echo "Couldn't find out the verrel." >&2 exit 2 @@ -152,7 +157,7 @@ Usage: ${myprog}