Announcement

Collapse
No announcement yet.

What does sudo modprobe do?

Collapse
This topic is closed.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    What does sudo modprobe do?

    Hi

    My wife has an acer aspire one with ubuntu 11.04 on it. Every time it is upgraded I have fun and games with the fan.

    Way back when I was provided with the following advice:

    "Just create a file /etc/modprobe.d/acerhdf.conf
    containing: options acerhdf interval=5 fanon=68000 fanoff=55000 kernelmode=1
    then open a terminal and type sudo modprobe acerhdf"

    This has to date worked but not for 11.04 and I suspect that might be because I have forgotten to type

    Code:
    sudo modprobe acerhdf
    I'm not sure what the command actually does, but would I be right (more or less) in guessing that the kernel module is lying dormant and that whilst I can put whatever configuration file I choose in there nothing will happen until I "activate" it with a one-off issue of the command? If that's not the case it would be nice if I could have a brief explanation as if I am messing about with kernel modules I would like to know what I am doing and why

    Thanks

    ian








    #2
    Re: What does sudo modprobe do?

    From "man modprobe":

    modprobe intelligently adds or removes a module from the Linux kernel: note that for conve‐
    nience, there is no difference between _ and - in module names (automatic underscore conver‐
    sion is performed). modprobe looks in the module directory /lib/modules/`uname -r` for all
    the modules and other files, except for the optional /etc/modprobe.conf configuration file
    and /etc/modprobe.d directory (see modprobe.conf(5)). modprobe will also use module options
    specified on the kernel command line in the form of <module>.<option>.
    So the xxx.conf file that you made in /etc/modprobe.d/ is read by modprobe when you run it for that particular module.

    To see all the loaded modules for your running kernel:

    Code:
    lsmod

    Comment


      #3
      Re: What does sudo modprobe do?

      Modprobe loads a module into the kernel on a temporary (memory) basis, rather than compiling it permanently into the kernel.

      I think the idea behind it is efficiency and wide-range compatibility. One can have a smaller (more efficient) kernel and allow the user to determine what modules he needs for his system. You can even load and unload modules as needed. Imagine the driver for every different type of sound card there is all loaded into one kernel - it would be huge and that's just one piece of hardwar. Then every time you accessed your sound card it would run through all that data to find the right driver.

      Back in the "olden" days, I used to have re-compile my kernels to get certain functionality included in a kernel. If I took the time to remove things I didn't need, I would often end up with a smaller and faster loading kernel. The downside was every time you wanted to update your kernel, you had to rebuild it all over again. Module loading avoids this arduous task.

      One example of this we still often do is the nVidia driver. It requires a kernel re-compile for it be available. Again, now-a-days we have a newer tool available called DKMS - Dynamic Kernel Module Service - which once set up, automagically installs certain drivers that are not written as modules (nvidia, ndiswrapper, virtualbox drivers, etc.) into each new kernel and re-compiles it for you.

      Please Read Me

      Comment


        #4
        Re: What does sudo modprobe do?

        Thanks for that, I think I'm getting there

        Would I be right in assuming that when I sun the sudo modprobe command, it puts a flag somewhere that tells the kernel to load the module, from which point it can then pick up the settings in the file I created in /etc/modprobe.?

        Thanks

        Comment


          #5
          Re: What does sudo modprobe do?

          Yes, that's right.

          To further automate it, you can write the name of that module in /etc/modules, and it will be automatically loaded for you at boot time.

          Comment


            #6
            Re: What does sudo modprobe do?

            The acerhdf module has the following parameters:
            depends:
            vermagic: 2.6.35-25-generic SMP mod_unload modversions
            parm: kernelmode:Kernel mode fan control on / off (uint)
            parm: interval:Polling interval of temperature check (uint)
            parm: fanon:Turn the fan on above this temperature (uint)
            parm: fanoff:Turn the fan off below this temperature (uint)
            parm: verbose:Enable verbose dmesg output (uint)
            parm: force_bios:Force BIOS version and omit BIOS check (string)
            parm: force_product:Force BIOS product and omit BIOS check (string)
            so to know to set
            options acerhdf interval=5 fanon=68000 fanoff=55000 kernelmode=1
            is getting high on the Geek scale! 8)

            Modprobe automatically loads dependent modules before it loads the intended module. Insmod does not.
            "A nation that is afraid to let its people judge the truth and falsehood in an open market is a nation that is afraid of its people.”
            – John F. Kennedy, February 26, 1962.

            Comment


              #7
              Re: What does sudo modprobe do?

              Originally posted by GreyGeek

              so to know to set
              options acerhdf interval=5 fanon=68000 fanoff=55000 kernelmode=1
              is getting high on the Geek scale! 8)

              Modprobe automatically loads dependent modules before it loads the intended module. Insmod does not.
              Indeed but when you have a computer problem a geek is by a long margin your best friend

              Interestingly I found out the problem and all now seems well. When I ran sudo modprobe acerhdf the terminal complained of a bad line in the file. As it was the only line it was pretty easy to spot a typo - fixed the error, ran the command and rebooted and things are quiet now

              Thanks for the input all which has helped me understand this a whole lot more.

              Ps - Does interval=5 mean that a check will be done every 5 seconds?

              Comment


                #8
                Re: What does sudo modprobe do?

                For the temperature, yes.
                "A nation that is afraid to let its people judge the truth and falsehood in an open market is a nation that is afraid of its people.”
                – John F. Kennedy, February 26, 1962.

                Comment

                Working...
                X