Linux 4.15 compat: timer updates
[zfs.git] / scripts / dkms.mkconf
blob67b9dad58b7fa0596c337741919d8a030d1fad64
1 #!/bin/sh
3 PROG=$0
5 pkgcfg=/etc/sysconfig/spl
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 esac
14 done
16 if [ -z "${pkgname}" -o -z "${pkgver}" -o -z "${filename}" ]; then
17 echo "Usage: $PROG -n <pkgname> -v <pkgver> -c <pkgcfg> -f <filename>"
18 exit 1
21 cat >${filename} <<EOF
22 PACKAGE_NAME="${pkgname}"
23 PACKAGE_VERSION="${pkgver}"
24 PACKAGE_CONFIG="${pkgcfg}"
25 PRE_BUILD="configure
26 --prefix=/usr
27 --with-config=kernel
28 --with-linux=\${kernel_source_dir}
29 --with-linux-obj=\${kernel_source_dir}
30 \$(
31 [[ -r \${PACKAGE_CONFIG} ]] \\
32 && source \${PACKAGE_CONFIG} \\
33 && shopt -q -s extglob \\
34 && \\
36 if [[ \${SPL_DKMS_ENABLE_DEBUG,,} == @(y|yes) ]]
37 then
38 echo --enable-debug
40 if [[ \${SPL_DKMS_ENABLE_DEBUG_KMEM,,} == @(y|yes) ]]
41 then
42 echo --enable-debug-kmem
44 if [[ \${SPL_DKMS_ENABLE_DEBUG_KMEM_TRACKING,,} == @(y|yes) ]]
45 then
46 echo --enable-debug-kmem-tracking
48 if [[ \${SPL_DKMS_ENABLE_ATOMIC_SPINLOCKS,,} == @(y|yes) ]]
49 then
50 echo --enable-atomic-spinlocks
55 POST_BUILD="scripts/dkms.postbuild
56 -n \${PACKAGE_NAME}
57 -v \${PACKAGE_VERSION}
58 -a \${arch}
59 -k \${kernelver}
60 -t \${dkms_tree}
62 AUTOINSTALL="yes"
63 REMAKE_INITRD="no"
64 MAKE[0]="make"
65 STRIP[0]="\$(
66 [[ -r \${PACKAGE_CONFIG} ]] \\
67 && source \${PACKAGE_CONFIG} \\
68 && shopt -q -s extglob \\
69 && [[ \${SPL_DKMS_DISABLE_STRIP,,} == @(y|yes) ]] \\
70 && echo -n no
72 STRIP[1]="\${STRIP[0]}"
73 BUILT_MODULE_NAME[0]="spl"
74 BUILT_MODULE_LOCATION[0]="module/spl/"
75 DEST_MODULE_LOCATION[0]="/extra/spl/spl"
76 BUILT_MODULE_NAME[1]="splat"
77 BUILT_MODULE_LOCATION[1]="module/splat/"
78 DEST_MODULE_LOCATION[1]="/extra/splat/splat"
79 EOF