FreeBSD: Reduce copy_file_range() source lock to shared
[zfs.git] / scripts / dkms.mkconf
blob046ce9edcefe86cbfb08faf05f18eaa24facb58f
1 #!/bin/sh
3 PROG=$0
5 pkgcfg=/etc/sysconfig/zfs
7 while getopts "n:v:c:f:" opt; do
8 case $opt in
9 n) pkgname=$OPTARG ;;
10 v) pkgver=$OPTARG ;;
11 c) pkgcfg=$OPTARG ;;
12 f) filename=$OPTARG ;;
13 *) err=1 ;;
14 esac
15 done
17 if [ -z "${pkgname}" ] || [ -z "${pkgver}" ] || [ -z "${filename}" ] ||
18 [ -n "${err}" ]; then
19 echo "Usage: $PROG -n <pkgname> -v <pkgver> -c <pkgcfg> -f <filename>"
20 exit 1
23 exec cat >"${filename}" <<EOF
24 PACKAGE_NAME="${pkgname}"
25 PACKAGE_VERSION="${pkgver}"
26 PACKAGE_CONFIG="${pkgcfg}"
27 NO_WEAK_MODULES="yes"
28 PRE_BUILD="configure
29 --disable-dependency-tracking
30 --prefix=/usr
31 --with-config=kernel
32 --with-linux=\$(
33 if [ -e "\${kernel_source_dir/%build/source}" ]
34 then
35 echo "\${kernel_source_dir/%build/source}"
36 else
37 echo "\${kernel_source_dir}"
40 --with-linux-obj="\${kernel_source_dir}"
41 \$(
42 [[ -n \"\${ICP_ROOT}\" ]] && \\
44 echo --with-qat=\"\${ICP_ROOT}\"
47 \$(
48 [[ -r \${PACKAGE_CONFIG} ]] \\
49 && source \${PACKAGE_CONFIG} \\
50 && shopt -q -s extglob \\
51 && \\
53 if [[ \${ZFS_DKMS_ENABLE_DEBUG,,} == @(y|yes) ]]
54 then
55 echo --enable-debug
57 if [[ \${ZFS_DKMS_ENABLE_DEBUGINFO,,} == @(y|yes) ]]
58 then
59 echo --enable-debuginfo
64 POST_BUILD="scripts/dkms.postbuild
65 -n \${PACKAGE_NAME}
66 -v \${PACKAGE_VERSION}
67 -a \${arch}
68 -k \${kernelver}
69 -t \${dkms_tree}
71 AUTOINSTALL="yes"
72 MAKE[0]="make"
73 STRIP[0]="\$(
74 [[ -r \${PACKAGE_CONFIG} ]] \\
75 && source \${PACKAGE_CONFIG} \\
76 && shopt -q -s extglob \\
77 && [[ \${ZFS_DKMS_DISABLE_STRIP,,} == @(y|yes) ]] \\
78 && echo -n no
80 STRIP[1]="\${STRIP[0]}"
81 BUILT_MODULE_NAME[0]="zfs"
82 BUILT_MODULE_LOCATION[0]="module/"
83 DEST_MODULE_LOCATION[0]="/extra"
84 BUILT_MODULE_NAME[1]="spl"
85 BUILT_MODULE_LOCATION[1]="module/"
86 DEST_MODULE_LOCATION[1]="/extra"
87 EOF