# Wifi card problem

## RIA77

Hello, and thank you for your help.

wlan0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500

inet 192.168.1.126 netmask 255.255.255.0 broadcast 192.168.1.255

ether 7a:f3:b9:10:ff:66 txqueuelen 1000 (Ethernet)

RX packets 874 bytes 496435 (484.7 KiB)

RX errors 0 dropped 0 overruns 0 frame 0

TX packets 833 bytes 134580 (131.4 KiB)

TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

Internet is working in chroot as it should.

btrtl 16384 1 btusb

bluetooth 647168 26 btrtl,btintel,btbcm,bnep,btusb

----------

## RIA77

My card is 

Intel Corporation Centrino Wireless-N 2230 (rev c4)

How can I install drivers into kernel ?

----------

## Romanticio

 *Quote:*   

> Symbol: IWLWIFI [=n] 
> 
> Type  : tristate
> 
> Defined at drivers/net/wireless/intel/iwlwifi/Kconfig:2 
> ...

 

In the Warning above, you will also need to ensure one of either IWLDVM or IWLMVM is also enabled, in kernel menuconfig you can hit the / key to enter search mode, plug in IWLDVM and hit enter to get a link to that setting which can be found hitting the number key shown next to the setting you want to change (it's just under the iwlwifi setting). If using menuconfig, make use of the help link on any page to get more information, like the need to also install firmware. Since wireless is one of the last hardware items enabled in the boot process, there should be no need to include the firmware in the kernel or initramfs, nor do you need to have the driver built into the kernel, it is better enabled as a module.

Intel Wireless WiFi Link Next-Gen AGN  

This option enables support for use with the following hardware:  

        Intel Wireless WiFi Link 6250AGN Adapter 

        Intel 6000 Series Wi-Fi Adapters (6200AGN and 6300AGN) 

        Intel WiFi Link 1000BGN 

        Intel Wireless WiFi 5150AGN

        Intel Wireless WiFi 5100AGN, 5300AGN, and 5350AGN 

        Intel 6005 Series Wi-Fi Adapters 

        Intel 6030 Series Wi-Fi Adapters 

        Intel Wireless WiFi Link 6150BGN 2 Adapter 

        Intel 100 Series Wi-Fi Adapters (100BGN and 130BGN) 

        Intel 2000 Series Wi-Fi Adapters 

        Intel 7260 Wi-Fi Adapter 

        Intel 3160 Wi-Fi Adapter  

        Intel 7265 Wi-Fi Adapter 

        Intel 8260 Wi-Fi Adapter

        Intel 3165 Wi-Fi Adapter

----------

## RIA77

My driver is loaded as module, but I can't find any network, and it seems that Gentoo is not detecting wifi at all.

 Found IWLDVM in kernel.

----------

## RIA77

Maybe it's related to problems with wifi.

 I can't login into Gentoo as a root.

 I can log into terminal, but I can't log into system.

 Driver for wifi is loaded, tried with lspci (as non-root).

 But, when I execute lspci as a root in terminal, there's no any otput ?

 Thank you.

----------

## Romanticio

 *RIA77 wrote:*   

> Maybe it's related to problems with wifi.
> 
>  I can't login into Gentoo as a root.
> 
>  I can log into terminal, but I can't log into system.
> ...

 

During installation while working from the installer CD you should have created your root user by simply changing password which sets the root password for the installed Gentoo. Assuming you did that, I'm guessing your user is not in the wheel group. The wheel group allows the user to switch user to root. Below is all the groups my user belongs to.

 *Quote:*   

> jo@hot ~ $ groups
> 
> lp wheel cdrom video usb users lpadmin systemd-journal portage plugdev scanner

 

An example below showing how to add a user to a group and second example shows how to remove a user from a group. It assumes the user name is yo.

```
gpasswd -a yo wheel

gpasswd -d yo wheel
```

----------

## RIA77

Thank you. I recompiled kernel, but system is not recognizing my wifi card.

I have added user to wheel group, can't login as a root.

Can't mount NTFS partitions.

----------

## RIA77

Installed genkernel, genkernel all.

 No changes for me.

 Thank you.

----------

## The Doctor

Install gentoo-firmware 99% of all wireless cards require this, but I don't recall any warnings to this widely distrbuted.

----------

## RIA77

You mean linux-firmware ? Which package ?

----------

## NeddySeagoon

RIA77,

See the Wiki for your wifi.

Its linux-firmware.

Install all of linux-firmware, its about 750Mb. You need not keep it all as once its installed, you get a configuration file.

Edit that to remove the things you don't want.

Subsequent builds will follow that file. Then one day you will need a new firmware file ...

----------

## RIA77

XFCE is not recognizing my wifi adapter, and it's not recognizing external TP link wifi card.

 Installed linux-firmware-20210315, no changes at all. Thank you.

----------

## NeddySeagoon

RIA77,

XFCE is not involved. 

Its the kernel, firmware, userspace tools and the configuration that you provide.

If your wifi is not listed in 

```
ifconfig -a
```

The problem space is limited to the kernel and firmware.

Until that much works, the userspace tools and the configuration cannot be used, so don't matter much.

In your Gentoo, save the following to files be doing the following commands as root.

```
dmesg > /dmsg.txt

lspci -nnk > /lspci.txt

ls -l /boot > /boot_not_mounted.txt

mount boot

uname -a > /uname.txt

ls -l /boot > /boot_mounted.txt
```

Once you have internet connectivity, use wgetpaste to put those files onto a pasetbin site and post the links.

Also pastebin your kernel .config, its at /usr/src/linux/.config

When did you last build your kernel?

----------

## RIA77

I build gentoo kernel few days ago. 

 *Quote:*   

> wlan0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
> 
>         inet 192.168.1.121  netmask 255.255.255.0  broadcast 192.168.1.255
> 
>         ether aa:98:0a:8e:b7:43  txqueuelen 1000  (Ethernet)
> ...

 

 *Quote:*   

> lspci -nnk > /lspci.txt
> 
> lspci: Unable to load libkmod resources: error -2

 

I only have root partition, not boot in fstab.

 *Quote:*   

> mount root
> 
> mount: root: can't find in /etc/fstab.
> 
> 

 

----------

## NeddySeagoon

RIA77,

Post the output of 

```
fdisk -l
```

. You need to be root.

Do you BIOS or EUFI boot?

I still need those pastebins I asked for to be able to help you.

----------

## RIA77

Thank you. Now i can restart and poweroff.

 *Quote:*   

> Disk /dev/sda: 931.51 GiB, 1000204886016 bytes, 1953525168 sectors
> 
> Disk model: ST1000LM014-1EJ1
> 
> Units: sectors of 1 * 512 = 512 bytes
> ...

 

I use bios boot.

 Gentoo is located on sda 9.Last edited by RIA77 on Mon Apr 05, 2021 5:04 pm; edited 1 time in total

----------

## RIA77

wgetpaste /usr/src/linux/.config

http://dpaste.com/8P45ZHN7K

----------

## NeddySeagoon

RIA77,

Do not enable any DEBUG option in your kernel. DEBUGFS is OK.

DEBUG options are for kernel maintainers and are allowed to prevent normal operation of the code being debugged.

They must be off.

We still need  

```
dmesg > /dmsg.txt

lspci -nnk > /lspci.txt

uname -a > /uname.txt

ls -l /boot > /boot_mounted.txt
```

----------

## RIA77

Thank you. I don't know why it's enabled. I don't remember I enabled it.

 *Quote:*   

> devuan / # lspci -nnk > /lspci.txt
> 
> lspci: Unable to load libkmod resources: error -2
> 
> 

 

 I chrooted into Gentoo, and there is no any otput regarding

dmesg > /dmsg.txt

uname -a > /uname.txt

ls -l /boot > /boot_mounted.txt

----------

## RIA77

Should we try lan connection ? I need wifi connection, but maybe lan will work ?

----------

## Romanticio

 *Quote:*   

> dmesg > /dmsg.txt
> 
> lspci -nnk > /lspci.txt
> 
> uname -a > /uname.txt
> ...

 

Remove the forward slash in the commands for them to work, see example below:

 *Quote:*   

> jo@hot~ $ lspci -nnk > /lspci.txt 
> 
> bash: /lspci.txt: Permission denied
> 
> jo@hot~ $ lspci -nnk > lspci.txt 
> ...

 

----------

## NeddySeagoon

RIA77, 

The no output is correct. You will have 3 files in the chroot called /dmsg.txt,  /lspci.txt  and /boot_mounted.txt.

From outside the chroot they will be at /mnt/gentoo once your root is mounted.

We need the diagnostic information when your gentoo is running, not from a chroot.

Run your gentoo, when wifi does not work.

Save the files.

Boot your devuan. Mount you gentoo, then pastebin the files.

We can use a wired LAN to fix wifi too. It will avoid lots of chrootts to pastebin data like this.

----------

## RIA77

wgetpaste boot_mounted.txt  

Your paste can be seen here: http://dpaste.com/CZALTRRAR

wgetpaste dmsg.txt

Your paste can be seen here: http://dpaste.com/GBECBV86W

wgetpaste lspci.txt  

Your paste can be seen here: http://dpaste.com/7TBDVNJAL

----------

## RIA77

Wgetpaste uname does not work.

 *NeddySeagoon wrote:*   

> 
> 
> We can use a wired LAN to fix wifi too. It will avoid lots of chrootts to pastebin data like this.

 

Tried with lan, but system does not recognize any connection.

----------

## NeddySeagoon

RIA77,

Your wired and wireless interfaces are 

```
07:00.0 Ethernet controller [0200]: Qualcomm Atheros QCA8171 Gigabit Ethernet [1969:10a1] (rev 10)

   Subsystem: Lenovo QCA8171 Gigabit Ethernet [17aa:3800]

08:00.0 Network controller [0280]: Intel Corporation Centrino Wireless-N 2230 [8086:0888] (rev c4)

   Subsystem: Intel Corporation Centrino Wireless-N 2230 BGN [8086:4262]
```

Neither of them have any kernel drivers loaded.

Your boot_mounted.txt shows that you have two kernels. One dated Apr  3 15:04, the other Apr  4 10:03.

dmesg says 

```
[    0.000000] Linux version 5.11.11-gentoo (root@devuan) (gcc (Gentoo Hardened 10.2.0-r5 p6) 10.2.0, GNU ld (Gentoo 2.35.2 p1) 2.35.2) #3 SMP Sun Apr 4 10:03:08 -00 2021
```

so you are running the newest kernel. That's good.

Putting 1969:10a1 Linux pci into a search engine, gives cateee.net as the first hit. It shows that the kernel option you need is CONFIG_ALX.

Your kernel .config pastebin shows 

```
CONFIG_ALX=m
```

so the code is built as a loadable module. 

Boot your gentoo. As root, run 

```
modprobe alx
```

that should load the driver for your wired interface.

```
lsmod
```

should show the module loaded, unless there was an error.

Now we need to start the interface.

To find its name, look in 

```
ifconfig -a
```

Pass the name to 

```
dhcpcd <if_name>
```

which should make wired networking work until you dhcp lease expires.

Run the command again to get a new lease.

Doing a similar search for 8086:0888 Linux pci tells that you need CONFIG_WLAN_VENDOR_INTEL in the kernel.

```
CONFIG_WLAN_VENDOR_INTEL=y
```

Its there too. However, its a menu item. So more is needed.

This Debian Wiki page says that its iwlwifi. You have 

```
CONFIG_IWLWIFI=m
```

dmesg says 

```
[    0.829787] Intel(R) Wireless WiFi driver for Linux

[    0.829903] iwlwifi 0000:08:00.0: can't disable ASPM; OS doesn't have ASPM control

[    0.830143] iwlwifi 0000:08:00.0: Direct firmware load for iwlwifi-2030-6.ucode failed with error -2

[    0.830152] iwlwifi 0000:08:00.0: Direct firmware load for iwlwifi-2030-5.ucode failed with error -2

[    0.830154] iwlwifi 0000:08:00.0: no suitable firmware found!

[    0.830155] iwlwifi 0000:08:00.0: minimum version required: iwlwifi-2030-5

[    0.830156] iwlwifi 0000:08:00.0: maximum version supported: iwlwifi-2030-6

[    0.830157] iwlwifi 0000:08:00.0: check git://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git
```

So it cannot find the fimware. 

Root is mounted here

```
[    2.454586] EXT4-fs (sda9): mounted filesystem with ordered data mode. Opts: (null). Quota mode: none.

[    2.458519] VFS: Mounted root (ext4 filesystem) readonly on device 8:9.
```

So the firmmare must be in the initrd or it will not be found.

You need linux-firmware to provide the fimware, then it needs to be included in the initrd so that iwlwifi can find it.

```
[    9.360400] EXT4-fs (sda9): re-mounted. Opts: (null). Quota mode: none.
```

 Is root being mounted read/write.

How you include firmware in the initrd dependn on how you make the kernel and initrd.

There is no sign of any attempt to start your ethernet.

```
[    0.876447] snd_hda_intel 0000:01:00.1: no codecs found!

[    0.881865] hdaudio hdaudioC1D0: Unable to bind the codec
```

tells that there is a problem with sound too.

Lets make the wired network work first, then use that to fix wifi and sound.

----------

## RIA77

Fatal error, alx not found.

----------

## NeddySeagoon

RIA77,

Either you are not running the kernel that belongs to the .config you posted or the 

```
make modules_install
```

part of the kernel build process was skipped.

How do you configure and make your kernel?

----------

## RIA77

make -j4 && make modules_install install

----------

## NeddySeagoon

RIA77,

That's good. If the kernel name changes, update grub.cfg.

This may be a long shot but if your clock has ever stepped backwards, make can get confused and skip things that need to be compiled.

To test that, start a kernel build with 

```
make clean
```

Then there is nothing left to confuse make.

You will need to remake the initrd too as it may have modules missing. While you are remaking the initrd, you may as well include the firmware for your wifif card too.

With the new kernel and initrd in place, reboot into it then

```
modprobe alx
```

should work, or even not be needed.

----------

## RIA77

Should I rebuild initrd before kernel or after ? And how to rebuild initrd ?

----------

## NeddySeagoon

RIA77,

The initrd contains kernel modules, so it must be rebuilt after the kernel.

You have two initrd files already. How did you make them?

----------

## RIA77

Probably with genkernel. Should I use genkernel again ?

----------

