2013-11-07 04:25:34 +00:00
|
|
|
#!/bin/bash
|
2013-05-24 10:42:36 +00:00
|
|
|
# Trigger a run of dkms for all the modules installed
|
|
|
|
# to ensure we have valid modules build for all.
|
|
|
|
|
2014-09-04 04:56:29 +00:00
|
|
|
if [ ${DIB_DEBUG_TRACE:-0} -gt 0 ]; then
|
|
|
|
set -x
|
|
|
|
fi
|
2014-03-29 03:28:22 +00:00
|
|
|
set -eu
|
|
|
|
set -o pipefail
|
|
|
|
|
2022-05-11 19:12:17 +00:00
|
|
|
modules=$(dkms status | tr ',:/' ' ' | awk '{ print $1 "/" $2 }')
|
2014-04-03 22:49:18 +00:00
|
|
|
kernels=$(ls /usr/src/linux-headers-*-*-* -d | sed -e 's|/usr/src/linux-headers-||' || echo "")
|
|
|
|
# NOTE(bnemec): On Fedora, the versions can be found in /usr/src/kernels
|
|
|
|
if [ -z "$kernels" ]; then
|
2014-05-02 17:02:38 +00:00
|
|
|
kernels=$(ls /usr/src/kernels/* -d | sed -e 's|/usr/src/kernels/||' || echo "")
|
2014-04-03 22:49:18 +00:00
|
|
|
fi
|
|
|
|
if [ -z "$kernels" ]; then
|
2014-05-02 17:02:38 +00:00
|
|
|
echo "Warning: No kernel versions found for DKMS"
|
2014-04-03 22:49:18 +00:00
|
|
|
fi
|
2013-05-24 10:42:36 +00:00
|
|
|
__ARCH=$ARCH
|
|
|
|
unset ARCH
|
|
|
|
|
|
|
|
for module in $modules ; do
|
2014-05-02 17:02:38 +00:00
|
|
|
for kernel in $kernels ; do
|
|
|
|
dkms build $module -k $kernel
|
|
|
|
dkms install $module -k $kernel
|
|
|
|
done
|
2013-05-24 10:42:36 +00:00
|
|
|
done
|
|
|
|
|
|
|
|
ARCH=$__ARCH
|
|
|
|
|
|
|
|
dkms status
|