The following commit has been merged in the master branch:
commit c5b7822565b31b6d6ce1dde1e0d99f08b9c28578
Author: Giuseppe Iuculano <[email protected]>
Date:   Fri May 15 22:15:48 2009 +0200

    debian/patches/15_modprobe.patch: do not create an empty 
/etc/modprobe.d/package_name.conf. it is opened and parsed every time modprobe 
is run (and it is run very often at boot time). Create it only if necessary.

diff --git a/debian/patches/15_modprobe.patch b/debian/patches/15_modprobe.patch
index f14c75b..164ba58 100644
--- a/debian/patches/15_modprobe.patch
+++ b/debian/patches/15_modprobe.patch
@@ -1,38 +1,27 @@
-do not install /etc/modprobe.d/dkms, it only contains comments and is opened 
and parsed every time modprobe is run (and it is run very often at boot time). 
Use instead (and create if necessary) /etc/modprobe.d/package_name.conf.
+do not create an empty /etc/modprobe.d/package_name.conf. it is opened and 
parsed every time modprobe is run (and it is run very often at boot time). 
Create it only if necessary.
 --- a/dkms
 +++ b/dkms
-@@ -739,6 +739,14 @@ function moduleconfig_add ()
-     [ -e /etc/modprobe.d/dkms ] && modconfig_files="/etc/modprobe.d/dkms"
-     [ -e /etc/modules.conf ] && modconfig_files="$modconfig_files 
/etc/modules.conf"
-     [ -e /etc/modprobe.conf ] && modconfig_files="$modconfig_files 
/etc/modprobe.conf"
-+    [ -e /etc/modprobe.d/$package_name.conf ] && 
modconfig_files="/etc/modprobe.d/$package_name.conf"
-+
-+    if [ -z "$modconfig_files" ]; then
-+          touch /etc/modprobe.d/$package_name.conf
-+          echo $"created /etc/modprobe.d/$package_name.conf.">&2
-+          modconfig_files="/etc/modprobe.d/$package_name.conf"
-+    fi
-+
+@@ -750,8 +750,6 @@ function moduleconfig_add ()
+     [ -e /etc/modprobe.d/$package_name.conf ] && 
modconfig_files="/etc/modprobe.d/$package_name.conf"
  
-     for moduleconfig in $modconfig_files; do
-       local index=0
-@@ -809,6 +817,7 @@ function moduleconfig_remove ()
-     [ -e /etc/modprobe.d/dkms ] && modconfig_files="/etc/modprobe.d/dkms"
-     [ -e /etc/modules.conf ] && modconfig_files="$modconfig_files 
/etc/modules.conf"
-     [ -e /etc/modprobe.conf ] && modconfig_files="$modconfig_files 
/etc/modprobe.conf"
-+    [ -e /etc/modprobe.d/$package_name.conf ] && 
modconfig_files="/etc/modprobe.d/$package_name.conf"
+     if [ -z "$modconfig_files" ]; then
+-          touch /etc/modprobe.d/$package_name.conf
+-          echo $"created /etc/modprobe.d/$package_name.conf.">&2
+           modconfig_files="/etc/modprobe.d/$package_name.conf"
+     fi
  
-     for moduleconfig in $modconfig_files; do
-       index=0
-@@ -833,6 +842,11 @@ function moduleconfig_remove ()
-                   grep -v "alias ${modules_conf_alias_type[$index]}[0-9]* 
${dest_module_name[$index]}" $moduleconfig > $temp_dir_name/moduleconfig.new
-                   mv -f $temp_dir_name/moduleconfig.new $moduleconfig
-                   echo $"$moduleconfig: removed alias for 
'${dest_module_name[$index]}'"
-+                  if [ "$modconfig_files" == 
"/etc/modprobe.d/$package_name.conf" ]; then
-+                          rm -f /etc/modprobe.d/$package_name.conf
-+                          echo $"$moduleconfig: deleted 
/etc/modprobe.d/$package_name.conf file"
-+                  fi
-+
-               fi
-           fi
+@@ -782,8 +780,13 @@ function moduleconfig_add ()
  
+           # Only add it if it can't be found already in config file
+           if [ -n "${modules_conf_alias_type[$index]}" ] && \
+-             ! grep -q "alias ${modules_conf_alias_type[$index]}[0-9]* 
${dest_module_name[$index]}\b" $moduleconfig && \
++             ! grep -qs "alias ${modules_conf_alias_type[$index]}[0-9]* 
${dest_module_name[$index]}\b" $moduleconfig && \
+              [ "${modules_conf_obsolete_only[$index]}" != "yes" ]; then
++              if [ "$modconfig_files" == "/etc/modprobe.d/$package_name.conf" 
] && \
++                      [ ! -e /etc/modprobe.d/$package_name.conf ]; then
++                      touch /etc/modprobe.d/$package_name.conf
++                      echo $"created /etc/modprobe.d/$package_name.conf.">&2
++              fi
+               aliases=$(awk "/^alias ${modules_conf_alias_type[$index]}/ 
{print \$2}" $moduleconfig)
+               if [ -n "$aliases" ]; then
+                       alias_number=$(($(echo "$aliases" | sed 
"s/${modules_conf_alias_type[$index]}//" | sort -n | tail -n 1) + 1))

-- 
Maintainance of the dkms package

_______________________________________________
Pkg-dkms-commits mailing list
[email protected]
http://lists.alioth.debian.org/mailman/listinfo/pkg-dkms-commits

Reply via email to