# Wifi not working after fresh install

## qubloo

I just finished an install of gentoo on my Thinkpad T420 and on the livecd I could connect via wireless but for some reason I cant now. 

Network controller: Intel Corporation Centrino Advanced-N 6205 [Taylor Peak] (rev 34)

----------

## qubloo

 *qubloo wrote:*   

> I just finished an install of gentoo on my Thinkpad T420 and on the livecd I could connect via wireless but for some reason I cant now. 
> 
> Network controller: Intel Corporation Centrino Advanced-N 6205 [Taylor Peak] (rev 34)

 

Just went into makeconfig and selected 

<M> Intel Wireless WiFi Next Gen AGN - Wireless-N/Advanced-N/Ultimate-N (iwlwifi) What do i do now?

----------

## NeddySeagoon

qubloo,

Welcome to Gentoo.

You need iwlwifi support in your kernel. Make it a module.

Your WiFi card needs firmware. That's provided by linux-firmware

Lastly, you need wpa-supplicant to deal with the WiFi crypto.

If you have all those bits installed, what does 

```
ifconfig -a
```

say about your WiFi interface?

wpa-supplicant needs a configuration file before it will connect.

-- edit --

You rebuild and reinstall your kernel, then boot into the new kernel.

When you do that, run 

```
uname -a
```

The time/date shown is the build time of the runnning kernel.

If its not nowish, you are not running the kernel you think you are.

-- edid 2 --

Added wiki link.

----------

## qubloo

 *NeddySeagoon wrote:*   

> qubloo,
> 
> Welcome to Gentoo.
> 
> You need iwlwifi support in your kernel. Make it a module.
> ...

 

Thanks for the help, I just recently made the jump to gentoo from ubuntu so how would i rebuild and reinstall the kernel like what are the commands, sorry if i am lacking in expertise

----------

## NeddySeagoon

qubloo,

How did you build and install your kernel the first time?

There are several ways.  Do that again.

If you used genkernel, you need to add the -menuconfig option because it will use its own .config, not yours.

I've added a link to the iwlwifi wiki page to my original post.

----------

## qubloo

 *NeddySeagoon wrote:*   

> qubloo,
> 
> How did you build and install your kernel the first time?
> 
> There are several ways.  Do that again.
> ...

 

Ok I did all of that successfully but when i got to the emerge —ask net-wireless/iw net-wireless/wpa_supplicant part, it said “It might be possible to solve this slot collision by applying all the following changes:

- dev-libs/openssl-1.1.1i (Change USE: +bindist)

-net-wireless/wpa_supplicant-2.9-r2 (change USE: +bindist)

How do i fix this?

----------

## NeddySeagoon

qubloo,

Please post the output of 

```
emerge --info
```

.

USE=bindist sanitises packages so that they can be distributed as binaries without potentially infringing licences, copyright or patents.

When the stage3 that you started from was made, it used USE=bindist to keep it legal.

Unfortunately, it removes so things from openssl. Openssl and  the things than use it all need to be built with the same bindist setting.

The output of emerge --info will show all of your global settiings so we can check a few things.

----------

## qubloo

 *NeddySeagoon wrote:*   

