From: Darik Horn Date: Sat, 14 Jan 2012 06:15:03 +0000 (-0600) Subject: FHS conformance and DKMS multiarch, ZFS interface. X-Git-Tag: debian/0.7.9-2~520^2 X-Git-Url: https://git.proxmox.com/?p=mirror_zfs-debian.git;a=commitdiff_plain;h=b2260a0c873846e8550d1552d23e472ee0c41622 FHS conformance and DKMS multiarch, ZFS interface. 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 --- diff --git a/debian/rules b/debian/rules index 5b690ac1..db3e76c6 100755 --- a/debian/rules +++ b/debian/rules @@ -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/' diff --git a/debian/zfs-dkms.dkms b/debian/zfs-dkms.dkms index 610f9549..3158d3a8 100644 --- a/debian/zfs-dkms.dkms +++ b/debian/zfs-dkms.dkms @@ -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"