summaryrefslogtreecommitdiff
path: root/eclass/kogaion-kernel.eclass
diff options
context:
space:
mode:
Diffstat (limited to 'eclass/kogaion-kernel.eclass')
-rw-r--r--eclass/kogaion-kernel.eclass17
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
}