> qubloo,
> 
> Please post the output of 
> 
> ```
> ...

 

https://imgur.com/a/xb7wtaK

I dont know how to just copy paste it here since I don’t have a connection

----------

## NeddySeagoon

qubloo,

To copy/paste here you save things to a file with the > symbol. Like command > /output.txt

The you reboot to the liveCD and mount your root filesystem at /mnt/gentoo,

The file you need to post is at  /mnt/gentoo/output.txt

I think the liveCD has wgetpaste, so 

```
wgetpaste /mnt/gentoo/output.txt
```

will put the file onto a pastebin site.

Then you post the link.

I would like to have seen your profile but no matter. USE flag settings are in alphabetical order and bindist is not listed, which is correct.

I think you have skipped the handbook step that asks you to do 

```
emerge -uDNav @world
```

 to make all your new USE flags take effect.

Its going to be a while.

Gentoo isn't really a distro like other distros. All Gentoo is is the portage package manager and the ::gentoo ebuild respository.

Everything else is UPSTREAM. This means that you don't install Gentoo, you use the tools that Gentoo provides to design and install your own distro.

That's why there is a steep learning curve. You get to make all the decisions that binary distros have made for you.

e.g. With Ubuntu, you install libreoffice and everyone has the same install. On Gentoo, that are over 1,000,000 ways to configure libreoffice. Pick one. If you don't like it, pick another and rebuild it.

No two Gentoo installs are the same.

----------

## qubloo

 *NeddySeagoon wrote:*   

> qubloo,
> 
> To copy/paste here you save things to a file with the > symbol. Like command > /output.txt
> 
> The you reboot to the liveCD and mount your root filesystem at /mnt/gentoo,
> ...

 

Here it is! https://dpaste.com/HCQBZGQ9Q now should i do that emerge -uDNav command?

----------

## NeddySeagoon

qubloo,

Your profile is set to 

```
default/linux/amd64/17.1/desktop
```

When you do that 

```
emerge -uDNav @world
```

its going to build a lot of stuff towards your GUI due to the USE flags the in your profile.

If you change the profile to 

```
default/linux/amd64/17.1
```

without the desktop then the emerge @world will build a lot less but sone of the things that get built will be rebuilt what fou revert the profile. Its up to you.

```
emerge -uDNav @world
```

 is going to fetch a lot of source code from the internet, so it needs a working network connection.

You will need to do it booted from the liveCD and chrooted. 

From your USE flags, you have 

```
VIDEO_CARDS="amdgpu fbdev intel nouveau radeon radeonsi vesa dummy v4l"
```

You don't have all those video cards in your system so you are not really ready to install bits of a GUI. There is more configuration required first.

On that basis, you should set your profile to default/linux/amd64/17.1, do the 

```
emerge -uDNav @world
```

 then make Wifi work before you think about your GUI.

Gentoo works best whe you add a bit and test, add a bit a test. Then when (not if) it breaks, you can go back to something that worked.

This is my last post before I sleep. Goodnight.

----------

## qubloo

 *NeddySeagoon wrote:*   

> qubloo,
> 
> Your profile is set to 
> 
> ```
> ...

 

Thanks for the advice! Now i am trying to get my wifi working. When i try to do emerge -a dhcpcd wpa_supplicant I get a failed to emerge dev-python/m2crypto. Here is the log: https://dpaste.com/2T9SEPBGK and here is my emerge -pv @world: https://dpaste.com/2CRTE6LN8

----------

## NeddySeagoon

qubloo,

Your 

```
emerge -pv @world
```

 looks a bit odd. 

I was expecting some rebuilds with changed USE flags. In particular, packages that USE bindist.

The should have a green -bindist*  to highlight that the USE flag has changed.

The command I suggested was 

```
emerge -uDNav @world
```

which does more than emerge @world.

Read 

```
man emerge
```

 and find out what  -uDNav means.

While you are reading, check the -U option too.

The 

```
[ebuild   R    ]
```

 part of the output is useful foo. That's explained in the man page.

If you are new to man pages, you should be aware of the search function.

Press / and enter some text to find the next occurrence.  'Page' is a bit of a misnomer, some man pages are as big as books.

You won't break anything by doing 

```
emerge -uDNav @world
```

. the -a is like -p. Portage calculates what to do, shows the result and waits for your confirmation.

You can always say, "No, don't do that". The advantage is if you go ahead, the dependency tree does not have to be recalculated.

That may not matter to you yet but on a Raspberry Pi 4 with KDE installed, it takes several hours to calculate the dependency tree.

As you install more packages, so it takes longer.

----------

## qubloo

 *NeddySeagoon wrote:*   

