mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2024-11-18 10:21:01 +03:00
64025fa3a1
Commit d2bce6d03
added the 'make checkbashisms' target but did not
resolve all of the bashisms in the scripts. This commit doesn't
resolve them all either but it does fix up a few, and it excludes
the others so 'make checkstyle' no longer prints warnings. It's
a small step in the right direction.
* Dracut is Linux specific and itself depends on bash. Therefore
all dracut support scripts can be bash specific, update their
shebang accordingly.
* zed-functions.sh, zfs-import, zfs-mount, zfs-zed, smart
paxcheck.sh, make_gitrev.sh - these scripts were excuded from
the check until they can be updated and properly tested.
* zfsunlock - only whole values for sleep are allowed.
* vdev_id - removed unneeded locals; use && instead of -a.
* dkms.mkconf, dkms.postbuil - use || instead of -o.
Reviewed-by: InsanePrawn <insane.prawny@gmail.com>
Reviewed-by: Gabriel A. Devenyi <gdevenyi@gmail.com>
Reviewed-by: Ryan Moeller <ryan@iXsystems.com>
Reviewed-by: George Melikov <mail@gmelikov.ru>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #10755
121 lines
2.9 KiB
Bash
Executable File
121 lines
2.9 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}" ] || [ -z "${pkgver}" ] || [ -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=\$(
|
|
case \`lsb_release -is\` in
|
|
(Debian|Devuan)
|
|
if [[ -e \${kernel_source_dir/%build/source} ]]
|
|
then
|
|
echo \${kernel_source_dir/%build/source}
|
|
else
|
|
# A kpkg exception for Proxmox 2.0
|
|
echo \${kernel_source_dir}
|
|
fi
|
|
;;
|
|
(*)
|
|
echo \${kernel_source_dir}
|
|
;;
|
|
esac
|
|
)
|
|
--with-linux-obj=\${kernel_source_dir}
|
|
\$(
|
|
[[ -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
|
|
if [[ \${ZFS_DKMS_ENABLE_DEBUGINFO,,} == @(y|yes) ]]
|
|
then
|
|
echo --enable-debuginfo
|
|
fi
|
|
}
|
|
)
|
|
"
|
|
POST_BUILD="scripts/dkms.postbuild
|
|
-n \${PACKAGE_NAME}
|
|
-v \${PACKAGE_VERSION}
|
|
-a \${arch}
|
|
-k \${kernelver}
|
|
-t \${dkms_tree}
|
|
"
|
|
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]}"
|
|
STRIP[7]="\${STRIP[0]}"
|
|
STRIP[8]="\${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"
|
|
BUILT_MODULE_NAME[7]="spl"
|
|
BUILT_MODULE_LOCATION[7]="module/spl/"
|
|
DEST_MODULE_LOCATION[7]="/extra/spl/spl"
|
|
BUILT_MODULE_NAME[8]="zzstd"
|
|
BUILT_MODULE_LOCATION[8]="module/zstd/"
|
|
DEST_MODULE_LOCATION[8]="/extra/zstd/zzstd"
|
|
EOF
|