[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: modconf support for 2.6kernels



oops,
forgot to attach it, sorry...

Rimas Kudelis

Rimas Kudelis wrote:
hello,
three weaks ago i posted a few patches for modconf that make it support 2.6+ linux kernels. However, they were made in some quite lame way and with no instreuctions. Today i'm attaching one patch, it works with 0.2.44 sources of modconf, i'm not sure about CVS though, because cvs.debian.org seems not to respond to any requests today. the patch should be put to modconf-0.2.44 directory, and applied using the following command:
patch -p0 < modconf-patch.diff
would somebody please release a newer version of modconf that would work with 2.6?

regards,

diff -Naur ../modconf-0.2.44.old/modconf ./modconf
--- ../modconf-0.2.44.old/modconf	2003-11-21 14:35:17.000000000 +0200
+++ ./modconf	2003-11-21 14:36:58.000000000 +0200
@@ -9,6 +9,16 @@
 
 umask 022
 
+# do we need ".o" or ".ko" as a suffix for kernel module filenames?
+# (will only work with versions lower, than 10.0 =], and i'm unsure about 2.5)
+if ((`uname -r |cut -c1,3` >= 26)); then
+   Ko_Suffix="ko";
+else
+   Ko_Suffix="o";
+fi;
+
+echo "Using \".$Ko_Suffix\" as an extention for kernel objects.";
+
 # preparations, resolve the LANG alias
 if [ -n "$LANG" ] ; then
    if grep "^$LANG" /etc/locale.alias >/dev/null 2>&1; then
@@ -211,7 +221,7 @@
   dir_descrs=""
   for i in $(get_modules_dirs $Dir_Prefix); do
     if [ -d $Dir_Prefix/$i -a \
-      -f $(first $Dir_Prefix/$i/*.o) ]; then
+      -f $(first $Dir_Prefix/$i/*.$Ko_Suffix) ]; then
       if [ -n "$Exclude_Section" ] && 
                             in_list $i $Exclude_Section ; then
         true
diff -Naur ../modconf-0.2.44.old/modules/util ./modules/util
--- ../modconf-0.2.44.old/modules/util	2003-11-21 14:35:17.000000000 +0200
+++ ./modules/util	2003-11-21 14:41:42.000000000 +0200
@@ -31,8 +31,8 @@
 
 basemodulename () {
   local module=$1
-  # strip off .o suffix
-  module=${module%.o}
+  # strip off .o/.ko suffix
+  module=${module%.$Ko_Suffix}
   # strip off path prefix
   module=${module##*/}
   echo $module
@@ -57,7 +57,7 @@
 
 build_chandev_list () {
     kver=`uname -r`
-    chandev_module_list="$(for file in `find /lib/modules/$kver -name "*.o"`; do grep -q "chandev_register" $file;  if [ $? -eq 0 ]; then basemodulename $file; fi; done | sort -u)"
+    chandev_module_list="$(for file in `find /lib/modules/$kver -name "*.$Ko_Suffix"`; do grep -q "chandev_register" $file;  if [ $? -eq 0 ]; then basemodulename $file; fi; done | sort -u)"
     return 0;
 }
 
@@ -130,11 +130,11 @@
   if [ "$Source" = "floppy" ]; then
     eval "list=$`echo dir_content_$directory`"
   else
-    list="$Dir_Prefix/$directory/*.o"
+    list="$Dir_Prefix/$directory/*.$Ko_Suffix"
   fi
 
   for i in $list; do
-    # Strip directory and .o suffix
+    # Strip directory and .o/.ko suffix
     local module=$(basemodulename $i)
     
     if [ "$module" != '*' ]; then
@@ -193,7 +193,7 @@
             esac
           done
         else
-          result=$(basemodulename $Dir_Prefix/$directory/$result.o)
+          result=$(basemodulename $Dir_Prefix/$directory/$result.$Ko_Suffix)
         fi
 
         edit_module "$result"
@@ -337,8 +337,8 @@
     if [ ! -f /floppy/modules.tgz ]; then
       write_it_down "$msg_tgz_does_not_exist"
     fi
-    (cd /; zcat < /floppy/modules.tgz | $extract \*/$module.o)
-    file="/lib/modules/*/*/$module.o"
+    (cd /; zcat < /floppy/modules.tgz | $extract \*/$module.$Ko_Suffix)
+    file="/lib/modules/*/*/$module.$Ko_Suffix"
     echo "$msg_done"
     depmod -a
     $SIMULATE modprobe $module -C $Target/etc/modules.conf

Reply to: