Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
First time using custom kernel, iwlwifi modules not loading
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware
View previous topic :: View next topic  
Author Message
CarterCox
n00b
n00b


Joined: 28 Jan 2018
Posts: 34

PostPosted: Sat Apr 21, 2018 4:36 am    Post subject: First time using custom kernel, iwlwifi modules not loading Reply with quote

Hi again! So this is the first time I manually configured the kernel instead of using genkernel all. The thing is, I'm getting some errors that don't allow my wireless adapter to show up. So here is my dmesg:

https://pastebin.com/hJiucSzw

Maybe the relevant parts:

Code:
[    0.684478][    0.684640] iwlwifi 0000:02:00.0: can't disable ASPM; OS doesn't have ASPM control
[    0.684898] iwlwifi 0000:02:00.0: Direct firmware load for iwlwifi-5000-5.ucode failed with error -2
[    0.684919] iwlwifi 0000:02:00.0: Direct firmware load for iwlwifi-5000-4.ucode failed with error -2
[    0.684937] iwlwifi 0000:02:00.0: Direct firmware load for iwlwifi-5000-3.ucode failed with error -2
[    0.684954] iwlwifi 0000:02:00.0: Direct firmware load for iwlwifi-5000-2.ucode failed with error -2
[    0.684970] iwlwifi 0000:02:00.0: Direct firmware load for iwlwifi-5000-1.ucode failed with error -2
[    0.684979] iwlwifi 0000:02:00.0: no suitable firmware found!


I am 100% sure I enabled the appropriate items during configuration (not as modules but built-in). I also installed "linux-firmware".

Any ideas? I appreciate all the help!
Back to top
View user's profile Send private message
peje
Tux's lil' helper
Tux's lil' helper


Joined: 11 Jan 2003
Posts: 100

PostPosted: Sat Apr 21, 2018 4:56 am    Post subject: Reply with quote

Hi CarterCox, you need the firmware for your wifi card, it should be in /lib/firmware.
Some of the firmware files are avaible in portage.
sys-firmware/iwl6050-ucode
cu Peje
Back to top
View user's profile Send private message
CarterCox
n00b
n00b


Joined: 28 Jan 2018
Posts: 34

PostPosted: Sat Apr 21, 2018 5:01 am    Post subject: Reply with quote

Hi peje, thanks for the answer. Two questions:

  • How do I use this firmware
  • Why does using "genkernel all" solve it? What should I change in my kernel configuration to achieve this?
Back to top
View user's profile Send private message
khayyam
Watchman
Watchman


Joined: 07 Jun 2012
Posts: 6227
Location: Room 101

PostPosted: Sat Apr 21, 2018 11:36 am    Post subject: Reply with quote

CarterCox wrote:
How do I use this firmware

CarterCox ... you don't, the driver/module will.

CarterCox wrote:
Why does using "genkernel all" solve it? What should I change in my kernel configuration to achieve this?

Because iwlwifi is built as a module when using genkernel but you've made it "built-in". If you want iwlwifi as a builtin then you need to supply the firmware in CONFIG_EXTRA_FIRMWARE.

best ... khay
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 54244
Location: 56N 3W

PostPosted: Sat Apr 21, 2018 2:53 pm    Post subject: Reply with quote

CarterCox,

To generalise what khayyam said, any kernel module that loads firmware does it when the module is initialised.
Therefore the firmware must be available at that time.

When the kernel module is configured as <M>, root will be mounted before the module is initialised, therefore the firmware can be read from the root filesystem.
Usually /lib/fimware.

With the kernel module configured as <*>, the code is loaded by the boot loader and initialised before root is mounted so /lib/fimware cannot be read.
You must include all required firmware in the kernel binary. When you do this, /lib/fimware is read at kernel build time.

Check your dmesg. Your error
Code:
 [    0.684979] iwlwifi 0000:02:00.0: no suitable firmware found!
