diff options
-rw-r--r-- | bcwc-pcie-git.install | 27 |
1 files changed, 24 insertions, 3 deletions
diff --git a/bcwc-pcie-git.install b/bcwc-pcie-git.install index 576b48ea72b5..9b9fdb1bbe5a 100644 --- a/bcwc-pcie-git.install +++ b/bcwc-pcie-git.install @@ -1,8 +1,29 @@ post_install() { - KERNEL_VERSION=$(uname -r | cut -d '.' -f 1,2) - depmod $(cat /usr/lib/modules/extramodules-${KERNEL_VERSION}-ARCH/version) + dkms_install $1 +} + +pre_upgrade() { + dkms_remove $2 } post_upgrade() { - post_install + dkms_install $1 +} + +pre_remove () { + dkms_remove $1 +} + +dkms_remove() { + local line=`dkms status -m bcwc-pcie` + if echo "$line" | grep -E 'added|built|installed'; then + dkms remove -m bcwc-pcie -v ${1%%-*} --all + fi +} + +dkms_install() { + dkms install -m bcwc-pcie -v ${1%%-*} + modprobe facetimehd + + /usr/bin/depmod -a } |