These steps can be used to upgrade the Intel ice
module for Linux hosts. This module is used for various network cards; in this case it is for a Intel XXV810 NIC.
DKMS will be used to ensure the drivers are installed for future kernel updates.
Install the package requirements:
apt -y install linux-headers-amd64 build-essential dkms
Set the release of the ice
module as a variable to allow easy copy/paste of the below commands:
ICE_RELEASE="1.17.2"
If the host is running Proxmox, install the following packages instead:
apt -y install pve-headers build-essential dkms
Download the module into /usr/src
:
cd /usr/src
wget -O "ice-${ICE_RELEASE}.tar.gz" "https://github.com/intel/ethernet-linux-ice/releases/download/v${ICE_RELEASE}/ice-${ICE_RELEASE}.tar.gz"
Extract the module:
tar zxvf "ice-${ICE_RELEASE}.tar.gz"
Create the DKMS configuration file:
cat << EOF > "ice-${ICE_RELEASE}/dkms.conf"
PACKAGE_NAME=ice
PACKAGE_VERSION=$ICE_RELEASE
EOF
cat << 'EOF' >> "ice-${ICE_RELEASE}/dkms.conf"
BUILT_MODULE_NAME="$PACKAGE_NAME"
BUILT_MODULE_LOCATION=src/
MAKE="BUILD_KERNEL=${kernelver} make -j24 -C src/ KSRC=/lib/modules/${kernelver}/build KERNELDIR=/lib/modules/${kernelver}/build"
CLEAN="make -C src/ clean"
DEST_MODULE_LOCATION=/extra
AUTOINSTALL=yes
EOF
Add the new module to DKMS:
dkms add -m ice -v "$ICE_RELEASE"
Build the module:
dkms build -m ice -v "$ICE_RELEASE"
If no build problems, you can now install the module:
dkms install -m ice -v "$ICE_RELEASE"
Reboot the host and the new driver will now be used.
If you want to create a Debian package for the module, follow these steps.
Install the following requirements to build the package:
apt -y install wget build-essential dpkg-dev devscripts dh-dkms dkms
Create a temporary directory to store the files for the package build:
mkdir /usr/local/src/ice-package && cd /usr/local/src/ice-package
Get the source:
wget -O "ice-${RELEASE}.tar.gz" "https://github.com/intel/ethernet-linux-ice/releases/download/v${RELEASE}/ice-${RELEASE}.tar.gz"
Extract it and remove the archive:
tar zxvf "ice-${RELEASE}.tar.gz" && rm -f "ice-${RELEASE}.tar.gz"
Create a debian directory:
mkdir debian
Create a changelog file. Make sure to set the version correctly.
cat << EOF > debian/changelog
ice-dkms ($RELEASE-0) bookworm; urgency=medium
* Upstream release
-- gbe0 <packages@gbe0.com> Tue, 20 Aug 2024 12:00:00 +0800
EOF
Create a control file to set dependancies:
cat << 'EOF' > debian/control
Source: ice-dkms
Maintainer: gbe0 <packages@gbe0.com>
Build-Depends:
debhelper (>= 10),
dkms,
Package: ice-dkms
Architecture: all
Depends:
${misc:Depends},
linux-headers-amd64 [amd64] | pve-headers [amd64],
Description: DKMS source for the Intel ice network driver
EOF
Create the rules file:
cat << 'EOF' > debian/rules
#!/usr/bin/make -f
include /usr/share/dpkg/pkg-info.mk
%:
dh $@ --with dkms
override_dh_install:
dh_install ice-1.14.13/* usr/src/ice-$(DEB_VERSION_UPSTREAM)/
override_dh_dkms:
dh_dkms -V $(DEB_VERSION_UPSTREAM)
override_dh_auto_configure:
override_dh_auto_build:
override_dh_auto_test:
override_dh_auto_install:
override_dh_auto_clean:
EOF
Create the DKMS configuration file:
cat << 'EOF' > ice-dkms.dkms
PACKAGE_NAME="ice"
PACKAGE_VERSION="#MODULE_VERSION#"
BUILT_MODULE_NAME="$PACKAGE_NAME"
BUILT_MODULE_LOCATION=src/
MAKE="BUILD_KERNEL=${kernelver} make -j24 -C src/ KSRC=/lib/modules/${kernelver}/build KERNELDIR=/lib/modules/${kernelver}/build"
CLEAN="make -C src/ clean"
DEST_MODULE_LOCATION=/extra
AUTOINSTALL=yes
EOF
Create the compat file:
cat << EOF > debian/compat
10
EOF
Finally build the package:
dpkg-buildpackage