> qubloo,
> 
> Your 
> 
> ```
> ...

 

When I did emerge -uDNav @world it failed and said ERROR: dev-python/cryptography-3.2.1::gentoo failed (compile phase) Here is the package settings that it said for me to post for support. https://dpaste.com/7CB5KQHW5

----------

## DespLock

Hi qubloo, 

i can't find any error message in your log files. Make sure you have logging enabled in your /etc/portage/make.conf like, p. e.:

```

# Turn on logging

PORTAGE_ELOG_CLASSES="info warn error log qa"

# Echo messages after emerge, also save to /var/log/portage/elog

PORTAGE_ELOG_SYSTEM="echo save"

# Ensure elogs saved in category subdirectories.

# Build binary packages as a byproduct of each emerge, a useful backup.

FEATURES="split-elog buildpkg"

```

You can read more about it in 

https://wiki.gentoo.org/wiki/Portage_log

https://wiki.gentoo.org/wiki//etc/portage/make.conf

After setting up logging as you wish to, you need to find out why the package dev-python/m2crypto is needed and why the build failed (maybe it's just a use flag which can be disabled). 

I'm using equery for that personally. It is part of app-portage/gentoolkit. The result of

"equery d dev-python/m2crypto"

```

 * These packages depend on dev-python/m2crypto:

net-wireless/crda-4.14 (dev-python/m2crypto) [...]

```

OK, so we need dev-python/m2crypto for net-wireless/crda. 

That package is required to tell your wifi which channles, power output and other stuff is allowed/used in your country (mandatory).

read more: https://wireless.wiki.kernel.org/en/developers/Regulatory

Next let's check the use flags "emerge -vp net-wireless/crda" for that package:

Result for me:

```

These are the packages that would be merged, in order:

Calculating dependencies... done!

[ebuild   R    ] net-wireless/crda-4.14::gentoo  USE="-gcrypt -libressl" 0 KiB

```

No use flag which might be disabled, so we need a better log to view what is happening behind the scene (see above).

After setting up the log as you wish you should run 

```

emerge -av dev-python/m2crypto (or emerge --ask --verbose dev-python/m2crypto)

```

And look at the results of that emerge:

1) copy and paste the output from the console to dpaste

2) copy the log file to dpaste. If you haven't change the logging example above, you'll find the log in "/var/log/portage/elog/dev-python/" and it's called "m2crypto-...."

----------

## qubloo

 *DespLock wrote:*   

> Hi qubloo, 
> 
> i can't find any error message in your log files. Make sure you have logging enabled in your /etc/portage/make.conf like, p. e.:
> 
> ```
> ...

 

I setup logging in make.conf and when i did emerge -vp net-wireless/crda it says “/etc/portage/make.conf”, line 29: Invalid token ‘PORTAGE_ELOG_SYSTEM’ (not ‘=‘)

----------

## NeddySeagoon

qubloo,

We need the build log too. When a build fails, you get a message about ... for your convenience the build log is located at ....

Put that file onto a pastebin. Its probably too big for a post. wgetpaste is your friend.

----------

## qubloo

 *NeddySeagoon wrote:*   

> qubloo,
> 
> We need the build log too. When a build fails, you get a message about ... for your convenience the build log is located at ....
> 
> Put that file onto a pastebin. Its probably too big for a post. wgetpaste is your friend.

 

Build log for which command? emerge -vp net-wireless/crda doesnt say anything else other than that invalid token thing.

----------

## NeddySeagoon

qubloo,

```
“/etc/portage/make.conf”, line 29: Invalid token ‘PORTAGE_ELOG_SYSTEM’ (not ‘=‘)
```

You have a typo around line 29.

I have 

```
PORTAGE_ELOG_CLASSES="info warn error log qa"

PORT_LOGDIR=/var/log/portage/ 
```

----------

## qubloo

 *NeddySeagoon wrote:*   

> qubloo,
> 
> ```
> “/etc/portage/make.conf”, line 29: Invalid token ‘PORTAGE_ELOG_SYSTEM’ (not ‘=‘)
> ```
> ...

 

Okay I think that worked but now I get an error on line 31: Invalid Token ‘FEATURES’ (not ‘=‘) Here is a photo for reference: https://imgur.com/a/hhXZTFw While browsing the internet for answers i stumbled upon a reddit thread with a similar thinkpad model having issues with the network card wlp3s0: https://www.reddit.com/r/Gentoo/comments/40k9k1/wifi_woes_on_thinkpad_x220/

----------

## NeddySeagoon

qubloo,

I suspect your uncommented line  /var/log/portage/elog is causing problems.

Is split-elog a valid feature?

----------

## qubloo

 *NeddySeagoon wrote:*   

> qubloo,
> 
> I suspect your uncommented line  /var/log/portage/elog is causing problems.
> 
> Is split-elog a valid feature?

 

What does this mean? and how would i make it so?

----------

## NeddySeagoon

qubloo,

I've learned something today. Thank you.

```
              split-elog

                     Store logs created by PORTAGE_ELOG_SYSTEM="save" in category subdirectories of  PORTAGE_LOGDIR/elog,

                     instead of using PORTAGE_LOGDIR/elog directly.
```

So your FEATURES are good.

You have 

```
/var/log/portage/elog
```

on a line on its own, close to the bottom of make.conf.

It looks like it should be a part of the comment above it.

Change it to 

```
# /var/log/portage/elog
```

so it becomes a comment.

----------

## DespLock

```

/var/log/portage/elog

```

That line is 3 lines above FEATURES and needs to be a comment or deleted.

Just a typo, because you have PORT_LOGDIR above that line alreeady.

----------

## qubloo

 *NeddySeagoon wrote:*   

> qubloo,
> 
> I've learned something today. Thank you.
> 
> ```
> ...

 

Here is the new make.conf: https://imgur.com/a/krTrqA7 Everything is good now but for except when I do emerge -uDNav @world it fails and also when I do emerge —ask —verbose dev-python/m2crypto it too fails. ERROR: dev-python/m2crypto-0.36.0-r1::gentoo failed (compile phase) I think i need to downgrade something or if its openssl

----------

## NeddySeagoon

qubloo,

We need the build log for dev-python/m2crypto-0.36.0-r1 to determine why it failed.

It will be in /var/log/portage/dev-python....

Tab completion is a wonderful thing.

Type 

```
ls /var/log/portage/dev-pyth
```

and press the tab key.

If there is only a single choice, bash will fill it in.

If not either type some more letters and press tab again on press tab twice in quick succession. bash will show you a list of potential completions.

Put the entire file onto a pastebin site.

----------

## qubloo

 *NeddySeagoon wrote:*   

> qubloo,
> 
> We need the build log for dev-python/m2crypto-0.36.0-r1 to determine why it failed.
> 
> It will be in /var/log/portage/dev-python....
> ...

 

Here is the log: https://dpaste.com/84NV2EC9G

----------

## DespLock

 *Quote:*   

> 
> 
> ImportError: libexpat.so.1: cannot open shared object file: No such file or directory
> 
> 

 

Is python installed? 

```

eselect python list

```

 *Quote:*   

> 
> 
> emerge -vp python
> 
> These are the packages that would be merged, in order:
> ...

 

The use flag "xml" would pull in  dev-libs/expat

or try 

```

emerge -av1 dev-libs/expat

```

and then m2crypto again.Last edited by DespLock on Mon Jan 11, 2021 9:21 pm; edited 1 time in total

----------

## qubloo

 *DespLock wrote:*   

>  *Quote:*   
> 
> ImportError: libexpat.so.1: cannot open shared object file: No such file or directory
> 
>  
> ...

 

Python 3.8 and python 3.9 (fallback) is installed. Now emerge —ask —verbose dev-python/m2crypto works. Thanks for the help!

----------

## NeddySeagoon

qubloo,

```
ImportError: libexpat.so.1: cannot open shared object file: No such file or directory
```

That's the error.

I think you have found a bug in Gentoo. Here is the test.

Your system is missing libexpat.so.1. Its provided by dev-libs/expat

```
$ equery b libexpat.so.1

 * Searching for libexpat.so.1 ... 

