diskimage-builder/elements/base/post-install.d/99-dkms
Dan Prince a4c42954d3 Install dkms before using it.
Updates the new 99-dkms element so that it installs the package
before using it.

Fixes LP Bug #1183785.

Change-Id: Ia191ed3cae707a8c8591f849dc0c6293e849d64a
2013-05-24 07:56:11 -04:00

22 lines
479 B
Bash
Executable File

#!/bin/sh
# Trigger a run of dkms for all the modules installed
# to ensure we have valid modules build for all.
modules=$(dkms status | tr ',:' ' ' | awk '{ print $1 "/" $2 }')
kernels=$(ls /usr/src/linux-headers-*-*-* -d | sed -e 's|/usr/src/linux-headers-||')
__ARCH=$ARCH
unset ARCH
install-packages dkms
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