Skip to content

Instantly share code, notes, and snippets.

@ppettit
Created March 20, 2024 10:32
Show Gist options
  • Save ppettit/861ba1c5865850976d34c77c24d011ee to your computer and use it in GitHub Desktop.
Save ppettit/861ba1c5865850976d34c77c24d011ee to your computer and use it in GitHub Desktop.
Build and modprobe magewell driver on Fedora (coreos)

Build and modprobe magewell driver

Should work on any Fedora distro (or others with modifications) tested on coreos.

needs to be run as root with --privileged flag eg.

$ sudo podman build -t mweco .
$ sudo podman run --rm --privileged mweco

The container should be run on boot (I'm using Podman Quadlets) and does not need to continue running once the module is modprobed.

# Builds a container that will build and modpobe
# the magewell driver. it can be run on each boot and does
# not need to remain running once the module is modprobed.
ARG BUILDER_VERSION="39"
FROM registry.fedoraproject.org/fedora:${BUILDER_VERSION} as builder
ARG BUILDER_VERSION="39"
ARG ECOCAPTURE_VERSION="1.4.227"
# if you set KERNEL_VERSION correctly then the build script will run much faster!
ARG KERNEL_VERSION="6.7.5-200.fc39.x86_64"
# we need to add the updates-archive repo so we can get to all the kernel versions
WORKDIR /etc/yum.repos.d
RUN curl -L -O https://src.fedoraproject.org/rpms/fedora-repos/raw/f${BUILDER_VERSION}/f/fedora-updates-archive.repo && \
sed -i 's/enabled=AUTO_VALUE/enabled=true/' fedora-updates-archive.repo && \
dnf install kernel-modules-${KERNEL_VERSION} kernel-devel-${KERNEL_VERSION} -y
# grab and decompress magewell driver archive
WORKDIR /
RUN curl -L -O https://www.magewell.com/files/drivers/EcoCaptureForLinuxX86_${ECOCAPTURE_VERSION}.tar.gz && \
tar xzf EcoCaptureForLinuxX86_${ECOCAPTURE_VERSION}.tar.gz && \
mv EcoCaptureForLinuxX86_${ECOCAPTURE_VERSION} ecocapture
# set up entrypoint script
COPY entrypoint.sh /
ENTRYPOINT [ "/entrypoint.sh" ]
#!/bin/env sh
# build and modprobe the magewell driver for the current running kernel
# make sure we have the correct version of the kernel headers
dnf install kernel-devel-$(uname -r) kernel-modules-$(uname -r) -y
cd /ecocapture/driver
make
make install
modprobe MWEcoCapture
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment