User:Vaukai/Wireless networking at first boot

From Gentoo Wiki
Jump to:navigation Jump to:search
Resources

Some deviations from the handbook are needed to enable wireless networking from the first reboot after installation. eiwd will be installed to act as network manager and network supplicant.

Preconditions

  • Computer needs to have a wireless device known to work
  • Known ESSID and Passphrase (psk) of the network

Device driver and firmware

While configuring the Linux kernel, the necessary device drivers need to be enabled as modules (<M>) and in case the driver needs firmware the sys-kernel/linux-firmware package should be installed.

Network manager

While configuring the system, from the section Host and domain information only the first step (setting the hostname hostname="tux") should be applied.
The sections Configuring the network and Automatically start networking at boot will be skipped and the upcoming eiwd will be installed instead of netifrc.

To avoid netifrc to get pulled in, the USE flag needs to be disabled:

FILE /etc/portage/package.use
sys-apps/openrc -netifrc

On next recompilation of openrc then netifrc should disappear:

root #emerge --ask --newuse --oneshot sys-apps/openrc
root #emerge --ask --verbose --depclean net-misc/netifrc

Since eiwd at the time of writing is available only in the guru ebuild repository this repository needs to be added.

FILE /etc/portage/repos.conf
# created by eselect-repo

[guru]
location = /var/db/repos/guru
sync-type = git
sync-uri = https://github.com/gentoo-mirror/guru.git

After syncing with guru the package can be installed:

root #emaint sync -r guru
root #emerge --ask net-wireless/eiwd net-dns/openresolv

For authentication with the network, a configuration file named after the ESSID is needed to hold the passphrase (psk).

FILE /var/lib/iwd/larry.psk
[Security]
Passphrase=1cf8302b0374f7d5242c6ce839b56bc23a9a6c6d33c2538ea34f91050702c917

The filename must be identical with the network name and the suffix with the network type. Passphrase= is the same as psk= known from wpa_supplicant but without quotation.

Finally eiwd will be added to the default runlevel:

root #rc-update add iwd default

Continue from the Handbook

The installation according to the handbook should continue starting from The hosts file.

Troubleshooting

  • eiwd crashes when rfkill is touched but it can be restarted rc-service iwd restart. The bug is located upstream in src/wiphy.c.

External resources