Skip to content

Instantly share code, notes, and snippets.

@burdara
Created November 2, 2016 17:07
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save burdara/b32a1ebb06a52ec7c1baf642f02613f1 to your computer and use it in GitHub Desktop.
Save burdara/b32a1ebb06a52ec7c1baf642f02613f1 to your computer and use it in GitHub Desktop.
AWS enhanced networking - Ubuntu ixgbevf driver upgrade.
#/usr/bin/env bash
set -x
name="ixgbevf"
version="2.16.4"
file_name="$name-$version"
archive_name="$file_name.tar.gz"
tmp_path="/tmp"
src_path="/usr/src"
wget_src="sourceforge.net/projects/e1000/files/$name stable/$version/$archive_name"
apt-get update && apt-get upgrade -y && apt-get install -y dkms
if ! test -e "$tmp_path/$archive_name"; then
wget -O "$tmp_path/$archive_name" "$wget_src"
! test -e "$tmp_path/$archive_name" \
&& echo "$tmp_path/$archive_name was not found." && exit 1
tar -xzf "$tmp_path/$archive_name" -C "$tmp_path"
fi
! test -d "$src_path/$file_name" && mv "$tmp_path/$file_name" "$src_path/"
! test -d "$src_path/$file_name" \
&& echo "$src_path/$file_name was not found." && exit 1
cat <<EOF > ${src_path}/${file_name}/dkms.conf
PACKAGE_NAME="$name"
PACKAGE_VERSION="$version"
CLEAN="cd src/; make clean"
MAKE="cd src/; make BUILD_KERNEL=\${kernelver}"
BUILT_MODULE_LOCATION[0]="src/"
BUILT_MODULE_NAME[0]="$name"
DEST_MODULE_LOCATION[0]="/updates"
DEST_MODULE_NAME[0]="$name"
AUTOINSTALL="yes"
EOF
cd "$src_path/$file_name"
rc=0
for c in add build install; do
dkms $c -m "$name" -v "$version"
done
update-initramfs -c -k all
modinfo="$(modinfo $name)"
echo "$modinfo" | grep "$version" >/dev/null 2>&1 \
|| (echo "$name $version failed to install." && exit 1)
reboot
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment