systemd/Installing Gnome3 from scratch

From Gentoo Wiki
Jump to: navigation, 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:
  [1]   default/linux/amd64/13.0
  [2]   default/linux/amd64/13.0/selinux
  [3]   default/linux/amd64/13.0/desktop
  [4]   default/linux/amd64/13.0/desktop/gnome
  [5]   default/linux/amd64/13.0/desktop/gnome/systemd 
  [6]   default/linux/amd64/13.0/desktop/kde
  [7]   default/linux/amd64/13.0/desktop/kde/systemd
  [8]   default/linux/amd64/13.0/developer
  [9]   default/linux/amd64/13.0/no-multilib
  [10]  default/linux/amd64/13.0/x32
  [11]  hardened/linux/amd64
  [12]  hardened/linux/amd64/selinux
  [13]  hardened/linux/amd64/no-multilib
  [14]  hardened/linux/amd64/no-multilib/selinux
  [15]  hardened/linux/amd64/x32
  [16]  hardened/linux/uclibc/amd64

Select the profile ending in gnome/systemd:

root #eselect profile set default/linux/amd64/13.0/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:
  [1]   default/linux/amd64/13.0
  [2]   default/linux/amd64/13.0/selinux
  [3]   default/linux/amd64/13.0/desktop
  [4]   default/linux/amd64/13.0/desktop/gnome
  [5]   default/linux/amd64/13.0/desktop/gnome/systemd *
  [6]   default/linux/amd64/13.0/desktop/kde
  [7]   default/linux/amd64/13.0/desktop/kde/systemd
  [8]   default/linux/amd64/13.0/developer
  [9]   default/linux/amd64/13.0/no-multilib
  [10]  default/linux/amd64/13.0/x32
  [11]  hardened/linux/amd64
  [12]  hardened/linux/amd64/selinux
  [13]  hardened/linux/amd64/no-multilib
  [14]  hardened/linux/amd64/no-multilib/selinux
  [15]  hardened/linux/amd64/x32
  [16]  hardened/linux/uclibc/amd64

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

Do not install sys-kernel/genkernel when using systemd, use sys-kernel/genkernel-next instead:

root #emerge --ask sys-kernel/genkernel-next
Note
If your are using raid for your partitions, don't forget to add the dmraid USE flag while emerging sys-kernel/genkernel-next.

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 --->
                [*]Openrc 
                [*] systemd

When using lvm activate the following kernel options:

KERNEL
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
Note
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
Note
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

Note
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
unix-stream('/dev/log');

Should be replaced with:

FILE /etc/syslog-ng/syslog-ng.conf
unix-dgram('/dev/log');

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

Note
If you did the full update as advised before systemd should already be installed.
root #emerge --ask sys-apps/systemd
Note
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"
Note
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

/etc/portage/make.conf

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

FILE /etc/portage/make.conf
VIDEO_CARDS="radeon"
Note
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
Note
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 !