diff options
author | Prakash Surya <[email protected]> | 2012-08-07 13:13:17 -0700 |
---|---|---|
committer | Brian Behlendorf <[email protected]> | 2012-08-08 15:21:01 -0700 |
commit | 26e08952e6ad113b91ae7d31263b6a4fd3a5a09f (patch) | |
tree | 07291ab4100e10df8d922a871a10e9f3e4f6743d /config | |
parent | 5085d55817f67e2333366e517c6cc7a6fdda50f7 (diff) |
Support building a zfs-modules-dkms sub package
This commit adds support for building a zfs-modules-dkms sub package
built around Dynamic Kernel Module Support. This is to allow building
packages using the DKMS infrastructure which is intended to ease the
burden of kernel version changes, upgrades, etc.
By default zfs-modules-dkms-* sub package will be built as part of
the 'make rpm' target. Alternately, you can build only the DKMS
module package using the 'make rpm-dkms' target.
Examples:
# To build packaged binaries as well as a dkms packages
$ ./configure && make rpm
# To build only the packaged binary utilities and dkms packages
$ ./configure && make rpm-utils rpm-dkms
Note: Only the RHEL 5/6, CHAOS 5, and Fedora distributions are
supported for building the dkms sub package.
Signed-off-by: Prakash Surya <[email protected]>
Signed-off-by: Brian Behlendorf <[email protected]>
Issue #535
Diffstat (limited to 'config')
-rw-r--r-- | config/kernel.m4 | 18 | ||||
-rw-r--r-- | config/rpm.am | 27 |
2 files changed, 42 insertions, 3 deletions
diff --git a/config/kernel.m4 b/config/kernel.m4 index 7d8a5f4d5..c08b6a22c 100644 --- a/config/kernel.m4 +++ b/config/kernel.m4 @@ -281,14 +281,28 @@ AC_DEFUN([ZFS_AC_SPL], [ AC_MSG_CHECKING([spl source directory]) AS_IF([test -z "$splsrc"], [ + dnl # + dnl # Look in the standard development package location + dnl # sourcelink=`ls -1d /usr/src/spl-*/${LINUX_VERSION} \ 2>/dev/null | tail -1` - AS_IF([test -z "$sourcelink" || test ! -e $sourcelink], [ + dnl # + dnl # Look in the DKMS source location + dnl # + AS_IF([test -z "$sourcelink" || test ! -e $sourcelink/spl_config.h], [ + sourcelink=`ls -1d /var/lib/dkms/spl/*/build \ + 2>/dev/null | tail -1` + ]) + + dnl # + dnl # Look in the parent directory + dnl # + AS_IF([test -z "$sourcelink" || test ! -e $sourcelink/spl_config.h], [ sourcelink=../spl ]) - AS_IF([test -e $sourcelink], [ + AS_IF([test -e $sourcelink/spl_config.h], [ splsrc=`readlink -f ${sourcelink}` ], [ AC_MSG_RESULT([Not found]) diff --git a/config/rpm.am b/config/rpm.am index c5929833b..9deafb3de 100644 --- a/config/rpm.am +++ b/config/rpm.am @@ -10,6 +10,11 @@ endif srpm: srpm-modules srpm-utils +rpm-dkms: srpm-modules +if CONFIG_KERNEL + $(MAKE) $(AM_MAKEFLAGS) pkg="${PACKAGE}-modules" dkms-common +endif + rpm-modules: srpm-modules if CONFIG_KERNEL $(MAKE) $(AM_MAKEFLAGS) pkg="${PACKAGE}-modules" rpm-common @@ -20,7 +25,7 @@ if CONFIG_USER $(MAKE) $(AM_MAKEFLAGS) pkg="${PACKAGE}" rpm-common endif -rpm: rpm-modules rpm-utils +rpm: rpm-modules rpm-utils rpm-dkms rpm-local: @(if test "${HAVE_RPMBUILD}" = "no"; then \ @@ -39,6 +44,26 @@ rpm-local: mkdir -p $(rpmbuild)/SOURCES && \ cp $(distdir).tar.gz $(rpmbuild)/SOURCES) +dkms-common: + rpmpkg=$(pkg)-$(ZFS_META_VERSION)-$(ZFS_META_RELEASE).src.rpm; \ + rpmspec=$(pkg).spec; \ + rpmdkms=$(pkg)-dkms-$(ZFS_META_VERSION)-$(ZFS_META_RELEASE).noarch.rpm;\ + rpmbuild=`mktemp -t -d $(PACKAGE)-build-$$USER-XXXXXXXX`; \ + $(MAKE) $(AM_MAKEFLAGS) \ + rpmbuild="$$rpmbuild" \ + rpmspec="$$rpmspec" \ + rpm-local || exit 1; \ + $(RPMBUILD) \ + --define "_tmppath $$rpmbuild/TMP" \ + --define "_topdir $$rpmbuild" \ + --define "dist %{nil}" \ + --define "_without_kernel 1" \ + --define "_without_kernel_debug 1" \ + --define "_with_kernel_dkms 1" \ + --nodeps --rebuild $$rpmpkg || exit 1; \ + cp $$rpmbuild/RPMS/noarch/$$rpmdkms . || exit 1; \ + $(RM) -R $$rpmbuild + srpm-common: dist rpmpkg=$(pkg)-$(ZFS_META_VERSION)-$(ZFS_META_RELEASE).src.rpm; \ rpmspec=$(pkg).spec; \ |