Load module on boot

I know this question might be asked before but I could not find it. I want module brcmfmac to start on boot before GUI starts. So how do I load modules on boot? Currently I have to do modprobe every time I boot. Writing a script and crontab seems silly to me since there is a way in distros like Ubuntu to do it without using scripts.

Thanks in advance!!!

https://wiki.archlinux.org/index.php/Kernel_module#Automatic_module_handling

TSU

:S Ok is there udev rule or some other way. This one is old school way of doing this and my module-load.d is empty and bunch of modules are getting loaded on boot.

Hi,

That Arch wiki is pretty straight forward imho since i already did something like what you’re asking.
First create a file name after your module and add an extension .conf

printf '%s
' '# Load brcmfmac at boot' 'brcmfmac' > /tmp/brcmfmac.conf

Check what is in that file

cat /tmp/brcmfmac.conf

The output should be something like

# Load brcmfmac at boot
brcmfmac

Now as root copy or move that file in the directory **/etc/modules-load.d/ **

cp -v /tmp/brcmfmac.conf /etc/modules-load.d

The output should be something like

'/tmp/brcmfmac.conf' -> '/etc/modules-load.d/brcmfmac.conf'

Check that file in ‘’/etc/modules-load.d/brcmfmac.conf

cat /etc/modules-load.d/brcmfmac.conf 

The output should be something the same as above

# Load brcmfmac at boot
brcmfmac

Are we talking about a laptop and Networkmanager?
Are you sure the module isn’t loaded?

If this is a desktop machine using wicked for networking, you can use YaST to activate the device on boot.

Because of the module,
It’s highly likely this is a RPi (I don’t know if any other hardware would use this module).
It’s my impression that things load differently on a RPi and as the Wiki article describes can be done based simply upon detection of supported hardware.

(Some Speculating)
TSU

Thanks @TSU but this is not working :frowning: I still have to manually do modrobe brcmfmac after login.

This is desktop with wireless card (ASUS PCE-AC88)

Yes, here is proof output of lspci -nnv before modprobe brcmfmac


07:00.0 Network controller [0280]: Broadcom Limited Device [14e4:43c3] (rev 04)
        Subsystem: ASUSTeK Computer Inc. Device [1043:86fb]
        Flags: bus master, fast devsel, latency 0, IRQ 41
        Memory at f7000000 (64-bit, non-prefetchable) [size=32]
        Memory at f6800000 (64-bit, non-prefetchable) [size=8]
        Memory at f2400000 (64-bit, prefetchable) [size=4]
        Capabilities: [48] Power Management version 3
        Capabilities: [58] MSI: Enable+ Count=1/32 Maskable- 64bit+
        Capabilities: [68] Vendor Specific Information: Len=44 <?>
        Capabilities: [ac] Express Endpoint, MSI 00
        Capabilities: [100] Advanced Error Reporting
        Capabilities: [13c] Device Serial Number 00-00-00-ff-ff-00-00-00
        Capabilities: [150] Power Budgeting <?>
        Capabilities: [160] Virtual Channel
        Capabilities: [1b0] Latency Tolerance Reporting
        Capabilities: [220] #15
        Kernel modules: brcmfmac

and after


07:00.0 Network controller [0280]: Broadcom Limited Device [14e4:43c3] (rev 04)
        Subsystem: ASUSTeK Computer Inc. Device [1043:86fb]
        Flags: bus master, fast devsel, latency 0, IRQ 41
        Memory at f7000000 (64-bit, non-prefetchable) [size=32]
        Memory at f6800000 (64-bit, non-prefetchable) [size=8]
        Memory at f2400000 (64-bit, prefetchable) [size=4]
        Capabilities: [48] Power Management version 3
        Capabilities: [58] MSI: Enable+ Count=1/32 Maskable- 64bit+
        Capabilities: [68] Vendor Specific Information: Len=44 <?>
        Capabilities: [ac] Express Endpoint, MSI 00
        Capabilities: [100] Advanced Error Reporting
        Capabilities: [13c] Device Serial Number 00-00-00-ff-ff-00-00-00
        Capabilities: [150] Power Budgeting <?>
        Capabilities: [160] Virtual Channel
        Capabilities: [1b0] Latency Tolerance Reporting
        Capabilities: [220] #15
**        Kernel driver in use: brcmfmac**[/size][/size][/size][/size][/size]
        Kernel modules: brcmfmac

note the bold line is missing from previous snippet.

I would rather learn command line way, since it might be applicable to other distros.[/size]

I did exact thing but using sudo vim and saving it as brcmfmac.conf. Thanks for your help.

If you’ve created exactly what @jetchisel described and it’s not working,
Then IMO next step is to inspect your bootlog and look for all entries related to your module…
= If the module is not mentioned at all
= If there is an attempt to load the module but results in a failure.

You should be able to write the previous bootlog to a file with the following, and then you can perform actions on the content of file. Name your file whatever you’d loke

journalctl -b -1 > bootlog_last_boot.txt

If you can’t or don’t know how to analyze your bootlog, post it to a pastebin and post the link to that pastebin so someone else can look at it.

TSU

:frowning: WOW what the heck, it was blacklisted in 50-blacklist.conf. I do not know if it was done by broacom-wl or something before that, that that was the problem. As a side not broadcom-wl also creates file called 50-brcmfmac.conf in modprobe.d directory that does the same thing and I thought I got rid of blacklist, but apparently no.

So you can close this thread.