summaryrefslogtreecommitdiff
path: root/scripts/build-intel-drivers
diff options
context:
space:
mode:
authorChristian Poessinger <christian@poessinger.com>2019-04-09 20:15:57 +0200
committerChristian Poessinger <christian@poessinger.com>2019-04-23 08:43:23 +0200
commit63493afa4c9cb05cdf7318b841edf52ad0779014 (patch)
tree380d4e5ce9d77a37dc3e6ed4a94a2ea79a5f8a36 /scripts/build-intel-drivers
parenta0b3251dba33a9a2e59aecd742746fc22f96fd8d (diff)
downloadvyos-build-63493afa4c9cb05cdf7318b841edf52ad0779014.tar.gz
vyos-build-63493afa4c9cb05cdf7318b841edf52ad0779014.zip
Replace build-submodules with Python based package builder
Support building individual VyOS packages by this modules. Call scripts/build-packages -l to list all available packages which will be build when invoking scripts/build-packages.
Diffstat (limited to 'scripts/build-intel-drivers')
-rwxr-xr-xscripts/build-intel-drivers79
1 files changed, 79 insertions, 0 deletions
diff --git a/scripts/build-intel-drivers b/scripts/build-intel-drivers
new file mode 100755
index 00000000..07c71f88
--- /dev/null
+++ b/scripts/build-intel-drivers
@@ -0,0 +1,79 @@
+#!/bin/bash -x
+
+basedir=$(pwd)
+if [ -z "$KSRC" ]; then
+ echo "Kernel source KSRC= not specified"
+ exit 1
+fi
+
+VERSION=$(grep "^VERSION" $KSRC/Makefile | grep -Eo '[0-9]{1,4}')
+PATCHLEVEL=$(grep "^PATCHLEVEL" $KSRC/Makefile | grep -Eo '[0-9]{1,4}')
+SUBLEVEL=$(grep "^SUBLEVEL" $KSRC/Makefile | grep -Eo '[0-9]{1,4}')
+KERNEL_VER="$VERSION.$PATCHLEVEL.$SUBLEVEL-amd64-vyos"
+
+pkgdir="$basedir/packages"
+if [ ! -d "$basedir/packages" ]; then
+ mkdir $basedir/packages
+fi
+
+URLS=" \
+ https://downloadmirror.intel.com/14687/eng/ixgbe-5.5.5.tar.gz \
+ https://downloadmirror.intel.com/13663/eng/igb-5.3.5.22.tar.gz \
+ https://downloadmirror.intel.com/15817/eng/e1000e-3.4.2.1.tar.gz \
+ https://downloadmirror.intel.com/24411/eng/i40e-2.7.29.tar.gz \
+ https://downloadmirror.intel.com/18700/eng/ixgbevf-4.5.2.tar.gz \
+ https://downloadmirror.intel.com/24693/eng/i40evf-3.6.15.tar.gz \
+"
+
+# The intel IGBVF driver can't be compiled with recent Kernel versions
+# due to interlanl API changes. Driver is from 10.09.2015
+# Source code is here: https://downloadmirror.intel.com/18298/eng/igbvf-2.3.9.6.tar.gz
+for URL in $URLS
+do
+ cd $pkgdir
+ filename=${URL##*/}
+ dirname_full=$(echo $filename | awk -F".tar.gz" '{print $1}')
+ dirname=$(echo $dirname_full | awk -F- '{print $1}')
+ version="$(echo $dirname_full | awk -F- '{print $2}')-0"
+ deb_pkg=${dirname}_${version}_amd64
+ deb_pkg_dir=$pkgdir/vyos-intel-${deb_pkg}
+
+ if [ -d "$dirname_full" ]; then
+ rm -rf $dirname_full
+ fi
+ if [ -d "$deb_pkg_dir" ]; then
+ rm -rf $deb_pkg_dir
+ fi
+ if [ ! -f "$filename" ]; then
+ wget ${URL}
+ ret=$?
+ if [ "$ret" != "0" ]; then
+ echo "Download of ${URL} failed!"
+ exit $ret
+ fi
+ fi
+
+ tar xf $filename
+ cd $dirname_full/src
+
+ KSRC=$KSRC INSTALL_MOD_PATH=$deb_pkg_dir \
+ make -j $(cat /proc/cpuinfo | grep processor | wc -l) install
+
+ mkdir -p $deb_pkg_dir/DEBIAN
+ echo "Package: vyos-intel-$dirname" >$deb_pkg_dir/DEBIAN/control
+ echo "Version: $version" >>$deb_pkg_dir/DEBIAN/control
+ echo "Section: kernel" >>$deb_pkg_dir/DEBIAN/control
+ echo "Priority: extra" >>$deb_pkg_dir/DEBIAN/control
+ echo "Architecture: amd64" >>$deb_pkg_dir/DEBIAN/control
+ echo "Maintainer: VyOS Package Maintainers <maintainers@vyos.net>" >>$deb_pkg_dir/DEBIAN/control
+ echo "Installed-Size: 9" >>$deb_pkg_dir/DEBIAN/control
+ echo "Depends: linux-image" >>$deb_pkg_dir/DEBIAN/control
+ echo "Description: Intel Vendor driver for $dirname" >>$deb_pkg_dir/DEBIAN/control
+ echo " Replacement for the in Kernel drivers" >>$deb_pkg_dir/DEBIAN/control
+
+ # Cleanup files which might also be present in linux-image-4.19.20-amd64-vyos
+ rm -rf $deb_pkg_dir/usr $deb_pkg_dir/lib/modules/$KERNEL_VER/modules.*
+
+ cd $pkgdir
+ dpkg-deb --build $(basename $deb_pkg_dir)
+done