From a0588122758ad4a8c2764c1dfa1b45097e0c95da Mon Sep 17 00:00:00 2001 From: "John L. Hammond" Date: Fri, 9 Nov 2012 16:06:39 -0600 Subject: [PATCH] LU-2288 build: Support build-id links for kernel modules Follow RHEL practice of making kernel modules executable so that their build-id links are installed and perf an other tools can find their debuginfo thereby. Change-Id: I1a288fda0948424b85a61cf4294319dbbe05dd81 Signed-off-by: John L. Hammond Reviewed-on: http://review.whamcloud.com/4491 Tested-by: Hudson Tested-by: Maloo Reviewed-by: Brian J. Murrell Reviewed-by: Keith Mannthey Reviewed-by: Keith Mannthey Reviewed-by: Oleg Drokin --- ldiskfs/lustre-ldiskfs.spec.in | 4 ++++ lnet/autoconf/lustre-lnet.m4 | 10 +++++++--- lustre.spec.in | 4 ++++ 3 files changed, 15 insertions(+), 3 deletions(-) diff --git a/ldiskfs/lustre-ldiskfs.spec.in b/ldiskfs/lustre-ldiskfs.spec.in index 260d30d..d8ea8a1 100644 --- a/ldiskfs/lustre-ldiskfs.spec.in +++ b/ldiskfs/lustre-ldiskfs.spec.in @@ -85,6 +85,10 @@ make install DESTDIR=$RPM_BUILD_ROOT # section. chmod 755 ${RPM_BUILD_ROOT}/lib/modules/%{kversion}/updates/kernel/fs/lustre-ldiskfs/ldiskfs.ko +# mark modules executable for find-debuginfo.sh +find $RPM_BUILD_ROOT/lib/modules/%{kversion}/updates -name "*.ko" -type f | \ + xargs --no-run-if-empty chmod u+x + %files %defattr(644, root, root, 755) /lib/modules/%{kversion}/updates/kernel/fs/lustre-ldiskfs diff --git a/lnet/autoconf/lustre-lnet.m4 b/lnet/autoconf/lustre-lnet.m4 index 9d9ca11..bb30405 100644 --- a/lnet/autoconf/lustre-lnet.m4 +++ b/lnet/autoconf/lustre-lnet.m4 @@ -117,11 +117,12 @@ PTLLNDCPPFLAGS="" if test $ENABLEPORTALS -eq 0; then AC_MSG_RESULT([no]) elif test ! \( -f ${PORTALS}/include/portals/p30.h \); then - AC_MSG_RESULT([no]) + AC_MSG_RESULT([no]) AC_MSG_ERROR([bad --with-portals path]) else - AC_MSG_RESULT([$PORTALS]) - PTLLNDCPPFLAGS="-I${PORTALS}/include" + PORTALS=$(readlink --canonicalize $PORTALS) + AC_MSG_RESULT([$PORTALS]) + PTLLNDCPPFLAGS="-I${PORTALS}/include" fi AC_SUBST(PTLLNDCPPFLAGS) ]) @@ -247,6 +248,7 @@ if test -d $QSNET/drivers/net/qsnet ; then QSWLND="qswlnd" AC_MSG_CHECKING([for multirail EKC]) if test -f $QSNET/include/elan/epcomms.h; then + QSNET=$(readlink --canonicalize $QSNET) AC_MSG_RESULT([supported]) QSWCPPFLAGS="-I$QSNET/include -DMULTIRAIL_EKC=1" else @@ -309,6 +311,7 @@ elif test ! \( -f ${MXPATH}/include/myriexpress.h -a \ *) AC_MSG_ERROR([internal error]);; esac else + MXPATH=$(readlink --canonicalize $MXPATH) MXCPPFLAGS="-I$MXPATH/include" EXTRA_KCFLAGS_save="$EXTRA_KCFLAGS" EXTRA_KCFLAGS="$EXTRA_KCFLAGS $MXCPPFLAGS" @@ -404,6 +407,7 @@ else *) AC_MSG_ERROR([internal error]);; esac else + O2IBPATH=$(readlink --canonicalize $O2IBPATH) O2IBCPPFLAGS="-I$O2IBPATH/include" EXTRA_KCFLAGS_save="$EXTRA_KCFLAGS" EXTRA_KCFLAGS="$EXTRA_KCFLAGS $O2IBCPPFLAGS" diff --git a/lustre.spec.in b/lustre.spec.in index 05920ce..83077d8 100644 --- a/lustre.spec.in +++ b/lustre.spec.in @@ -292,6 +292,10 @@ pushd $RPM_BUILD_ROOT >/dev/null find lib/modules/%{kversion}/updates -type f | awk "!/(ZZZZZZZZZZ$modules_excludes)/ {print \"%attr(-, root, root) /\"\$0}" >>$RPM_BUILD_DIR/lustre-%{version}/lustre-modules.files popd >/dev/null +# mark modules executable for find-debuginfo.sh +find $RPM_BUILD_ROOT/lib/modules/%{kversion}/updates -name "*.ko" -type f | \ + xargs --no-run-if-empty chmod u+x + %files -f lustre.files %files modules -f lustre-modules.files -- 1.8.3.1