dev-libs/expat-2.2.10 (/usr/lib64/libexpat.so.1 -> libexpat.so.1.6.12)
```

Do 

```
emerge -1av dev-libs/expat
```

to get the missing library.

The -1 means --oneshot ... do not record it in the world file.

Now do the 

```
emerge -uDNav @world
```

again.

Heres the bug ...

If dev-python/m2crypto builds now, the ebuild has a dependency on dev-libs/expat, so the problem is Gentoos, not yours.

Once you have done the test, you can report it at bugs.gentoo.org and it will be fixed for everyone.

The -1 on dev-libs/expat is a problem as portage won't know dev-libs/expat is needed, until you either install a fixed dev-python/m2crypto or you install another packages that depends on  dev-libs/expat.  The alternative is to allow dev-libs/expat to be recorded in world.

----------

## qubloo

 *NeddySeagoon wrote:*   

> qubloo,
> 
> ```
> ImportError: libexpat.so.1: cannot open shared object file: No such file or directory
> ```
> ...

 

For sure! I got wpa supplicant emerged now and I recompiled my kernel, how do i copy the new kernel to /boot? (the new one has iwlwifi modules) I did make && make modules_install and it says Kernel: arch/x86/boot/bzImage is ready (#3)

----------

## NeddySeagoon

qubloo,

```
mount /boot

cp arch/x86/boot/bzImage /boot/...
```

You may need to to tell the boot loader about the new kernel.

if you have an initrd, that will need to be rebuilt too.

File that bug so dev-python/m2crypto gets fixed too.

----------

## DespLock

 *Quote:*   

> 
> 
> For sure! I got wpa supplicant emerged now and I recompiled my kernel, how do i copy the new kernel to /boot? (the new one has iwlwifi modules) I did make && make modules_install and it says Kernel: arch/x86/boot/bzImage is ready (#3)
> 
> 

 

You can also use "make install", but make sure /boot is mounted.

After that you need grub to know about the kernel.Last edited by DespLock on Mon Jan 11, 2021 10:41 pm; edited 1 time in total

----------

## qubloo

 *NeddySeagoon wrote:*   

> qubloo,
> 
> ```
> mount /boot
> 
> ...

 

I filed the bug to gentoo bug wranglers already  :Smile:  How would i load a new bz image in rEFInd?

----------

## NeddySeagoon

qubloo,

Just as you did when you set up rEFInd with your first kernel.

I've not used rEFInd yet. My systems all use grub legacy and BIOS booting.

----------

## qubloo

 *NeddySeagoon wrote:*   

> qubloo,
> 
> Just as you did when you set up rEFInd with your first kernel.
> 
> I've not used rEFInd yet. My systems all use grub legacy and BIOS booting.

 

YESSSS!! Thanks everyone for the help, i finally got wifi up and running! I guess this is the learning curve for gentoo and i learned a lot from this.   :Very Happy:  Time to install xfce

----------

## DespLock

Good to hear! 

You should read further on the bug tracker.

setuptools are used by gentoo/portage and they have a pre-requirement: 

>PYTHON_REQ_USE="xml(+)"

https://gitweb.gentoo.org/repo/gentoo.git/tree/dev-python/setuptools/setuptools-50.3.0.ebuild

So there has to be a reason why dev-libs/expat hasn't been emerged on your system. And that might influence your use of gentoo for other packages too in unexpected ways.

----------

## NeddySeagoon

DespLock,

That means that expat should have been installed.

----------

## DespLock

Yes, 

the python use flag "xml" is a requirement for setuptools, so it needs to be installed for them to work properly. And therefore expat would have been installed too automatically. 

The fact that it is missing means, that his system has some unusual configuration (or is in an inconsistent state) which might (or might not) result in further problems.

----------

## NeddySeagoon

DespLock,

I'm sure (s)he will be back anyway :)

----------