will be before root is mounted.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
Hu
Moderator
Moderator


Joined: 06 Mar 2007
Posts: 21635

PostPosted: Sat Apr 21, 2018 2:57 pm    Post subject: Reply with quote

The driver will automatically seek and use the firmware when the driver initializes. If the driver is builtin, it initializes very early, before your root filesystem is available. If the driver is a module stored on the root filesystem, it necessarily cannot be loaded nor initialized until the root filesystem is available. In the former case, installing sys-kernel/linux-firmware is necessary to enable you to fix the problem, but is insufficient because the firmware is installed on the filesystem, and is therefore not yet available when a builtin driver initializes. As khayyam suggests, a common solution (and the easiest solution, though not the only solution) is to use CONFIG_EXTRA_FIRMWARE to embed at compile time a copy of the required firmware in the kernel. Such embedded firmware is then available before the root filesystem mounts, so the driver can find and use that firmware even before root is available. As an alternative, you could go back to building iwlwifi as a module. According to khayyam, whom I have no reason to doubt, though I've not checked this personally, genkernel made iwlwifi a module. You could choose to make it a module in your hand-configured kernel, independent of using genkernel.
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 54244
Location: 56N 3W

PostPosted: Sat Apr 21, 2018 3:03 pm    Post subject: Reply with quote

Hu,

Genkernel makes a fully modular kernel. You get every module known to Linus :)
Well, the ISA modules are not built ... but they could be.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
CarterCox
n00b
n00b


Joined: 28 Jan 2018
Posts: 34

PostPosted: Sat Apr 21, 2018 6:52 pm    Post subject: Reply with quote

Ok guys. Thanks for all the good information. It has beemn very helpful. However, I think the problem was something else. I had followed the wiki article: https://wiki.gentoo.org/wiki/Iwlwifi#When_using_built-in_configuration and always forgot to run "make install" after re-building the kernel, so all my changes were useless. Very dumb, I know.

Nevertheless it was an enlightening thread. Thanks again!

By the way, an off-topic question. The remnants of the old kernel are still in my /boot partition. Should I jsut manually erase them if I don't need them anymore? Should I do something else to completely get rid of it?
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 54244
Location: 56N 3W

PostPosted: Sat Apr 21, 2018 6:59 pm    Post subject: Reply with quote

CarterCox,

Kernel bits and pieces get installed to /boot and to /lib/modules

I tend to keep 3 or 4 kernels in /boot and listed in the grub menu but rarely clean out /lib/modules.
I only have about 12 modules though.

I'm not aware of a tool to clean out old kernels but there may well be one.

Old kernels includes their matching initrd.
Off topic but related. If you don't put kernel modules in your initrd, it becomes kernel agnostic, so no need to rebuild it every kernel update.

-- edit --

Code:
$ uname -a
Linux NeddySeagoon_Static 4.16.0-rc3 #1 SMP PREEMPT Tue Feb 27 20:01:09 GMT 2018 x86_64 AMD Phenom(tm) II X6 1090T Processor AuthenticAMD GNU/Linux


The date and time in uname -a is the build date and time of the running kernel, so its a good test to do after you think you just rebooted into a new kernel.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
khayyam
Watchman
Watchman


Joined: 07 Jun 2012
Posts: 6227
Location: Room 101

PostPosted: Sat Apr 21, 2018 7:44 pm    Post subject: Reply with quote

NeddySeagoon wrote:
I'm not aware of a tool to clean out old kernels but there may well be one.

NeddySeagoon, CarterCox, et al ... there was some discussion of such a tool in a recent thread, but note, read carefully Hu's caveats in the script he provided before using/adapting such a tool.

best ... khay
Back to top
View user's profile Send private message
CarterCox
n00b
n00b


Joined: 28 Jan 2018
Posts: 34

PostPosted: Sun Apr 22, 2018 12:34 am    Post subject: Reply with quote

Interesting! This was a good learning experience. Thanks a lot!
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum