Whamcloud - gitweb
LU-7962 build: Support builds w/ weak module ZFS 49/19249/4
authorChristopher J. Morrone <morrone2@llnl.gov>
Tue, 4 Aug 2015 01:37:47 +0000 (18:37 -0700)
committerOleg Drokin <oleg.drokin@intel.com>
Mon, 11 Apr 2016 02:52:17 +0000 (02:52 +0000)
Now that ZFS supports weak module updates, ZFS does will not
always be built for every specific kernel that is installed.
Unfortunately, some directories that Lustre needs from ZFS and
SPL have a kernel string embedded in them, and now that kernel
string will potentially be different than the kernel that
Lustre is building against.

As a work around we can update the Lustre build scripts to just
select the last subdirectory (after all other methods fail) that
has a kernel name from the ZFS and SPL build directories as a
directory that Lustre should use in its build. Its as reasonable
a guess as I can figure we can easily make.

Change-Id: Id17940b78b99ddb8b589d1f46f85c3282c71a3ad
Signed-off-by: Christopher J. Morrone <morrone2@llnl.gov>
Reviewed-on: http://review.whamcloud.com/19249
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Nathaniel Clark <nathaniel.l.clark@intel.com>
Reviewed-by: Faccini Bruno <bruno.faccini@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
config/lustre-build-zfs.m4

index 0d45ce4..611e09d 100644 (file)
@@ -105,10 +105,13 @@ AC_DEFUN([LB_SPL], [
        dnl # The existence of the spl_config.h is used to identify a valid
        dnl # spl object directory.  In many cases the object and source
        dnl # directory are the same, however the objects may also reside
-       dnl # is a subdirectory named after the kernel version.
+       dnl # is a subdirectory named after the kernel version.  When
+       dnl # weak modules are used, the kernel version may not be the
+       dnl # same as the LINUXRELEASE against which we are building lustre.
        dnl #
        AC_MSG_CHECKING([spl build directory])
        AS_IF([test -z "$splobj"], [
+               last_spl_obj_dir=$(ls -d ${splsrc}/[[0-9]]*/ | tail -n 1 | sed 's|/$||')
                AS_IF([test "${splsrc}" = "${spldkms}/source"], [
                        AS_IF([test -e "${spldkms}/${LINUXRELEASE}/${target_cpu}/spl_config.h"], [
                                splobj=${spldkms}/${LINUXRELEASE}/${target_cpu}
@@ -119,6 +122,8 @@ AC_DEFUN([LB_SPL], [
                        splobj="${splsrc}/${LINUXRELEASE}"
                ], [test -e "${splsrc}/spl_config.h"], [
                        splobj="${splsrc}"
+               ], [test -e "${last_spl_obj_dir}/spl_config.h"], [
+                       splobj="${last_spl_obj_dir}"
                ], [
                        splobj="[Not found]"
                ])
@@ -218,10 +223,13 @@ AC_DEFUN([LB_ZFS], [
        dnl # The existence of the zfs_config.h is used to identify a valid
        dnl # zfs object directory.  In many cases the object and source
        dnl # directory are the same, however the objects may also reside
-       dnl # is a subdirectory named after the kernel version.
+       dnl # is a subdirectory named after the kernel version.  When
+       dnl # weak modules are used, the kernel version may not be the
+       dnl # same as the LINUXRELEASE against which we are building lustre.
        dnl #
        AC_MSG_CHECKING([zfs build directory])
        AS_IF([test -z "$zfsobj"], [
+               last_zfs_obj_dir=$(ls -d ${zfssrc}/[[0-9]]*/ | tail -n 1 | sed 's|/$||')
                AS_IF([test "${zfssrc}" = "${zfsdkms}/source"], [
                        AS_IF([test -e "${zfsdkms}/${LINUXRELEASE}/${target_cpu}/zfs_config.h"], [
                                zfsobj=${zfsdkms}/${LINUXRELEASE}/${target_cpu}
@@ -232,6 +240,8 @@ AC_DEFUN([LB_ZFS], [
                        zfsobj="${zfssrc}/${LINUXRELEASE}"
                ], [test -e "${zfssrc}/zfs_config.h"], [
                        zfsobj="${zfssrc}"
+               ], [test -e "${last_zfs_obj_dir}/zfs_config.h"], [
+                       zfsobj="${last_zfs_obj_dir}"
                ], [
                        zfsobj="[Not found]"
                ])