Chrooting
You should be able to boot the minimal livecd, mount your Gentoo installation in its current state, and chroot in. From this livecd-based networking-enabled chroot, you should be able to emerge
and configure any packages necessary for your install to access the network. To achieve this, you basically follow the procedures listed in the Gentoo Handbook , selectively skipping steps that would overwrite/format/delete your existing installation. So, to get started,
- Boot the livecd.
- If necessary, configure it to be able to access the
internet.
- Mount the partitions you configured (“Mounting”), starting with mounting your root on
/mnt/gentoo
. E.g., # mount /dev/sda1 /mnt/gentoo
in most common setups if your root partition is your first partition (some setups might have the first partition to be /boot
, you want the /
partition, not the /boot
one in this step).
chroot
into it (“Chrooting”). At the simplest, this might look like # cd /mnt/gentoo; cp /etc/resolv.conf etc/; mount none -t proc proc; mount --rbind /sys sys; mount --rbind /dev dev; chroot .
. The results in a shell which is just like you had booted up your computer without the livecd but with networking magically working (because we made it inherit the network configuration from the livecd). Don’t forget that you need to chroot manually from each individual VT shell that you want to use while configuring your Gentoo on hard disk.
- Install the necessary tools, make the necessary kernel configuration changes (if necessary), etc. through the chroot onto your computer so that it is capable of networking by itself.
Kernel
This last step is the hard part. If you used genkernel
to configure your kernel, everything should, for the most part, “just work”. Your kernel is probably configured correctly if you can see something that looks like a wireless device in the output of either ifconfig -a
, ip link
, or iwconfig
. If you are not using genkernel
, you probably missed the driver in make menuconfig
and should configure and recompile your kernel. I again recommend to follow the Handbook here, but the following is my best memory as to how this might go:
- As root, visit your kernel’s source directory. Most probably,
# cd /usr/src/linux
.
- Run
# make menuconfig
.
- Ensure that the necessary drivers and correct general wireless subsystem support is enabled.
- Under
Networking support
→ Wireless
→ cfg80211
(CONFIG_CFG80211
)
- Under
Device drivers
→ Network device support
→ Wireless LAN
is the most likely place you’ll find your specific device. If you don’t know which driver to choose, check the output of # lspci
or, on the livecd, see if any of the loaded kernel modules (output of # lsmod
) appear to be wifi-related.
- Exit from menuconfig, being sure to save the configuration when prompted.
- Run
# make && make modules_install
.
- Ensure that
/boot
is mounted (if you have a separate /boot
partition configured). If booted from disk, # mount /boot
should work.
- Copy
arch/x86/boot/bzImage
(yes, use x86
even if you’re on amd64
. For other arches, the procedure at this point is probably different) over your existing image in /boot
. If necessary, run any magic commands related to your bootloader (if using GRUB, just popping the kernel into place and possibly editing grub.conf
(unsure about grub-2*) should be enough).
- Reboot cleanly.
Userspace
If you think your wireless interface shows up in ifconfig -a
or ip link
, you probably are just missing the necessary userspace utilities and configuration to get networking to start up by itself. “Installing Necessary Tools: Networking Tools” gets you started. But it sounds like you need wireless userspace tools which are not directly mentioned in that section but discussed under “Wireless Networking”. But you might instead want to install something like kde-misc/networkmanagement
which is a NetworkManager integrated into KDE. This might (I don’t use KDE/haven’t tested) automatically ensure that networkmanager is running once you log into your KDE session and should automatically pull in any necessary wifi-supportive packages. If you go this route, you will end up with a NetworkManager instance which will automatically manage launching the necessary wifi tools/supplicant—I think you shouldn’t need to touch wpa_supplicant.conf
yourself in this situation. Or if you want to have iwconfig
available on your system, install net-wireless/wireless-tools
. If you want to manually configure access to wifi networks secured with modern (WPA/WPA2) technology through the CLI (without NetworkManager), you will need to directly install net-wireless/wpa_supplicant
, add your networks to /etc/wpa_supplicant/wpa_supplicant.conf
, create the appropriate symlink to net.lo
in /etc/init.d
named net.<wifi iface>
where <wifi iface>
is the wireless interface’s name as seen in # ifconfig -a
, and configure the interface to initialize at boot time with # rc-update add net.<wifi iface> default
(this might not work if you are using systemd and assumes you are using openrc).
One note on installing KDE: selecting a KDE portage profile through # eselect profile set default/linux/amd64/13.0/desktop/kde
(you may be running an arch other than amd64
) is not enough to actually get KDE installed. It just sets USE
flags and other values so that, when you install packages, you get the KDE/Qt variants and avoid Gnome/GTK+ somewhat. To install KDE, you should install either kde-meta
(more packages) or kdebase-meta
(fewer packages, should install much faster), and you might do this while still running on the livecd chroot if you want KDE to be there when you reboot from your hard disk. You could also install the KDE frontend to networkmanager, kde-misc/networkmanagement
, at the same time. But, be warned: depending on your hardware and other factors, it will take a while. The following will install the more minimal starting KDE install and the KDE-integrated NetworkManager:
# emerge -va kdebase-meta kde-misc/networkmanagement
Synopsis
But, to sum up, you need to configure critical things like network access while still running from the livecd. Installing the necessary network support packages works much better when there is a working internet connection over which their sources can be downloaded. And once your Gentoo install has what it needs to internet, you can try booting from disk and see if that was enough. You may find yourself booting the livecd and chrooting in again (and, regardless, being familiar with how to do this can be very handy!). Sorry for the condensed answer, but this is quite broad and, really, exactly how to configure wireless and use KDE is up to you to a point.
1Alright so
KDE
is not installed by default, it just changes USE flags so it is a smooth transition. Yes I setup wireless on the livecd, but I though I could just pull the configuration over inconf
files. Anyway I will do as you said and emerge the required packages. Thanks. – Stevie G – 2014-03-27T06:55:59.5871How do you make kernel changes, I don't remember if I installed wireless, as when I iwconfig it says no extensions found. o I have to rebuild the kernel / recomplie? – Stevie G – 2014-03-29T10:27:43.123
@StevieG, If you used
genkernel
to compile/configure your wireless device, it should “just work”. The only other thing I can think of is that perhaps some firmware package specific to your wireless card is necessary. But, that error message from iwconfig does mean your kernel is missing the driver (or, perhaps, the driver was missing the firmware necessary to initialize). You can runlspci
(perhaps from the livecd) or, from the livecd, examine the output oflsmod
to try to see which drivers the livecd is using to help you configure your on-disk kernel. – binki – 2014-03-29T18:52:15.360I’ve added a section attempting to summarize how to reconfigure the kernel. – binki – 2014-03-29T19:27:18.690
@StevieG:
iwconfig
and wireless extensions are totally obsolete by today's standard, as they do not even support 802.11n properly, let alone 802.11ac. Useiw
instead. The kernel option to enable wext hackward compatibility (it is such an horror that it lies most of the time) is CONFIG_CFG80211_WEXT and is disabled by default. Keep it disabled and forget aboutiwconfig
. All other tools moved to the newernl80211
kernel API. – BatchyX – 2014-03-29T20:18:58.5071I started KDE and logged in as non-root user (I was previously logining in as root and then
startx
) and then the wirelessjust worked
. However I feel I failed at connecting wifi viacli
. I was able to connect with ethernet atcli
usingdhcpcd <interface>
yet I failed with wireless and was left somewhat disconcerted. – Stevie G – 2014-03-30T18:17:59.1001When I configure wifi via CLI, I configure
wpa_supplicant.conf
as root directly and initialize it through/etc/init.d/net.<wifi iface>
. When starting the init.d script, it should give some message about howwpa_supplicant
was launched but the script can’t wait for the interface to come up because it doesn’t know when it’ll actually get connected to the network. This works poorly in real mobile use with configuring new nets on the fly. If having it working under KDE is sufficient, I’d just be happy with that as a manually-configuredwpa_supplicant
would conflict with KDE/networkmanager. – binki – 2014-03-30T20:34:49.603