dotfiles/bin/v4l2pls

23 lines
638 B
Plaintext
Raw Permalink Normal View History

#!/bin/bash
nutmp=$(mktemp -d)
cd "$nutmp"
mkdir -v src && cd ./src/
version="$1"
modn="v4l2loopback"
# download and extract the tarball
curl -L https://github.com/umlaeute/${modn}/archive/v${version}.tar.gz | tar xvzf -
# sudo mkdir -pv /usr/src/${modn}-${version}
sudo cp -Rv ${modn}-${version} /usr/src/
# build and install the DKMS-module (requires superuser privileges)
sudo dkms add -m ${modn} -v ${version}
sudo dkms build -m ${modn} -v ${version}
sudo dkms install -m ${modn} -v ${version}
sudo rm -rfv /usr/src/${modn}-${version}
cd /tmp
rm -rfv $nutmp
# see
# https://github.com/umlaeute/v4l2loopback#load-the-module-at-boot