Skip to content

Instantly share code, notes, and snippets.

@romanr
Forked from zparnold/ena_setup_on_ec2.sh
Created November 15, 2019 12:00
Show Gist options
  • Save romanr/50e8fcd76b2924738ec5b35d2a257189 to your computer and use it in GitHub Desktop.
Save romanr/50e8fcd76b2924738ec5b35d2a257189 to your computer and use it in GitHub Desktop.
Run this script on Ubuntu to enable ENA support.
#!/bin/bash
sudo apt-get update && sudo apt-get upgrade -y
#you may get an error E: Failed to fetch https://sdkrepo.atlassian.com/debian/dists/stable/contrib/binary-amd64/Packages 404 Not Found
#don't worry, you can continue without harm
sudo apt-get install -y build-essential dkms
git clone https://github.com/amzn/amzn-drivers
sudo mv amzn-drivers /usr/src/amzn-drivers-2.1.3
sudo touch /usr/src/amzn-drivers-2.1.3/dkms.conf
echo 'PACKAGE_NAME="ena"
PACKAGE_VERSION="2.1.3"
CLEAN="make -C kernel/linux/ena clean"
MAKE="make -C kernel/linux/ena/ BUILD_KERNEL=${kernelver}"
BUILT_MODULE_NAME[0]="ena"
BUILT_MODULE_LOCATION="kernel/linux/ena"
DEST_MODULE_LOCATION[0]="/updates"
DEST_MODULE_NAME[0]="ena"
AUTOINSTALL="yes"' | sudo tee -a /usr/src/amzn-drivers-2.1.3/dkms.conf
sudo dkms add -m amzn-drivers -v 2.1.3
sudo dkms build -m amzn-drivers -v 2.1.3
sudo dkms install -m amzn-drivers -v 2.1.3
modinfo ena
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment