systemd/Installing Gnome3 from scratch

From Gentoo Wiki
Jump to:navigation Jump to:search
This page contains changes which are not marked for translation.

Article status
This article has some todo items:
  • Instructions for configuring a static IP
 As of 2019-06-19, the information in this article is probably outdated. You can help the Gentoo community by verifying and updating this article.

To install a desktop environment such as GNOME 3 requires the use of systemd but the present Gentoo Handbook is based on the use of OpenRC. It just indicates that changes have to be made when using systemd but never tells the user where the changes occur.

As for the systemd page, it mainly concentrate on an update starting from an existing system. Thus, it can be a kind of challenge, especially for a new comer to Gentoo, to install a GNOME 3 desktop from scratch. The purpose of this page is to indicate where changes have to be made to the current Gentoo Handbook to do so.

The indications given refer mainly to an amd64 install.

Base system installation

Hereafter are the modifications to bring to the Gentoo Handbook for an amd64 platform.

Part 1 to 5 of the handbook

No changes here.

Installing the Gentoo base system

Choosing the right stage3 tarball

A stage3 tarball already configured for systemd is available for most architectures. You will find it along with the other stage3 tarballs in the autobuilds directory of your preferred mirror. To save time and effort, use this tarball when installing the base system.

Choosing the right profile

root #eselect profile list
Available profile symlink targets:
  [16]  default/linux/amd64/17.1
  [17]  default/linux/amd64/17.1/selinux
  [18]  default/linux/amd64/17.1/hardened
  [19]  default/linux/amd64/17.1/hardened/selinux
  [20]  default/linux/amd64/17.1/desktop
  [21]  default/linux/amd64/17.1/desktop/gnome
  [22]  default/linux/amd64/17.1/desktop/gnome/systemd

Select the profile ending in gnome/systemd:

root #eselect profile set default/linux/amd64/17.1/desktop/gnome/systemd

On the amd64 platform there is also a profile ending in systemd. Select this option if a desktop environment is not required for the system (servers, etc).

An asterisk indicates the currently selected profile. Verify the correct profile has been selected:

root #eselect profile list
Available profile symlink targets:
  [16]  default/linux/amd64/17.1 (stable)
  [17]  default/linux/amd64/17.1/selinux (stable)
  [18]  default/linux/amd64/17.1/hardened (stable)
  [19]  default/linux/amd64/17.1/hardened/selinux (stable)
  [20]  default/linux/amd64/17.1/desktop (stable)
  [21]  default/linux/amd64/17.1/desktop/gnome (stable)
  [22]  default/linux/amd64/17.1/desktop/gnome/systemd *

Updating the system

The choice of the desktop/gnome/systemd profile implies a lot of changes in the packages to be installed, it is advised to perform a full system update before going on:

root #emerge --ask --update --deep --newuse @world

Configuring the kernel

When planning to include support for a graphic card that requires proprietary binary blobs be sure to emerge the sys-kernel/linux-firmware package. Otherwise kernel will not compile.

root #emerge --ask sys-kernel/linux-firmware

May not be necessary at this stage but does not hurt to add the VIDEO_CARDS variable set with an appropriate video card value to /etc/portage/make.conf.

Use option menuconfig with genkernel and optionally lvm and mdadm when using lvm and RAID. Do not forget to install sys-fs/lvm2 and sys-fs/mdadm if this is the case. Please see LVM#Software for details about lvm.

root #emerge --ask sys-fs/lvm2
root #genkernel [--lvm] [--mdadm] --menuconfig all

Select the systemd init system without disabling Openrc

KERNEL Quick setup using gentoo-sources
Gentoo Linux --->
        Support for init systems, system and service managers --->
                [*] systemd

When using lvm activate the following kernel options:

Device Drivers  --->
   Multiple devices driver support (RAID and LVM)  --->
       <*> Device mapper support
           <*> Crypt target support
           <*> Snapshot target
           <*> Mirror target
       <*> Multipath target
           <*> I/O Path Selector based on the number of in-flight I/Os
           <*> I/O Path Selector based on the service time
Not everything needs to be enabled; some of the options are only needed for LVM2 Snapshots and LVM2 Thin Snapshots, LVM2 Mirrors, LVM2 RAID 0/Stripeset and encryption.

Include settings for your graphic card referring to the ad hoc page on this wiki, most currently radeon and nvidia-drivers.

