2013-02-18 00:10:17 +04:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
PROG=$0
|
|
|
|
|
|
|
|
pkgcfg=/etc/sysconfig/zfs
|
|
|
|
|
|
|
|
while getopts "n:v:c:f:" opt; do
|
|
|
|
case $opt in
|
2021-05-22 00:43:38 +03:00
|
|
|
n) pkgname=$OPTARG ;;
|
|
|
|
v) pkgver=$OPTARG ;;
|
|
|
|
c) pkgcfg=$OPTARG ;;
|
2013-02-18 00:10:17 +04:00
|
|
|
f) filename=$OPTARG ;;
|
2021-05-22 00:43:38 +03:00
|
|
|
*) err=1 ;;
|
2013-02-18 00:10:17 +04:00
|
|
|
esac
|
|
|
|
done
|
|
|
|
|
2021-05-22 00:43:38 +03:00
|
|
|
if [ -z "${pkgname}" ] || [ -z "${pkgver}" ] || [ -z "${filename}" ] ||
|
|
|
|
[ -n "${err}" ]; then
|
2013-02-18 00:10:17 +04:00
|
|
|
echo "Usage: $PROG -n <pkgname> -v <pkgver> -c <pkgcfg> -f <filename>"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
2021-05-22 00:43:38 +03:00
|
|
|
exec cat >"${filename}" <<EOF
|
2013-02-18 00:10:17 +04:00
|
|
|
PACKAGE_NAME="${pkgname}"
|
|
|
|
PACKAGE_VERSION="${pkgver}"
|
|
|
|
PACKAGE_CONFIG="${pkgcfg}"
|
2020-12-15 20:22:30 +03:00
|
|
|
NO_WEAK_MODULES="yes"
|
2013-02-18 00:10:17 +04:00
|
|
|
PRE_BUILD="configure
|
|
|
|
--prefix=/usr
|
|
|
|
--with-config=kernel
|
2018-05-26 20:56:24 +03:00
|
|
|
--with-linux=\$(
|
2022-02-24 21:33:48 +03:00
|
|
|
if [ -e "\${kernel_source_dir/%build/source}" ]
|
|
|
|
then
|
|
|
|
echo "\${kernel_source_dir/%build/source}"
|
|
|
|
else
|
|
|
|
echo "\${kernel_source_dir}"
|
|
|
|
fi
|
2018-05-26 20:56:24 +03:00
|
|
|
)
|
2022-02-24 21:33:48 +03:00
|
|
|
--with-linux-obj="\${kernel_source_dir}"
|
2017-12-07 11:43:13 +03:00
|
|
|
\$(
|
|
|
|
[[ -n \"\${ICP_ROOT}\" ]] && \\
|
|
|
|
{
|
|
|
|
echo --with-qat=\"\${ICP_ROOT}\"
|
|
|
|
}
|
|
|
|
)
|
2013-02-18 00:10:17 +04:00
|
|
|
\$(
|
|
|
|
[[ -r \${PACKAGE_CONFIG} ]] \\
|
|
|
|
&& source \${PACKAGE_CONFIG} \\
|
|
|
|
&& shopt -q -s extglob \\
|
|
|
|
&& \\
|
|
|
|
{
|
|
|
|
if [[ \${ZFS_DKMS_ENABLE_DEBUG,,} == @(y|yes) ]]
|
|
|
|
then
|
|
|
|
echo --enable-debug
|
|
|
|
fi
|
2019-01-18 21:10:24 +03:00
|
|
|
if [[ \${ZFS_DKMS_ENABLE_DEBUGINFO,,} == @(y|yes) ]]
|
|
|
|
then
|
|
|
|
echo --enable-debuginfo
|
|
|
|
fi
|
2013-02-18 00:10:17 +04:00
|
|
|
}
|
|
|
|
)
|
|
|
|
"
|
2014-10-09 21:22:59 +04:00
|
|
|
POST_BUILD="scripts/dkms.postbuild
|
2013-02-18 00:10:17 +04:00
|
|
|
-n \${PACKAGE_NAME}
|
|
|
|
-v \${PACKAGE_VERSION}
|
|
|
|
-a \${arch}
|
|
|
|
-k \${kernelver}
|
|
|
|
-t \${dkms_tree}
|
|
|
|
"
|
|
|
|
AUTOINSTALL="yes"
|
|
|
|
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]}"
|
2022-03-31 18:20:50 +03:00
|
|
|
BUILT_MODULE_NAME[0]="zfs"
|
|
|
|
BUILT_MODULE_LOCATION[0]="module/"
|
|
|
|
DEST_MODULE_LOCATION[0]="/extra"
|
|
|
|
BUILT_MODULE_NAME[1]="spl"
|
|
|
|
BUILT_MODULE_LOCATION[1]="module/"
|
|
|
|
DEST_MODULE_LOCATION[1]="/extra"
|
2013-02-18 00:10:17 +04:00
|
|
|
EOF
|