From 0c19129b5d1f8e03498f6f2455ad9f7e14e9e606 Mon Sep 17 00:00:00 2001 From: Perry_Yuan Date: Thu, 9 Mar 2017 10:10:27 -0500 Subject: [PATCH 1/2] FIX dkms built issues for rhel kernel update ,change prerm script to fix. --- dkms | 4 +++- kernel_prerm.d_dkms | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/dkms b/dkms index 813968e6..f5985285 100644 --- a/dkms +++ b/dkms @@ -1723,7 +1723,9 @@ do_uninstall() fi fi done - rm -f "$dkms_tree/$module/kernel-$1-$2" + rm -rf "$dkms_tree/$module/kernel-$1-$2" + #Remove modules from dkms built tree + rm -rf "$dkms_tree/$module/$module_version/$1" else echo $"" echo $"Status: This module version was INACTIVE for this kernel." diff --git a/kernel_prerm.d_dkms b/kernel_prerm.d_dkms index 19dfd63c..f7224999 100755 --- a/kernel_prerm.d_dkms +++ b/kernel_prerm.d_dkms @@ -9,7 +9,7 @@ while read line; do vers=`echo "$line" | awk '{print $2}' | sed 's/,$//'` arch=`echo "$line" | awk '{print $4}' | sed 's/:$//'` echo "dkms: removing: $name $vers ($inst_kern) ($arch)" >&2 - dkms remove -m $name -v $vers -k $inst_kern -a $arch + dkms uninstall -m $name -v $vers -k $inst_kern -a $arch done < <(dkms status -k $inst_kern 2>/dev/null | grep ": installed") fi From b8c47506fd3fb465f0c4d34d54baa1820261f987 Mon Sep 17 00:00:00 2001 From: root Date: Sat, 11 Mar 2017 15:28:22 +0800 Subject: [PATCH 2/2] Enable dkms servie with systemctl command --- dkms.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dkms.spec b/dkms.spec index 8e85d857..13ba4090 100644 --- a/dkms.spec +++ b/dkms.spec @@ -134,7 +134,7 @@ rm -rf $RPM_BUILD_ROOT %if 0%{?fedora} >= 20 || 0%{?rhel} >= 7 %post -%systemd_post %{name}.service +systemctl enable %{name}.service>/dev/null 2>&1 %preun if [ $1 -eq 0 ]; then