A noobs guide to installing Gentoo on a core i5 2500K part3 – Applications

So, what applications do I need. I think a lot.
I will start with a www-browser, and will install firefox.

In the Xfce guide, they simply say run the following command:
emerge --ask www-client/firefox
I tried that, and first ran into the message:
The following REQUIRED_USE flag constraints are unsatisfied:
cpu_flags_x86_sse? ( cpu-flags_x86_mmxext )

After searching, I found out, I needed to add the flag mmxext in the /etc/portage/make.conf file in the variable CPU_FLAGS_X86.
After this, there was another error message:
The following USE changes are necessary to proceed:
(see "package.use" in the portage(5) man page for more details)
# required by www-client/firefox-45.4.0::gentoo
# required by www-client/firefox (argument)
>=dev-lang/python-2.7.10-r1:2.7 sqlite

I used dispatch-conf to merge the files. (simply press ‘m’ to look at how the file looks after dispat-conf has merged it and use update (‘u’), to use the file it has merged).
After the use-files had been merged, firefox could be emerged.

I have not quite gotten the hang of searching with emerge --search yet. You search for a regexp, like apt-cache search. But, if there are many matches, you have to scroll back in the terminal with , or pipe the output through less.

A noobs guide to installing Gentoo on a core i5 2500K part2

So, now I have a bootable system, but starting in text mode is not very useful for normal day activity, so I continued following the guides final steps creating a user.

Then I emerged app-editors/vim (I really missed vim in the chroot system) and sys-apps/etckeeper to keep track of my changes in /etc.

Next is to install a desktop environment. I’m choosing XFCE, so I followed the guide here.

Using the instructions to start xfce didn’t work though, because I have apparently not installed xorg yet. I found the Gentoo guide for Xorg here. There, I determined that I need to find out the video card. I have a built in intel graphics card I am using. I found the Gentoo guide for this.
I added the debug and dri USE flags in /etc/portage/make.conf.

!!!Note:I later found out, that the USE flags are optional, and that you should choose the ones you want. So debug was really not useful for me, because all packages were recompiled with that flag.

There are some USE flags that are not showing in emerge --info that I added:
dri3 sna uxa xvmc
I added this line in the /etc/portage/package.use/intel:
x11-drivers/xf86-video-intel dri3 sna uxa xvmc
After running the command
emerge --ask --changed-use --deep @world
During that, I ran into some strange error complaining about “econf failed” and perl module not being found. From this forum question, I tried the solution perl-cleaner --all, and that did the trick.
I added my user to the video group.
I chose the classical way of configuring Xorg, and emerged the x11-drivers/xf86-video-intel package.
Now, startx works, and starts xfce4, as specified in the file ~/.xinitrc.

Next, I also want a login manager. So I installed slim according to the instructions in the Xfce guide.
When logging in, it didn’t work though. Only an empty black screen was displayed. I looked at the log in /var/log/slim.log/ and saw some complaints about dbus not running. So I looked in the Slim guide, and added dbus to the default run level with the command:
rc-update add dbus default
Now, I can log in and it starts up the Xfce-environment.
But, the keyboard layout is default, and I want a Swedish dvorak layout, so I searched and found this thread saying that you need to configure that in Xorg. I looked in the Xorg wiki and added the file /etc/X11/xorg.conf.d/00-keyboard.conf with the content
Section "InputClass"
Identifier "system-keyboard"
MatchIsKeyboard "on"
Option "XkbLayout" "se"
Option "XkbModel" "kinesis"
Option "XkbVariant" "dvorak"
EndSection

Now, it works like a charm.
Next stop is installing some useful programs, like a web browser. I will cover this in the next part of my journey.

A noobs guide to installing Gentoo on a core i5 2500K part1

I think I heard about Gentoo first about 8 years ago, and maybe I should have had time to check it out before. I have used linux since 2006/2007, starting off with Ubuntu, since it was easy, and then switching to Debian around 2010-2011. Since Debian is moving to systemd, and I am not convinced about that, I should try out some other distributions. Time has come to test Gentoo. I tried installing it to a virtual machine on my workstation first, and I think I will be able to pull this off.

Hardware:All of my hardware is from 2011 or older.

CPU:Intel Core i5 2500K
Motherboard:Asus P8H61-M EVO

I will install it on a spare hard-drive, and will probably let it live parallel to my main Debian Jessie system, not even configuring the main boot-loader to have an option to start Gentoo, instead be forced to manually change the boot device to boot from the Gentoo disk. We will see what I am capable of doing before growing tired.

I will be following this guide:https://wiki.gentoo.org/wiki/Handbook:AMD64/Full/Installation

I have verified the installation medium on my Debian system, and burned a CD.

Network configuration: I have a local dhcp server running, so the network was configured automatically.

Partitioning the disks. I will try out using UEFI, since my motherboard seems to have that option.

I have three hard drives in my current system
/dev/sda - storage
/dev/sdb - Debian system
/dev/sdc - I will install to this disk

Partitions:
/dev/sdc1 - Bios boot partition
/dev/sdc2 - boot 300MB
/dev/sdc3 - swap 12GB (2*RAM)
/dev/sdc4 - root 50GB
/dev/sdc5 - home 50GB (may use the home from my Debian system later /dev/sdb6)

I used gparted to create my partition table.

Now create file systems.

I will use vfat for boot, ext4 for root and home partitions.

