diskimage-builder/elements/dkms/post-install.d/97-dkms
Nisha Agarwal 1cd45803f2 Reorder the script number of 'elements/dkms/post-install.d/99-dkms'
Reorder the script number of 'elements/dkms/post-install.d/99-dkms'
to 'elements/dkms/post-install.d/97-dkms' to ensure that
it will always get executed before the
'elements/ramdisk/post-install.d/99-build-ramdisk'. This
would make sure that the DKMS module is there in the ramdisk.

Closes bug: #1492904

Change-Id: I2145d0ac29646335f76745a7678d169a62f13d44
2015-10-06 09:57:06 -07:00

33 lines
832 B
Bash
Executable File

#!/bin/bash
# Trigger a run of dkms for all the modules installed
# to ensure we have valid modules build for all.
if [ ${DIB_DEBUG_TRACE:-0} -gt 0 ]; then
set -x
fi
set -eu
set -o pipefail
modules=$(dkms status | tr ',:' ' ' | awk '{ print $1 "/" $2 }')
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
kernels=$(ls /usr/src/kernels/* -d | sed -e 's|/usr/src/kernels/||' || echo "")
fi
if [ -z "$kernels" ]; then
echo "Warning: No kernel versions found for DKMS"
fi
__ARCH=$ARCH
unset ARCH
for module in $modules ; do
for kernel in $kernels ; do
dkms build $module -k $kernel
dkms install $module -k $kernel
done
done
ARCH=$__ARCH
dkms status