Whamcloud - gitweb
LU-2288 build: Support build-id links for kernel modules
authorJohn L. Hammond <jhammond@tacc.utexas.edu>
Fri, 9 Nov 2012 22:06:39 +0000 (16:06 -0600)
committerOleg Drokin <green@whamcloud.com>
Tue, 8 Jan 2013 05:10:12 +0000 (00:10 -0500)
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 <jhammond@tacc.utexas.edu>
Reviewed-on: http://review.whamcloud.com/4491
Tested-by: Hudson
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Brian J. Murrell <brian.murrell@intel.com>
Reviewed-by: Keith Mannthey <kemannthey@gmail.com>
Reviewed-by: Keith Mannthey <keith.mannthey@intel.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
ldiskfs/lustre-ldiskfs.spec.in
lnet/autoconf/lustre-lnet.m4
lustre.spec.in

index 260d30d..d8ea8a1 100644 (file)
@@ -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
index 9d9ca11..bb30405 100644 (file)
@@ -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"
index 05920ce..83077d8 100644 (file)
@@ -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