Then just mount the partitions on the mount points:
mount /dev/sdc4 /mnt/gentoo
mkdir /mnt/gentoo/boot
mount /dev/sdc2 /mnt/gentoo/boot
mkdir /mnt/gentoo/home
mount /dev/sdc5 /mnt/gentoo/home

Now, it is time to download the stage3-file. I downloaded the stage3-amd64-20161020.tar.bz2 file, since my installation medium was downloaded from here. I think it might be safest to not mix them, which means my installation medium will be useless in a couple of weeks.

I extracted the stage file.

Next stop, compile options. This is a bit exciting, since it will be the first kernel I compile.

I’m using the options stated in the handbook, and use MAKEOPTS="-j5", since I have 4 CPU-cores.

Configure repos as the hand book does.

Mount necessary file systems for chroot and chroot to the new system.

Install the portage snapshot and read the news items.

I set my profile to /default/linux/amd64/13.0/desktop.

Then I updated the world set. This took a long time, since I had 172 packages to emerge.

I configured time zone and locale.

Then I downloaded the kernel sources using the command in the hand book.

Now it is time to manually configure the kernel.

In menuconfig, I enabled EFI stub support under Processor type and features -----> and USB Serial Converter Support -----> in Device Drivers ----> / USB Support ----> since I got a USB serial converter I would like to use (maybe this is unimportant).

Note that you need to use a medium booted using EFI to be able to install grub in EFI-mode. Thus, using the minimal cd is not possible. Either use one of the live-cd or live-dvd, or use system rescue cd afterwards to install grub.

I compiled and installed the kernel.

Now configure the mount points in fstab. I am using the following:
<fs> <mountpoint> <type> <opts> <dump/pass>
/dev/sdc2 /boot vfat noauto,noatime 1 2
/dev/sdc4 / ext4 noatime 0 1
/dev/sdc5 /home ext4 noatime 0 1
/dev/sdc3 none swap sw 0 0

Options and dump/pass were taken from default values in the file from the stage3 file.

Then I configured host name and dns network.

Then, I configured the local wired ethernet to use dhcp in /etc/conf.d/net:

config_enp4s0="dhcp"

I created a symlink to this device and added it to the default runlevel.

I created a password for root.

Then, I edited /etc/conf.d/keymaps to use the "dvorak-sv-a1" keymap.

I installed sysklogd as system logger. Then I installed cron.

I installed e2fsprogs and dosfstools.

Then I installed dhclient.

I updated the make.conf to have EFI support, and then installed grub2 boot loader.

Next, I installed grub using the EFI instructions and generated a configuration.
Now it is time to reboot and see if it works.
When umounting the /mnt/gentoo/sys file system, it complained that it couldn’t. Strange.
Booting doesn’t seem to work =(.
Maybe my motherboard doesn’t support UEFI after all, but it says so in the specifications. Trying to “Launch EFI Shell from filesystem device” when having sdc as boot device reports “Not found”. So maybe something with the installation has failed. Maybe the hard drive has to be connected to one of the first SATA ports? No, it is not that.
So investigate further tomorrow.
So, continuing. I have booted the live cd again, and chrooted into my install. This time, I will verify the files generated by grub. First, I read the “Important” note in the handbook – “Make sure /boot is mounted before running the grub-install command”. I checked, and my /boot wasn’t mounted in my chrooted system, even though I did mount it before chrooting. Strange.
Running the grub install command for efi:
grub-install --target=x86_64-efi --efi-directory=/boot
I got the error message:
Installing for x86_64-efi platform.
efibootmgr: EFI variables are not supported on this system.
efibootmgr: EFI variables are not supported on this system.
Installation finished. No error reported.

Searching for this term lead to this thread. I think my cd was not started in EFI-mode, because it is the minimal install cd. The fallback instructions in the second answer says you should copy the grubx64.efi file from /boot/efi, but my installation only has a /boot/EFI folder, so I will test if it boots, then resort to other measures listed there.
When I the exit the chroot, I notice that the boot partition has two entries in mount. Strange. Unmounting /boot does remove one entry. One entry is still listed. Trying to unmount again fails – Strange.
Booting didn’t work. So, now I will copy the grubx64.efi file to the location specified in the forum answer. That didn’t work either.
I think I will fall back to normal mbr next time I try it.
I have created a systemrescuecd(download, and booted it in EFI-mode.
I tried the instructions in this link, but the efivars file system type wasn’t found.
I exited the chroot, looked at the kernel modules, then chrooted back again, and this time, the command
grub-install --target=x86_64-efi --efi-directory=/boot
worked. Strange. Now reboot and try it. It didn’t work. Next reboot, without choosing boot medium, it booted. Hooray. Maybe because choosing the hard drive as boot medium will boot non UEFI. I should choose the name of OS instead (It showed up as “Gentoo” in the menu).
Next is to install desktop environment etc. I will create a new post for that part.
But, no network card seems to be detected. Maybe I need to enable some modules in the kernel configuration.
So, reconfigure the kernel then.
I checked my network interfaces before on my running debian system, and found out that I have a Realtek RTL8111/8168B as a wired ethernet interface. So I enabled
Device Drivers -> Network device support -> Ethernet driver support “Realtek devices” in the kernel (*) and “Realtek 8169 gigabit ethernet support” in the kernel (*).
I have also a wireless interface which is a Atheros Wireless 802.11n. So I enabled Device Drivers -> Network device support -> Wireless LAN -> Atheros Wireless Cards and enabled the Atheros 802.11n wireless card support with all the sub options.
That did the trick for the wired ethernet at least. Will try the wireless when I have a desktop to start.