Create the symlink for /etc/mtab (see this for details)

root #ln -sf /proc/self/mounts /etc/mtab

Configuring the system

Defining the keyboard

With systemd, setting keyboard=fr into /etc/conf.d/keymaps will be effectless. Instead, you should set this into /etc/vconsole.conf.

The various keymaps are stored into subdirectories of /usr/share/keymaps/ and can be listed with the following command

root #localectl list-keymaps
When intending to use a very specific keymap (such as the French bepo typematrix keymap) that is not listed here, get it by any way at your disposal in the form of a .gz file, store it on a drive accessible to the system, mount this drive and copy it into one of the subdirectories of /usr/share/keymaps/. Then run the previous command again to make sure it is available.

Once you have you keymap listed, select it with the following command, replacing fr-dvorak-bepo with your own keymap:

root #localectl set-keymap --no-convert fr-dvorak-bepo

Double check by running:

root #cat /etc/vconsole.conf

Installing necessary system tools

System logger

syslog-ng or sysloggd are no longer necessary since Systemd comes with its own journaling functionality. It is possible to skip this section completely. Please, have also a look at the man page of journalctl or at this more readable page on the Arch Linux wiki (and its subsequents links) to know more about the journalctl command that allows you to read the entries of this journal. Nevertheless, the previous loggers can still be used in conjunction with systemd.

syslog-ng conflicts with systemd [1] systemd creates /dev/log as datagram socket [2] [3] so you will need to tell syslog-ng to read from a unix-dgram instead of a unix-stream if you are hitting problems and are using "wrong" stream:

FILE /etc/syslog-ng/syslog-ng.conf

Should be replaced with:

FILE /etc/syslog-ng/syslog-ng.conf

In order to use the syslog-ng service in systemd.

To enable syslog-ng use the following command:

root #systemctl enable syslog-ng

To disable it, use:

root #systemctl disable syslog-ng

Networking tools

dhcpcd will not be started at boot unless you enable dhcpcd.service with systemd.

Refer to the systemd page to know how to do it before rebooting. Otherwise you will be able to do so after boot with:

root #systemctl enable dhcpcd.service
root #systemctl start dhcpcd.service

Installing systemd itself

If you did the full update as advised before systemd should already be installed.
root #emerge --ask sys-apps/systemd
You don't have to add systemd flag to /etc/portage/make.conf as it is already set into the chosen profile.

Configuring the bootloader

If you are using lvm, add the device-mapper USE flag before emerging grub.

After emerging sys-boot/grub, edit the /etc/default/grub configuration file and add the following line (if using ext4 for root partition):

FILE /etc/default/grubExample grub2-mkconfig config for systemd
# Append parameters to the linux kernel command line
GRUB_CMDLINE_LINUX="rootfstype=ext4 real_init=/usr/lib/systemd/systemd dolvm domdadm"
dolvm and domdadm are required only if you are using lvm and raid.

Then run:

root #mkdir /boot/grub
root #grub2-mkconfig -o /boot/grub/grub.cfg

Finalizing the installation

It may be necessary to enable and start dcpcd.service and to use systemd to define keyboard layout (see the systemd page).

X server installation

Install xorg


Don't forget to add the following lines to the /etc/portage/make.conf file:

FILE /etc/portage/make.conf
Replace radeon according to the card brand

Then emerge the drivers:

root #emerge --ask x11-base/xorg-server

Kernel settings

Follow the page X server to set the kernel parameters for evdev and the kernel parameters for your graphic card if not already done. Recompile the kernel

Check startx

In order to check the x server install x11-terms/xterm and x11-terms/twm:

root #emerge --ask x11-terms/xterm x11-wm/twm

Then use the following command:

root #startx

If everything is correct, a graphic page with some terminals inside will appear. Quit by pressing Ctrl+Alt+Del and remove x11-terms/xterm and x11-terms/twm:

root #emerge --ask --depclean --verbose x11-terms/xterm x11-wm/twm

GNOME 3 installation

You are now ready to install GNOME 3:

root #emerge --ask gnome
In my case, to solve a conflict between two versions of openssl one using the bindist USE flag and the other using the -bindist use flag, I had to add the -bindist USE flag to Openssh in /etc/portage/package.use and re-emerge it with --newuse flag before installing GNOME.

In order to have the GNOME Display Manager after boot, enable it:

root #systemctl enable gdm.service

Reboot and enjoy GNOME 3!