-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdkms-2.6.1-autoalias.patch
54 lines (50 loc) · 2.38 KB
/
dkms-2.6.1-autoalias.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
diff -up dkms-2.8.3/dkms.6~ dkms-2.8.3/dkms
--- dkms-2.8.3/dkms.6~ 2020-08-11 21:50:15.151678456 +0200
+++ dkms-2.8.3/dkms 2020-08-11 21:52:02.682171816 +0200
@@ -34,8 +34,8 @@ readonly dkms_conf_variables="CLEAN REMA
DEST_MODULE_NAME dest_module_name MODULES_CONF_OBSOLETES
DEST_MODULE_LOCATION dest_module_location
modules_conf_obsoletes MODULES_CONF_ALIAS_TYPE
- modules_conf_alias_type STRIP strip MODULES_CONF_OBSOLETE_ONLY
- modules_conf_obsolete_only AUTOINSTALL NO_WEAK_MODULES
+ modules_conf_alias_type MODULES_CONF_EXTRACT_ALIASES MODULES_CONF_OBSOLETE_ONLY
+ STRIP strip MODULES_CONF_OBSOLETE_ONLY modules_conf_obsolete_only AUTOINSTALL
SIGN_TOOL"
# Some important regular expressions. Requires bash 3 or above.
@@ -617,6 +617,7 @@ read_conf()
dest_module_location[$index]=${DEST_MODULE_LOCATION[$index]}
modules_conf_obsoletes[$index]=${MODULES_CONF_OBSOLETES[$index]}
modules_conf_alias_type[$index]=${MODULES_CONF_ALIAS_TYPE[$index]}
+ modules_conf_extract_aliases[$index]=${MODULES_CONF_EXTRACT_ALIASES[$index]}
case ${MODULES_CONF_OBSOLETE_ONLY[$index]} in
[yY]*)
modules_conf_obsolete_only[$index]="yes"
@@ -1016,6 +1017,16 @@ moduleconfig_remove()
done
done
+ if [ -d /etc/modprobe.d ]; then
+ local index=0
+ while [ $index -lt ${#dest_module_name[@]} ]; do
+ if [ "${modules_conf_extract_aliases[$index]}" = yes -a -f $install_tree/${kernelver_array[0]}${dest_module_location[$index]}/${dest_module_name[$index]}$module_suffix ]; then
+ modinfo $install_tree/${kernelver_array[0]}${dest_module_location[$index]}/${dest_module_name[$index]}$module_suffix | sed -n -e "s/alias:\(.*\)$/alias \1 ${dest_module_name[$index]}/p" > /etc/modprobe.d/dkms-aliases-${dest_module_name[$index]}
+ fi
+ index=$(($index+1))
+ done
+ fi
+
# Delete the temp dir
rm -rf $temp_dir_name
}
@@ -1911,6 +1922,14 @@ do_uninstall()
# Run the post_remove script
run_build_script post_remove "$post_remove"
+ if ! $0 status -m $module -v $module_version | grep -q "installed"; then
+ local index=0
+ while [ $index -lt ${#built_module_name[@]} ]; do
+ rm -f /etc/modprobe.d/dkms-aliases-${dest_module_name[$index]}
+ index=$(($index+1))
+ done
+ fi
+
# Run depmod because we changed /lib/modules
invoke_command "do_depmod $1" "depmod" background