summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Breunig <christian@breunig.cc>2023-02-20 20:02:53 +0100
committerChristian Breunig <christian@breunig.cc>2023-02-20 20:02:53 +0100
commitdf13175a2e37d12fad7ed8a60d92faac1428ddf2 (patch)
treecbd68b127a97f370c84379955e3bb639f18d0eeb
parent632dce27c2825a5535d5e153634a373892efe8de (diff)
downloadvyos-build-df13175a2e37d12fad7ed8a60d92faac1428ddf2.tar.gz
vyos-build-df13175a2e37d12fad7ed8a60d92faac1428ddf2.zip
Kernel: QAT: T5003 remove non POSIX compliant array in shell script
-rw-r--r--packages/linux-kernel/.gitignore1
-rwxr-xr-xpackages/linux-kernel/build-intel-qat.sh193
2 files changed, 95 insertions, 99 deletions
diff --git a/packages/linux-kernel/.gitignore b/packages/linux-kernel/.gitignore
index 6373bd11..b3c05f66 100644
--- a/packages/linux-kernel/.gitignore
+++ b/packages/linux-kernel/.gitignore
@@ -5,6 +5,7 @@
/intel-qat
/linux-firmware
/qat*
+/QAT*
*.tar.xz
/*.postinst
diff --git a/packages/linux-kernel/build-intel-qat.sh b/packages/linux-kernel/build-intel-qat.sh
index a6627c50..e1c61c92 100755
--- a/packages/linux-kernel/build-intel-qat.sh
+++ b/packages/linux-kernel/build-intel-qat.sh
@@ -14,102 +14,97 @@ fi
. ${KERNEL_VAR_FILE}
-declare -a intel=(
- "https://dev.packages.vyos.net/source-mirror/QAT1.7.L.4.20.0-00001.tar.gz"
-)
-
-for url in "${intel[@]}"
-do
- cd ${CWD}
-
- DRIVER_FILE=$(basename ${url} | sed -e s/tar_0/tar/)
- DRIVER_DIR="${DRIVER_FILE%.tar.gz}"
- DRIVER_NAME="QAT"
- DRIVER_VERSION=$(echo ${DRIVER_DIR} | awk -F${DRIVER_NAME} '{print $2}')
- DRIVER_VERSION_EXTRA="-0"
-
- # Build up Debian related variables required for packaging
- DEBIAN_ARCH=$(dpkg --print-architecture)
- DEBIAN_DIR="${CWD}/vyos-intel-${DRIVER_NAME}_${DRIVER_VERSION}${DRIVER_VERSION_EXTRA}_${DEBIAN_ARCH}"
- DEBIAN_CONTROL="${DEBIAN_DIR}/DEBIAN/control"
- DEBIAN_POSTINST="${CWD}/vyos-intel-qat.postinst"
-
- # Fetch Intel driver source from SourceForge
- if [ -e ${DRIVER_FILE} ]; then
- rm -f ${DRIVER_FILE}
- fi
- curl -L -o ${DRIVER_FILE} ${url}
- if [ "$?" -ne "0" ]; then
- exit 1
- fi
-
- # Unpack archive
- if [ -d ${DRIVER_DIR} ]; then
- rm -rf ${DRIVER_DIR}
- fi
- mkdir -p ${DRIVER_DIR}
- tar -C ${DRIVER_DIR} -xf ${DRIVER_FILE}
-
- cd ${DRIVER_DIR}
- if [ -z $KERNEL_DIR ]; then
- echo "KERNEL_DIR not defined"
- exit 1
- fi
-
- echo "I: Compile Kernel module for Intel ${DRIVER_NAME} driver"
- mkdir -p \
- ${DEBIAN_DIR}/lib/firmware \
- ${DEBIAN_DIR}/usr/sbin \
- ${DEBIAN_DIR}/usr/lib/x86_64-linux-gnu \
- ${DEBIAN_DIR}/etc/init.d
- KERNEL_SOURCE_ROOT=${KERNEL_DIR} ./configure --enable-kapi --enable-qat-lkcf
- make -j $(getconf _NPROCESSORS_ONLN) all
- make INSTALL_MOD_PATH=${DEBIAN_DIR} INSTALL_FW_PATH=${DEBIAN_DIR} \
- qat-driver-install adf-ctl-all
-
- if [ "x$?" != "x0" ]; then
- exit 1
- fi
-
- cp quickassist/qat/fw/*.bin ${DEBIAN_DIR}/lib/firmware
- cp build/*.so ${DEBIAN_DIR}/usr/lib/x86_64-linux-gnu
- cp build/adf_ctl ${DEBIAN_DIR}/usr/sbin
- cp quickassist/build_system/build_files/qat_service ${DEBIAN_DIR}/etc/init.d
- cp build/usdm_drv.ko ${DEBIAN_DIR}/lib/modules/${KERNEL_VERSION}${KERNEL_SUFFIX}/updates/drivers
- chmod 644 ${DEBIAN_DIR}/lib/firmware/*
- chmod 755 ${DEBIAN_DIR}/etc/init.d/* ${DEBIAN_DIR}/usr/local/bin/*
-
- if [ -f ${DEBIAN_DIR}.deb ]; then
- rm ${DEBIAN_DIR}.deb
- fi
-
- # build Debian package
- echo "I: Building Debian package vyos-intel-${DRIVER_NAME}"
- cd ${CWD}
-
- # delete non required files which are also present in the kernel package
- # und thus lead to duplicated files
- find ${DEBIAN_DIR} -name "modules.*" | xargs rm -f
-
- echo "#!/bin/sh" > ${DEBIAN_POSTINST}
- echo "/sbin/depmod -a ${KERNEL_VERSION}${KERNEL_SUFFIX}" >> ${DEBIAN_POSTINST}
-
- fpm --input-type dir --output-type deb --name vyos-intel-${DRIVER_NAME} \
- --version ${DRIVER_VERSION}${DRIVER_VERSION_EXTRA} --deb-compression gz \
- --maintainer "VyOS Package Maintainers <maintainers@vyos.net>" \
- --description "Vendor based driver for Intel ${DRIVER_NAME}" \
- --depends linux-image-${KERNEL_VERSION}${KERNEL_SUFFIX} \
- --license "GPL2" -C ${DEBIAN_DIR} --after-install ${DEBIAN_POSTINST}
-
- echo "I: Cleanup ${DRIVER_NAME} source"
- cd ${CWD}
- if [ -e ${DRIVER_FILE} ]; then
- rm -f ${DRIVER_FILE}
- fi
- if [ -d ${DRIVER_DIR} ]; then
- rm -rf ${DRIVER_DIR}
- fi
- if [ -d ${DEBIAN_DIR} ]; then
- rm -rf ${DEBIAN_DIR}
- fi
-done
+url="https://dev.packages.vyos.net/source-mirror/QAT1.7.L.4.20.0-00001.tar.gz"
+
+cd ${CWD}
+
+DRIVER_FILE=$(basename ${url} | sed -e s/tar_0/tar/)
+DRIVER_DIR="${DRIVER_FILE%.tar.gz}"
+DRIVER_NAME="QAT"
+DRIVER_VERSION=$(echo ${DRIVER_DIR} | awk -F${DRIVER_NAME} '{print $2}')
+DRIVER_VERSION_EXTRA="-0"
+
+# Build up Debian related variables required for packaging
+DEBIAN_ARCH=$(dpkg --print-architecture)
+DEBIAN_DIR="${CWD}/vyos-intel-${DRIVER_NAME}_${DRIVER_VERSION}${DRIVER_VERSION_EXTRA}_${DEBIAN_ARCH}"
+DEBIAN_CONTROL="${DEBIAN_DIR}/DEBIAN/control"
+DEBIAN_POSTINST="${CWD}/vyos-intel-qat.postinst"
+
+# Fetch Intel driver source from SourceForge
+if [ -e ${DRIVER_FILE} ]; then
+ rm -f ${DRIVER_FILE}
+fi
+curl -L -o ${DRIVER_FILE} ${url}
+if [ "$?" -ne "0" ]; then
+ exit 1
+fi
+
+# Unpack archive
+if [ -d ${DRIVER_DIR} ]; then
+ rm -rf ${DRIVER_DIR}
+fi
+mkdir -p ${DRIVER_DIR}
+tar -C ${DRIVER_DIR} -xf ${DRIVER_FILE}
+
+cd ${DRIVER_DIR}
+if [ -z $KERNEL_DIR ]; then
+ echo "KERNEL_DIR not defined"
+ exit 1
+fi
+
+echo "I: Compile Kernel module for Intel ${DRIVER_NAME} driver"
+mkdir -p \
+ ${DEBIAN_DIR}/lib/firmware \
+ ${DEBIAN_DIR}/usr/sbin \
+ ${DEBIAN_DIR}/usr/lib/x86_64-linux-gnu \
+ ${DEBIAN_DIR}/etc/init.d
+KERNEL_SOURCE_ROOT=${KERNEL_DIR} ./configure --enable-kapi --enable-qat-lkcf
+make -j $(getconf _NPROCESSORS_ONLN) all
+make INSTALL_MOD_PATH=${DEBIAN_DIR} INSTALL_FW_PATH=${DEBIAN_DIR} \
+ qat-driver-install adf-ctl-all
+
+if [ "x$?" != "x0" ]; then
+ exit 1
+fi
+
+cp quickassist/qat/fw/*.bin ${DEBIAN_DIR}/lib/firmware
+cp build/*.so ${DEBIAN_DIR}/usr/lib/x86_64-linux-gnu
+cp build/adf_ctl ${DEBIAN_DIR}/usr/sbin
+cp quickassist/build_system/build_files/qat_service ${DEBIAN_DIR}/etc/init.d
+cp build/usdm_drv.ko ${DEBIAN_DIR}/lib/modules/${KERNEL_VERSION}${KERNEL_SUFFIX}/updates/drivers
+chmod 644 ${DEBIAN_DIR}/lib/firmware/*
+chmod 755 ${DEBIAN_DIR}/etc/init.d/* ${DEBIAN_DIR}/usr/local/bin/*
+
+if [ -f ${DEBIAN_DIR}.deb ]; then
+ rm ${DEBIAN_DIR}.deb
+fi
+
+# build Debian package
+echo "I: Building Debian package vyos-intel-${DRIVER_NAME}"
+cd ${CWD}
+
+# delete non required files which are also present in the kernel package
+# und thus lead to duplicated files
+find ${DEBIAN_DIR} -name "modules.*" | xargs rm -f
+
+echo "#!/bin/sh" > ${DEBIAN_POSTINST}
+echo "/sbin/depmod -a ${KERNEL_VERSION}${KERNEL_SUFFIX}" >> ${DEBIAN_POSTINST}
+
+fpm --input-type dir --output-type deb --name vyos-intel-${DRIVER_NAME} \
+ --version ${DRIVER_VERSION}${DRIVER_VERSION_EXTRA} --deb-compression gz \
+ --maintainer "VyOS Package Maintainers <maintainers@vyos.net>" \
+ --description "Vendor based driver for Intel ${DRIVER_NAME}" \
+ --depends linux-image-${KERNEL_VERSION}${KERNEL_SUFFIX} \
+ --license "GPL2" -C ${DEBIAN_DIR} --after-install ${DEBIAN_POSTINST}
+
+echo "I: Cleanup ${DRIVER_NAME} source"
+cd ${CWD}
+if [ -e ${DRIVER_FILE} ]; then
+ rm -f ${DRIVER_FILE}
+fi
+if [ -d ${DRIVER_DIR} ]; then
+ rm -rf ${DRIVER_DIR}
+fi
+if [ -d ${DEBIAN_DIR} ]; then
+ rm -rf ${DEBIAN_DIR}
+fi \ No newline at end of file