diff options
author | V3n3RiX <venerix@rogentos.ro> | 2016-10-30 18:54:07 +0000 |
---|---|---|
committer | V3n3RiX <venerix@rogentos.ro> | 2016-10-30 18:54:07 +0000 |
commit | fc2bd83b19bfde9140a4d87e5b49769f352287ae (patch) | |
tree | 172104e81c9abb1094013a135722d46145c8328e /eclass | |
parent | db42c530b2f3e4000027835419eabbbff564f096 (diff) |
remove dkms modules from kernel tree, if the kernel itself is being removed
Diffstat (limited to 'eclass')
-rw-r--r-- | eclass/kogaion-kernel.eclass | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/eclass/kogaion-kernel.eclass b/eclass/kogaion-kernel.eclass index 229f301b..47c410ae 100644 --- a/eclass/kogaion-kernel.eclass +++ b/eclass/kogaion-kernel.eclass @@ -708,7 +708,7 @@ _dracut_initramfs_delete() { fi if [ "${PR}" == "r0" ]; then local kver="${PV}-${K_ROGKERNEL_SELF_TARBALL_NAME}" - else + else local kver="${PV}-${K_ROGKERNEL_SELF_TARBALL_NAME}-${PR}" fi rm -rf "${ROOT}boot/initramfs-genkernel-${kern_arch}-${kver}" @@ -724,6 +724,19 @@ _grub2_update_grubcfg() { fi } +_remove_dkms_modules() { + if [ "${PR}" == "r0" ] ; then + local kver="${PV}-${K_ROGKERNEL_SELF_TARBALL_NAME}" + else + local kver="${PV}-${K_ROGKERNEL_SELF_TARBALL_NAME}-${PR}" + fi + if [[ -x $(which dkms) ]] ; then + for i in $(dkms status | cut -d , -f1,2 | sed -e 's/, /\//' | uniq) ; do + dkms remove $i -k "${kver}" + done + fi +} + kogaion-kernel_pkg_postinst() { if _is_kernel_binary; then # Update kernel initramfs to match user customizations @@ -761,7 +774,7 @@ kogaion-kernel_pkg_postrm() { if _is_kernel_binary; then _dracut_initramfs_delete fi - + _remove_dkms_modules _grub2_update_grubcfg } |