Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I have a Compaq Presario CQ-61 320SQ, I am using Ubuntu 10.04 because after update to 10.10 my mouse and touchpad won't work, network won't work, sound won't work ... (I managed to fix most of them after almost a month of googling, but not all, my 2 Desktops have no problem with 10.10) so I decided to switch back to 10.04, where I have a problem:

My broadband speed is very low beacause of the kernel module r8169, I downloaded the good module r8101 and every time the computer boots have a rc.local entry to fix this.

Question:
Can I load the modul permanently from a specific location. I heard about /etc/modules but there I need the module name, but I have to load it from a specific path (where is the default path for that) ?

Thank you.

So I studied the script:

It creates the file r8101.ko in /lib/modules/`uname -r`/kernel/drivers/net so I think as long as nobody will delete that file, and I don't update the kernel, maybe adding r8108 to /etc/modules will work, and add r8169 to blacklist ... I will give it a try.

EDIT2:
So I added r8101 to /etc/modules and blacklist r8169 to /etc/modprobe.d/blacklist.conf. It still uses the old module.:

radu@adu:~$ lsmod | grep r8
r8101                  67626  0 
r8169                  34108  0 
mii                     4381  1 r8169

EDIT: The module is loaded using this script that came with it.:

#!/bin/sh

# invoke insmod with all arguments we got
# and use a pathname, as insmod doesn't look in . by default

TARGET_PATH=/lib/modules/`uname -r`/kernel/drivers/net
echo
echo "Check old driver and unload it." 
check=`lsmod | grep r8169`
if [ "$check" != "" ]; then
        echo "rmmod r8169"
        /sbin/rmmod r8169
fi

check=`lsmod | grep r8101`
if [ "$check" != "" ]; then
        echo "rmmod r8101"
        /sbin/rmmod r8101
fi

echo "Build the module and install"
echo "-------------------------------" >> log.txt
date 1>>log.txt
make all 1>>log.txt || exit 1
module=`ls src/*.ko`
module=${module#src/}
module=${module%.ko}

if [ "$module" == "" ]; then
    echo "No driver exists!!!"
    exit 1
elif [ "$module" != "r8169" ]; then
    if test -e $TARGET_PATH/r8169.ko ; then
        echo "Backup r8169.ko"
        if test -e $TARGET_PATH/r8169.bak ; then
            i=0
            while test -e $TARGET_PATH/r8169.bak$i
            do
                i=$(($i+1))
            done
            echo "rename r8169.ko to r8169.bak$i"
            mv $TARGET_PATH/r8169.ko $TARGET_PATH/r8169.bak$i
        else
            echo "rename r8169.ko to r8169.bak"
            mv $TARGET_PATH/r8169.ko $TARGET_PATH/r8169.bak
        fi
    fi
fi

echo "Depending module. Please wait."
depmod -a
echo "load module $module"
modprobe $module

echo "Completed."
exit 0
share|improve this question
    
If adding it to /etc/modules works, you should answer your own question. –  Javier Rivera Feb 1 '11 at 18:28
    
didn't work as expected, updated the question –  Radu Maris Feb 1 '11 at 19:42
3  
If you edit /etc/modules you need to run (as sudo) update-initramfs -u and then restart. –  papukaija Feb 1 '11 at 20:24
1  
@papukaija: man you'r a genius, tks :) –  Radu Maris Feb 1 '11 at 21:03

1 Answer 1

up vote 8 down vote accepted

So to gather all the data to an answer, here it is:

  1. After the first compile of the new module, I had the module file r8101.ko in /lib/modules/$(uname -r)/kernel/drivers/net.

  2. I added r8101 to /etc/modules and blacklist r8169 to /etc/modprobe.d/blacklist.conf but I was still booting to the old module.

  3. Then I run sudo update-initramfs -u and then after restart the new module was loaded as expected (thanks to @papukaija comment).

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.