]> git.proxmox.com Git - mirror_zfs-debian.git/commitdiff
FHS conformance and DKMS multiarch, ZFS interface.
authorDarik Horn <dajhorn@vanadac.com>
Sat, 14 Jan 2012 06:15:03 +0000 (00:15 -0600)
committerDarik Horn <dajhorn@vanadac.com>
Sat, 14 Jan 2012 06:48:07 +0000 (00:48 -0600)
Improve FHS conformance by installing intermediary build products --
currently the zfs_config.h and Module.symvers files -- into the
/var/lib/dkms area instead of /usr/src.

This has the beneficial side-effect of enabling DKMS multiarch
support for ZFS because the autoconf templates and `make install`
rules are not aware of the target architecture.

Mitigates: zfsonlinux/zfs#511

debian/rules
debian/zfs-dkms.dkms

index 5b690ac1df564e2e153a1780f025b1495e52aa39..db3e76c6fc92b820b948058e5011d3ca337a3a9e 100755 (executable)
@@ -46,12 +46,11 @@ override_dh_auto_install:
          '$(CURDIR)/$(NAME)-$(VERSION)/scripts/zpool-config/Makefile.in' \
          '$(CURDIR)/$(NAME)-$(VERSION)/scripts/zpool-layout/Makefile.in'
 
-       # This shunt allows DKMS to delete header files that are peculiar
-       # to each module instance through the POST_REMOVE directive in the
-       # dkms.conf file.
-       echo '#!/bin/sh'  >'$(CURDIR)/$(NAME)-$(VERSION)/rm'
-       echo 'rm "$$@"'  >>'$(CURDIR)/$(NAME)-$(VERSION)/rm'
-       chmod 755 '$(CURDIR)/$(NAME)-$(VERSION)/rm'
+       # This shunt allows DKMS to install the Module.symvers and zfs_config.h
+       # files to the ${dkms_tree} area through the POST_INSTALL directive.
+       echo '#!/bin/sh'  >'$(CURDIR)/$(NAME)-$(VERSION)/cp'
+       echo 'cp "$$@"'  >>'$(CURDIR)/$(NAME)-$(VERSION)/cp'
+       chmod 755 '$(CURDIR)/$(NAME)-$(VERSION)/cp'
 
        # Install the DKMS source.
        mkdir -p '$(CURDIR)/debian/tmp/usr/src/'
index 610f9549b84a26605ca9ecda694d184eae4b856f..3158d3a84087c6c836d0d7734a5617b700a88868 100644 (file)
@@ -1,30 +1,49 @@
 AUTOINSTALL="yes"
 PACKAGE_NAME="zfs"
 PACKAGE_VERSION="#MODULE_VERSION#"
-PRE_BUILD="configure --prefix=/usr --with-config=kernel --with-linux=$(case `lsb_release -is` in Debian) echo ${kernel_source_dir/%build/source};; *) echo ${kernel_source_dir};; esac) --with-linux-obj=${kernel_source_dir}"
-POST_REMOVE="rm -r /usr/src/zfs-#MODULE_VERSION#/${kernelver}"
-REMAKE_INITRD="$(if test -e /usr/share/initramfs-tools/hooks/zfs -o -e /usr/share/dracut/modules.d/90zfs; then echo yes; else echo no; fi)"
-MAKE[0]="make && make install-data-local && make -C include install"
+PRE_BUILD="configure
+  --prefix=/usr
+  --with-config=kernel
+  --with-linux=$(
+      case `lsb_release -is` in
+        (Debian) echo ${kernel_source_dir/%build/source} ;;
+        (*)      echo ${kernel_source_dir} ;;
+      esac
+  )
+  --with-linux-obj=${kernel_source_dir}
+  --with-spl=${source_tree}/spl-${PACKAGE_VERSION}
+  --with-spl-obj=${dkms_tree}/spl/${PACKAGE_VERSION}/${kernelver}/${arch}
+"
+POST_INSTALL="cp
+  ${dkms_tree}/${PACKAGE_NAME}/${PACKAGE_VERSION}/build/zfs_config.h
+  ${dkms_tree}/${PACKAGE_NAME}/${PACKAGE_VERSION}/build/module/Module.symvers
+  ${dkms_tree}/${PACKAGE_NAME}/${PACKAGE_VERSION}/${kernelver}/${arch}/
+"
+REMAKE_INITRD="$(
+    if test -e /usr/share/initramfs-tools/hooks/zfs \
+            -o -e /usr/share/dracut/modules.d/90zfs
+    then
+      echo yes
+    else
+      echo no
+    fi
+)"
+MAKE[0]="make"
 BUILT_MODULE_NAME[0]="zavl"
 BUILT_MODULE_LOCATION[0]="module/avl/"
 DEST_MODULE_LOCATION[0]="/extra/zfs/zavl"
-MAKE[1]="true"
 BUILT_MODULE_NAME[1]="zcommon"
 BUILT_MODULE_LOCATION[1]="module/zcommon/"
 DEST_MODULE_LOCATION[1]="/extra/zfs/zcommon"
-MAKE[2]="true"
 BUILT_MODULE_NAME[2]="znvpair"
 BUILT_MODULE_LOCATION[2]="module/nvpair/"
 DEST_MODULE_LOCATION[2]="/extra/zfs/znvpair"
-MAKE[3]="true"
 BUILT_MODULE_NAME[3]="zpios"
 BUILT_MODULE_LOCATION[3]="module/zpios/"
 DEST_MODULE_LOCATION[3]="/extra/zfs/zpios"
-MAKE[4]="true"
 BUILT_MODULE_NAME[4]="zunicode"
 BUILT_MODULE_LOCATION[4]="module/unicode/"
 DEST_MODULE_LOCATION[4]="/extra/zfs/zunicode"
-MAKE[5]="true"
 BUILT_MODULE_NAME[5]="zfs"
 BUILT_MODULE_LOCATION[5]="module/zfs/"
 DEST_MODULE_LOCATION[5]="/extra/zfs/zfs"