how do I modprobe at boot?
FedoraForum.org - Fedora Support Forums and Community
Page 1 of 2 1 2 LastLast
Results 1 to 15 of 21
  1. #1
    Join Date
    Feb 2010
    Posts
    661
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    how do I modprobe at boot?

    Hi All,

    How do I do a "modprobe xxxx" only when I am booting up?

    Many thanks,
    -T

  2. #2
    Join Date
    Jan 2011
    Location
    /home
    Posts
    266
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: how do I modprobe at boot?

    I would add it in '/etc/rc.d/rc.local' .
    regards, Thomas

  3. #3
    Join Date
    Feb 2010
    Posts
    661
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: how do I modprobe at boot?

    Quote Originally Posted by Smoking Tux
    I would add it in '/etc/rc.d/rc.local' .
    rc.local is too late in the game. It has to fire off before iptables and rpcidmapd.

    Thank you for the help,
    -T

    ---------- Post added at 11:27 PM ---------- Previous post was at 11:06 PM ----------

    Think I figured it out. I have to create a /etc/sysconfig/modules/xxxxx.modules file with 755 permission and root.root ownership. Then populate it with something like:

    #!/bin/sh
    exec /sbin/modprobe xxxxx >/dev/null 2>&1

  4. #4
    Join Date
    Oct 2006
    Location
    新加坡
    Posts
    997
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: how do I modprobe at boot?

    Have you looked at /etc/modprobe.d/ folder?
    YaoWT - Leave no window unbroken ♪ (^。^) 

  5. #5
    Join Date
    Jul 2011
    Posts
    13
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: how do I modprobe at boot?

    If we take the example of using the dvb-bt8xx module

    You could create a text file called /etc/modprobe.d/dvb-bt8xx.conf

    And in the text file simply put "dvb-bt8xx" (without the quotations)

    ---------- Post added at 12:31 PM ---------- Previous post was at 12:31 PM ----------

    If we take the example of using the dvb-bt8xx module

    You could create a text file called /etc/modprobe.d/dvb-bt8xx.conf

    And in the text file simply put "dvb-bt8xx" (without the quotations)

  6. #6
    Join Date
    Feb 2010
    Posts
    661
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    [solved] Re: how do I modprobe at boot?

    Quote Originally Posted by MickStep
    If we take the example of using the dvb-bt8xx module

    You could create a text file called /etc/modprobe.d/dvb-bt8xx.conf

    And in the text file simply put "dvb-bt8xx" (without the quotations)

    ---------- Post added at 12:31 PM ---------- Previous post was at 12:31 PM ----------

    If we take the example of using the dvb-bt8xx module

    You could create a text file called /etc/modprobe.d/dvb-bt8xx.conf

    And in the text file simply put "dvb-bt8xx" (without the quotations)
    Hi Mick,

    "simply putting "dvb-bt8xx"" in a fresh .conf file gives you this error at boot:

    Entering non-interactive startup
    Applying Intel CPU microcode update: WARNING: /etc/modprobe.d/customstuff.conf line 1: ignoring bad line starting with 'xxxxx'

    From what I can tell modprobe.d is for "manipulating" not adding modules.

    But I do believe I figured it out. You have to create a /etc/sysconfig/modules/xxxxx.modules file with 755 permission and root.root ownership. Then populate it with something like:

    #!/bin/sh
    exec /sbin/modprobe xxxxx >/dev/null 2>&1

    Thank you for the help,
    -T

  7. #7
    Join Date
    Jun 2004
    Location
    Maryland, US
    Posts
    7,489
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: how do I modprobe at boot?

    I'm guessing that systemadm when it gets finalized will be the easy and best place to do this stuff and also take ordering into account

  8. #8
    Join Date
    Aug 2009
    Posts
    8,486
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: how do I modprobe at boot?

    in the /etc/modprobe.d folder, you have to put the modprobe command followed by the module name

    so for example, /etc/modprobe.d/floppy.conf would contain:

    modprobe floppy

    (you can have dracut include it in the initramfs as well, if you run dracut after you create the file.)

  9. #9
    Join Date
    Feb 2010
    Posts
    661
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: how do I modprobe at boot?

    Quote Originally Posted by DBelton
    in the /etc/modprobe.d folder, you have to put the modprobe command followed by the module name

    so for example, /etc/modprobe.d/floppy.conf would contain:

    modprobe floppy

    (you can have dracut include it in the initramfs as well, if you run dracut after you create the file.)
    Thank you ! I get at the computer again on Tuesday, so I will try out both methods and report back.

    -T

  10. #10
    Join Date
    Aug 2009
    Posts
    8,486
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: how do I modprobe at boot?

    Quote Originally Posted by ToddAndMargo
    Thank you ! I get at the computer again on Tuesday, so I will try out both methods and report back.

    -T
    If you need to rebuild the initramfs:
    After adding the modprobe above:

    Code:
    su -
    (root password)
    
    cp /boot/initramfs.$(uname -r).img /boot/initramfs.$(uname -r).bak
    
    dracut -f /boot/initramfs.$(uname -r).img $(uname -r)
    (that copies the current initramfs to a backup, then creates a new one using dracut for the currently running kernel version)

  11. #11
    Join Date
    Feb 2010
    Posts
    661
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    [solved]Re: how do I modprobe at boot?

    Quote Originally Posted by ToddAndMargo
    Thank you ! I get at the computer again on Tuesday, so I will try out both methods and report back.

    -T
    Code:
    # more /etc/modprobe.d/customstuff.conf
    modprobe xxxxx
    Gives the following in /var/log/boot.log

    Code:
    Entering non-interactive startup
    Applying Intel CPU microcode update:
    WARNING: /etc/modprobe.d/customstuff.conf line 1: ignoring bad line starting with 'modprobe'
    On the other hand:

    Code:
    #more /etc/sysconfig/modules/xxxxx.modules
    #!/bin/sh
    exec /sbin/modprobe xxxxx >/dev/null 2>&1
    Worked perfectly.

    Thank you to all for the tips and suggestions!
    -T

  12. #12
    stevea Guest

    Re: how do I modprobe at boot?

    Wow - you did get a LONG list of poor advice here.

    The modprobe.d scheme is for specifying driver options and blacklisting drivers - it DOES NOT cause a driver to load.


    Before F15 .....
    You are supposed to put a root owned executable script in /etc/sysconfig/modules
    This was executed early by /etc/rc.d/rc.sysiniit
    Example
    cat <<EOF >/etc/sysconfig/modules/mydriver
    #!/bin/bash
    lsmod | grep -q dvb-bt8xx || /sbin/modprobe dvb-bt8xx >/dev/null 2>&1
    EOF

    The command does a moprobe ONLY if the driver is not loaded.


    In F15it's less clear, initscripts is *supposed* to do the same.
    The directory doesn't exist by default.

  13. #13
    Join Date
    Jun 2011
    Posts
    64
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: how do I modprobe at boot?

    /etc/modules-load.d/ is the folder you want. Just create a file with a list of modules.

    For example, create the file "/etc/modules-load.d/kvm.conf" with the contents:
    Code:
    kvm
    kvm-intel
    I'm pretty sure this is the "proper" way to do this.
    Last edited by jamielinux; 23rd July 2011 at 06:28 PM.

  14. #14
    Join Date
    Oct 2006
    Location
    新加坡
    Posts
    997
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: how do I modprobe at boot?

    Quote Originally Posted by stevea
    Wow - you did get a LONG list of poor advice here..
    Hi Stevea, as must as I respect your other posts, I found your last one was too arrogant. We are all here trying to help without any obligation based on our own level of knowledge.

    Have you "man modprobe.d", it certainly states that modprobe.d can be used for other tasks besides providing options and blacklisting. In my system I have configuration files in the modprobe.d folder like "dist.conf" and "dist-alsa.conf" that trying to install kernel module there.

    There are may ways to Rome. No one says this is the above is the only ways or it might solve the OP problem but simply that it worth to be explored.

    Have a nice day!
    YaoWT - Leave no window unbroken ♪ (^。^) 

  15. #15
    stevea Guest

    Re: how do I modprobe at boot?

    Quote Originally Posted by weitjong
    Hi Stevea, as must as I respect your other posts, I found your last one was too arrogant. We are all here trying to help without any obligation based on our own level of knowledge.
    Perhaps you don't like arrogance, but I don't like people who mislead and give bad advice to beginners. Misleading people by posting wrong-info as though it was fact is the true arrogance. That helps no one and hurts many. The misinformation in this thread was so bad it required a warning-comment I believe.

    If people sincerely do not know - they should not post misleading and harmful posts.
    If people have some idea they are unsure of - then that should correctly label their GUESS, or UNCLEAR, or PRETTY SURE or other weasel-words..

    Have you "man modprobe.d", it certainly states that modprobe.d can be used for other tasks besides providing options and blacklisting. In my system I have configuration files in the modprobe.d folder like "dist.conf" and "dist-alsa.conf" that trying to install kernel module there.
    Yes - I read long ago and I understood it. It is for CONFIGURATION of modprobes - not to initiate driver loading. Yes you can cause dependent drivers to load - but only when modprobe initiates the precedent/first driver loading. That doesn't help here.

    /etc/modprobe.d was not designed to cause loading of drivers. It's files are only examined when the modprobe command is first executed (and that was the origian OP problem). Nothing cause a "list execution" of these files as you seem to think.


    If you want to load driver B when driver A is loaded, then look to /etc/modprobe.d
    If you want to load driver A with specific options - then look to /etc/modprobe.d
    If you want to prevent driver A from loading - then look to /etc/modprobe.d
    If you want to alias driver names- then look to /etc/modprobe.d
    If you want some program or action to occur whenever driver A is modprobed , then look to /etc/modprobe.d
    If you want to initiate modprobe at boot or otherwise - then /etc/modprobe.d cannot work. You need udev or rc.sysinit or systemd or ...


    And NO - dist.donf and dist-alsa.conf DO NOT initiate driver loading except as a side-effect or for dependent drivers. You need to read "man modprobe.conf" and then think very hard about what causes any of the actions there to initiate. It is only the modprobe of some specific driver.


    There are may ways to Rome. No one says this is the above is the only ways or it might solve the OP problem but simply that it worth to be explored.

    Have a nice day!
    But you suggested a path to nowhere, not Rome - it cannot work.

    There are lots of ways to approach any problem. Some are recommended and supported by our distro. Some are reasonable and work, yet not recommended. Some are plain dumb and wrong-headed, can't work.

    Post #2 was a reasonable non-recommended method, that doesn't happen to work here.
    Post #4 is wrong, but merely says "have you looked at ..." and wasn't purporting any knowledge. No great fault.
    Post #5 is wrong, can't work and misleads people.
    Post #8 by the highly respected (by me) DBelton is dead-wrong too. Perhaps he was thinking of something else, but this bad advice also cannot work and is misleading and harmful.
    Post #10 is also highly misleading. We don't need or want to build an initramfs for a media driver. This sort of advice will cause the OP a lot of wasted work. It's misleading, harmful. I must assume DB' did not carefully read the thread.

    Post #13 looks like the correct F15 advice, and jnguyen carefully states that's he is only "pretty sure", A good cautious warning if he is unsure.

    As a student I learned it is just as important to recognize what we do not know, as to understand what we do know. Spreading "wrong knowledge" harms everyone, even when it's an honest mistake.
    Last edited by stevea; 24th July 2011 at 07:29 AM.

Page 1 of 2 1 2 LastLast

Similar Threads

  1. Replies: 1
    Last Post: 23rd May 2010, 09:48 PM
  2. ndiswrapper - have to modprobe every boot
    By theforest in forum Servers & Networking
    Replies: 1
    Last Post: 17th June 2007, 10:28 PM
  3. How to automatically modprobe on boot
    By aero-z in forum Using Fedora
    Replies: 7
    Last Post: 4th May 2006, 11:12 AM
  4. modprobe and loading modules at boot
    By pmreid in forum Using Fedora
    Replies: 0
    Last Post: 21st March 2006, 12:22 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •