#!/bin/bash # The only parameter is the name of the folder where the source code # is extracted to. Be aware that the extracted package should # be put at the same path where this script is located. # Tools needed: unzip/rpm2cpio/cpio OPAE_PKG=OPAE_1.3.7-5_el7.zip OPAE_DRV=opae-intel-fpga-driver-2.0.1 unzip ./${OPAE_PKG} if [ $? -ne 0 ] then echo "unzip failed: OPAE source!" exit 1 fi cd OPAE/source_code rpm2cpio ${OPAE_DRV}-*.src.rpm | cpio -i if [ $? -ne 0 ] then echo "rpm2cpio/cpio failed: OPAE source!" exit 1 fi tar zxvf ${OPAE_DRV}.tar.gz if [ $? -ne 0 ] then echo "tar failed: OPAE source!" exit 1 fi mv ${OPAE_DRV} ../../$1 cd ../../ rm OPAE ${OPAE_PKG} -rf