From 837ec9dd41c4b1e10ad9d32a52b0f34dd665026a Mon Sep 17 00:00:00 2001 From: Andrew Deason Date: Thu, 26 Dec 2013 12:56:37 -0500 Subject: [PATCH] Fedora: Handle new kernel variant paths With Fedora 20, Fedora now separates the variant from the rest of the kernel version with a plus (+) instead of a period (.) . This results in directories called e.g. 3.12.5-302.fc20.i686+PAE, where right now we look for 3.12.5-302.fc20.i686.PAE. Use this new directory scheme for Fedora 20 builds, so we can build against non-default kernel variants on Fedora 20 and beyond. Change-Id: I309272f4f4f740058c48e92530e40a1c64d63668 Reviewed-on: http://gerrit.openafs.org/10620 Reviewed-by: Derrick Brashear Tested-by: BuildBot Reviewed-by: Ken Dreyer --- src/packaging/RedHat/openafs-kmodtool | 4 +++- src/packaging/RedHat/openafs.spec.in | 13 +++++++++++++ 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/src/packaging/RedHat/openafs-kmodtool b/src/packaging/RedHat/openafs-kmodtool index 8451b35777..b9ae6661bd 100644 --- a/src/packaging/RedHat/openafs-kmodtool +++ b/src/packaging/RedHat/openafs-kmodtool @@ -83,7 +83,9 @@ get_rpmtemplate () case "$verrel" in *.el[6-9]*) kname="${verrel}.%{_target_cpu}${variant:+.${variant}}" ;; - *.fc[1-9][0-9]*) + *.fc[2-9][0-9]*) + kname="${verrel}.%{_target_cpu}${variant:++${variant}}" ;; + *.fc1[0-9]*) kname="${verrel}.%{_target_cpu}${variant:+.${variant}}" ;; *.fc9*) kname="${verrel}.%{_target_cpu}${variant:+.${variant}}" ;; *) kname="${verrel}${variant}" ;; diff --git a/src/packaging/RedHat/openafs.spec.in b/src/packaging/RedHat/openafs.spec.in index 2af07bed16..f77e0beadd 100644 --- a/src/packaging/RedHat/openafs.spec.in +++ b/src/packaging/RedHat/openafs.spec.in @@ -848,6 +848,8 @@ ksrc="" if [ -z "${kvariant}" -o -z "$ksrc" ] ; then if [ -d %{_usrsrc}/kernels/%{kverrel}${kvariant:+-$kvariant}-%{_target_cpu} ] ; then ksrc=%{_usrsrc}/kernels/%{kverrel}${kvariant:+-$kvariant}-%{_target_cpu} + elif [ -d %{_usrsrc}/kernels/%{kverrel}.%{_target_cpu}${kvariant:++$kvariant} ] ; then + ksrc=%{_usrsrc}/kernels/%{kverrel}.%{_target_cpu}${kvariant:++$kvariant} else ksrc=%{_usrsrc}/kernels/%{kverrel}.%{_target_cpu}${kvariant:+.$kvariant} fi @@ -892,8 +894,16 @@ make only_libafs_tree || exit 1 %if %{fedorakmod} && %{build_modules} for kvariant in %{kvariants} ; do if [ -n "${kvariant}" ] ; then + if [ -d %{_usrsrc}/kernels/%{kverrel}${kvariant:+-$kvariant}-%{_target_cpu} ] ; then ksrc=%{_usrsrc}/kernels/%{kverrel}${kvariant:+-$kvariant}-%{_target_cpu} + + elif [ -d %{_usrsrc}/kernels/%{kverrel}.%{_target_cpu}${kvariant:++$kvariant} ] ; then + # Fedora 20 started putting kernel sources in e.g. + # 3.12.5-302.fc20.i686+PAE, instead of: + # 3.12.5-302.fc20.i686.PAE + ksrc=%{_usrsrc}/kernels/%{kverrel}.%{_target_cpu}${kvariant:++$kvariant} + else ksrc=%{_usrsrc}/kernels/%{kverrel}.%{_target_cpu}${kvariant:+.$kvariant} fi @@ -1267,6 +1277,9 @@ do if [ -d _kmod_build_$kvariant/src/libafs/MODLOAD-%{kverrel}${kvariant}-SP ] ; then srcdir=_kmod_build_$kvariant/src/libafs/MODLOAD-%{kverrel}${kvariant}-SP dstdir=$RPM_BUILD_ROOT/lib/modules/%{kverrel}${kvariant}/extra/openafs + elif [ -d _kmod_build_$kvariant/src/libafs/MODLOAD-%{kverrel}.%{_target_cpu}+${kvariant}-SP ] ; then + srcdir=_kmod_build_$kvariant/src/libafs/MODLOAD-%{kverrel}.%{_target_cpu}+${kvariant}-SP + dstdir=$RPM_BUILD_ROOT/lib/modules/%{kverrel}.%{_target_cpu}+${kvariant}/extra/openafs else srcdir=_kmod_build_$kvariant/src/libafs/MODLOAD-%{kverrel}.%{_target_cpu}.${kvariant}-SP dstdir=$RPM_BUILD_ROOT/lib/modules/%{kverrel}.%{_target_cpu}.${kvariant}/extra/openafs