Skip to content

Commit

Permalink
FHS conformance and DKMS multiarch, ZFS interface.
Browse files Browse the repository at this point in the history
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: openzfs/zfs#511
  • Loading branch information
dajhorn committed Jan 14, 2012
1 parent 2d69f29 commit b2260a0
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 15 deletions.
11 changes: 5 additions & 6 deletions debian/rules
Original file line number Diff line number Diff line change
Expand Up @@ -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/'
Expand Down
37 changes: 28 additions & 9 deletions debian/zfs-dkms.dkms
Original file line number Diff line number Diff line change
@@ -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"

0 comments on commit b2260a0

Please sign in to comment.