freebsd-dev/scripts/dkms.mkconf
Chris Williamson d99a015343 OpenZFS 7431 - ZFS Channel Programs
Authored by: Chris Williamson <chris.williamson@delphix.com>
Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Reviewed by: George Wilson <george.wilson@delphix.com>
Reviewed by: John Kennedy <john.kennedy@delphix.com>
Reviewed by: Dan Kimmel <dan.kimmel@delphix.com>
Approved by: Garrett D'Amore <garrett@damore.org>
Ported-by: Don Brady <don.brady@delphix.com>
Ported-by: John Kennedy <john.kennedy@delphix.com>

OpenZFS-issue: https://www.illumos.org/issues/7431
OpenZFS-commit: https://github.com/openzfs/openzfs/commit/dfc11533

Porting Notes:
* The CLI long option arguments for '-t' and '-m' don't parse on linux
* Switched from kmem_alloc to vmem_alloc in zcp_lua_alloc
* Lua implementation is built as its own module (zlua.ko)
* Lua headers consumed directly by zfs code moved to 'include/sys/lua/'
* There is no native setjmp/longjump available in stock Linux kernel.
  Brought over implementations from illumos and FreeBSD
* The get_temporary_prop() was adapted due to VFS platform differences
* Use of inline functions in lua parser to reduce stack usage per C call
* Skip some ZFS Test Suite ZCP tests on sparc64 to avoid stack overflow
2018-02-08 15:28:18 -08:00

98 lines
2.4 KiB
Bash
Executable File

#!/bin/sh
PROG=$0
pkgcfg=/etc/sysconfig/zfs
while getopts "n:v:c:f:" opt; do
case $opt in
n) pkgname=$OPTARG ;;
v) pkgver=$OPTARG ;;
c) pkgcfg=$OPTARG ;;
f) filename=$OPTARG ;;
esac
done
if [ -z "${pkgname}" -o -z "${pkgver}" -o -z "${filename}" ]; then
echo "Usage: $PROG -n <pkgname> -v <pkgver> -c <pkgcfg> -f <filename>"
exit 1
fi
cat >${filename} <<EOF
PACKAGE_NAME="${pkgname}"
PACKAGE_VERSION="${pkgver}"
PACKAGE_CONFIG="${pkgcfg}"
PRE_BUILD="configure
--prefix=/usr
--with-config=kernel
--with-linux=\${kernel_source_dir}
--with-linux-obj=\${kernel_source_dir}
--with-spl=\${source_tree}/spl-\${PACKAGE_VERSION}
--with-spl-obj=\${dkms_tree}/spl/\${PACKAGE_VERSION}/\${kernelver}/\${arch}
--with-spl-timeout=300
\$(
[[ -n \"\${ICP_ROOT}\" ]] && \\
{
echo --with-qat=\"\${ICP_ROOT}\"
}
)
\$(
[[ -r \${PACKAGE_CONFIG} ]] \\
&& source \${PACKAGE_CONFIG} \\
&& shopt -q -s extglob \\
&& \\
{
if [[ \${ZFS_DKMS_ENABLE_DEBUG,,} == @(y|yes) ]]
then
echo --enable-debug
fi
}
)
"
POST_BUILD="scripts/dkms.postbuild
-n \${PACKAGE_NAME}
-v \${PACKAGE_VERSION}
-a \${arch}
-k \${kernelver}
-t \${dkms_tree}
"
BUILD_DEPENDS[0]="spl"
AUTOINSTALL="yes"
REMAKE_INITRD="no"
MAKE[0]="make"
STRIP[0]="\$(
[[ -r \${PACKAGE_CONFIG} ]] \\
&& source \${PACKAGE_CONFIG} \\
&& shopt -q -s extglob \\
&& [[ \${ZFS_DKMS_DISABLE_STRIP,,} == @(y|yes) ]] \\
&& echo -n no
)"
STRIP[1]="\${STRIP[0]}"
STRIP[2]="\${STRIP[0]}"
STRIP[3]="\${STRIP[0]}"
STRIP[4]="\${STRIP[0]}"
STRIP[5]="\${STRIP[0]}"
STRIP[6]="\${STRIP[0]}"
BUILT_MODULE_NAME[0]="zavl"
BUILT_MODULE_LOCATION[0]="module/avl/"
DEST_MODULE_LOCATION[0]="/extra/avl/avl"
BUILT_MODULE_NAME[1]="znvpair"
BUILT_MODULE_LOCATION[1]="module/nvpair/"
DEST_MODULE_LOCATION[1]="/extra/nvpair/znvpair"
BUILT_MODULE_NAME[2]="zunicode"
BUILT_MODULE_LOCATION[2]="module/unicode/"
DEST_MODULE_LOCATION[2]="/extra/unicode/zunicode"
BUILT_MODULE_NAME[3]="zcommon"
BUILT_MODULE_LOCATION[3]="module/zcommon/"
DEST_MODULE_LOCATION[3]="/extra/zcommon/zcommon"
BUILT_MODULE_NAME[4]="zfs"
BUILT_MODULE_LOCATION[4]="module/zfs/"
DEST_MODULE_LOCATION[4]="/extra/zfs/zfs"
BUILT_MODULE_NAME[5]="icp"
BUILT_MODULE_LOCATION[5]="module/icp/"
DEST_MODULE_LOCATION[5]="/extra/icp/icp"
BUILT_MODULE_NAME[6]="zlua"
BUILT_MODULE_LOCATION[6]="module/lua/"
DEST_MODULE_LOCATION[6]="/extra/lua/zlua"
EOF