User:NeddySeagoon/Raspberry Pi 3 64 bit Desktop

From Gentoo Wiki
Jump to: navigation, search

Introduction

The 64 bit @system install and the odds and ends described in the [Gentoo_Handbook] were fairly straight forward. The only unusual steps were for the kernel, which needed to be cross compiled.

Xorg and Xfce4 described here have been tested by several people and are included is several of the Gentoo images available for 64 bit Raspberry Pi. However, keywording is a work in progress, especially for the plugins.

Users following this guide are encouraged to make use of package.accept_keywords and file pull requests on Github or bugs for adding the ~arm64 keyword after they have built and tested a package.

Important
keywording is an ongoing process. You may not need to keyword things below by the time you follow this guide

While this guide describes Xorg and Xfce4, everyone will want Xorg but the Xfce4 steps are intended to be generic enough to be applied to other lightweight Window Managers.

Wayland users should write their own guide.

Overview

Set up make.conf
Follow 2015-10-22  GCC 5 Defaults to the New C++11 ABI News Item
Install and test xorg-server
Install and test xfce4-meta
Install and test Xfce plugins

Populate package.accept_keywords as you go.

Important
Don't try to build packages from Xfce4

There's just not enough RAM for gcc and Xfce.

Set up make.conf

Choose the desktop profile

root #eselect profile list
root #eselect profile set X

USE flags

USE="arm64 egl gles1 icu minizip openssl pcre16 postproc python 
    qt5 script sqlite svc threads xvmc
    -modemmanager -pam -skia"
# skia wants to link to neon stuff but it doesn't build, in firefox anyway.

CFLAGS

CFLAGS="-march=armv8-a+crc -mtune=cortex-a53 -ftree-vectorize -O2 -pipe -fomit-frame-pointer"
CXXFLAGS="${CFLAGS}"

LINGUAS

L10N="en en-GB"
LINGUAS="en en_GB"
# LINGUAS should be redundant but some overlays may still use it.

Use your language codes here

MAKEOPTS

# we don't have the RAM for -j5 on most things but ...
MAKEOPTS="-j5"
# run package lists for lesser MAKEOPTS in .env

/etc/portage/env/

Global environment override files go here. Feel free to add your own too.

Make the following files.

root #nano -w /etc/portage/env/MAKEOPTS-j1
# use this for things that fail with any parallel make at all
MAKEOPTS="-j1" 
root #nano -w /etc/portage/env/MAKEOPTS-j2
# use this for things that fail at higher parallel makes that -j2
MAKEOPTS="-j2"

Having made some global environment override files they can be used by referring to them in /etc/portage/package.env

/etc/portage/package.env

root #nano -w /etc/portage/package.env
Important
This is an example. Packages listed here way not emerge for other reasons
# app-text/libmwaw loadave gets up to 17! 
app-text/libmwaw MAKEOPTS-j2
dev-libs/boost MAKEOPTS-j2
dev-java/icedtea MAKEOPTS-j2
games-emulation/sdlmame MAKEOPTS-j2
media-tv/kodi MAKEOPTS-j2
mail-client/thunderbird MAKEOPTS-j2
#net-libs/webkit-gtk MAKEOPTS-j2
www-client/chromium MAKEOPTS-j2
# list things that need MAKEOPTS-j1 ... maybe
net-libs/webkit-gtk MAKEOPTS-j1
www-client/firefox MAKEOPTS-j1
# building gcc with USE=gcj needs -j1. Without, -j2 seems to work. 
sys-devel/gcc MAKEOPTS-j1

Its harmless to use the above as a starting point.

Xorg Bits

INPUT_DEVICES="evdev"
# vc4 is very new if it breaks, you can keep the pieces
# fbdev gives us a fallback
VIDEO_CARDS="fbdev vc4"

Warning
During Building Large Packages the Pi may be very slow to respond to the console. Like over 10 minutes slow

The console cursor may stop flashing
The console will not respond to the return key
htop (if its running) may go 10 minutes between updates

The Pi runs short of RAM (swap can't be used for some things) and a lot of tasks get into the ready to run state. As a result, load averages in excess of 17 have been seen, even running with MAKEOPTS="j1".

Do not stop the Pi.

the kernel will invoke the Out Of Memory manager
the kernel will panic
normal service will be resumed

Let the system run overnight.

Upgrade to gcc-5.x

root #emerge gcc -av1

If you want to build icedtea java later, be sure to set the gcj USE flag.

Select gcc-5.x

root #gcc-config -l

Follow the 2015-10-22 GCC 5 Defaults to the New C++11 ABI News Item to update all the installed C++ code to be compatible with the new C++11 ABI

Warning
Your system will be horribly broken if you skip this step

Install and test xorg-server

Its as easy as

root #emerge xorg-server -av


Skip the xorg-server testing step at your own risk but be aware that if Xfce4 won't start, it's likely to be the first thing any helper will ask you to do.


To test run

root #emerge twm xclock xterm -1av

This will install everything that the default startx command needs to start but not list twm xclock and xterm in the world file, so that --depclean can clean them later.

Warning
Never use Xorg and a window manager as root!

If you don't have a normal user, make one now.

Important
Membership of the audio and video groups allows <username> access to the audio and video hardware
root #useradd -m -g users -G wheel,audio,video -s /bin/bash <username>

and set the password for <username>.

root #passwd <username>

Log in at the console as <username>

user $startx

which should show three xterms and an analogue clock

Inspect /var/log/Xorg.0.log, it should include references to vc4 and modeset(0).

[  3572.231] (II) modeset(0): [DRI2]   DRI driver: vc4
[  3572.231] (II) modeset(0): [DRI2]   VDPAU driver: vc4
[  3572.237] (II) AIGLX: Loaded and initialized vc4
...
[  3572.015] (II) modeset(0): glamor initialized
[  3572.015] (II) modeset(0): Output HDMI-1 has no monitor section
[  3572.015] (II) modeset(0): EDID for output HDMI-1
[  3572.015] (II) modeset(0): Printing probed modes for output HDMI-1
[  3572.015] (II) modeset(0): Modeline "1920x1080"x60.0  173.11  1920 2048 2248 2576  1080 1083 1088 1120 -hsync +vsync (67.2 kHz)
[  3572.015] (II) modeset(0): Output HDMI-1 connected
[  3572.015] (II) modeset(0): Using sloppy heuristic for initial modes
[  3572.015] (II) modeset(0): Output HDMI-1 using initial mode 1920x1080 +0+0
[  3572.015] (==) modeset(0): Using gamma correction (1.0, 1.0, 1.0)
[  3572.015] (==) modeset(0): DPI set to (96, 96)

This is not conclusive that hardware acceleration is is use, it can still be blocked by permissions but its very encouraging.

Should you see

(II) FBDEV(0) 

/var/log/Xorg.0.log then the vc4 driver is not in use.

The framebuffer driver works, its just slow, so it can be fixed now or later.

Important
Stop Xorg before emerging more packages

Install and test xfce4-meta

Install and test Xfce plugins