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 <surya1@llnl.gov>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Issue #535
This commit is contained in:
Prakash Surya
2012-08-07 13:13:17 -07:00
committed by Brian Behlendorf
parent 5085d55817
commit 26e08952e6
9 changed files with 266 additions and 14 deletions
+16 -2
View File
@@ -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])
+26 -1
View File
@@ -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; \