User:Jens3/Installing Gentoo on a Raspberry Pi 400

Installing Gentoo on a Raspberry Pi 400
This is work in progress and has not been finished!


 * Hardware: Raspberry Pi 400 with a 64GB microSD card with A1 standard
 * From Handbook:Main_Page "Note: The arm and arm64 architectures are supported by the Gentoo project but do not yet have Handbooks at their disposal. Please refer to the ARM project and |bug #534376 for more information.
 * since there is no handbook for installing Gentoo on Arm 64, I took the AMD64 handbook
 * base system: Raspberry Pi OS 64bit beta works so far (WiP), optional mirrorselect is missing; gentoo root is in a 20 GB loopback mounted file
 * make.conf: COMMON_FLAGS="-Os -pipe -mcpu=native"
 * profile-config set 2 (default/linux/arm64/17.0/desktop (stable)) brings a loop dependency with harfbuzz. The loop dependecy is documented in use.local.desc: "media-libs/freetype:harfbuzz - Use media-libs/harfbuzz for auto-hinting OpenType fonts. WARNING: may trigger circular dependencies!". I then used profile 1.
 * /etc/portage/make.conf: MAKEOPTS="-j1" because otherwise compiling gcc leaves the computer unuseable for two hours
 * gcc didn't get compiled, error was: "{standard input}: Assembler messages: \n {standard input}:2669550: Warning: end of file not at end of a line; newline inserted \n xg++: fatal error: Killed signal terminated program cc1plus" in the irc I got the information, that is was an OOM
 * Retrying with 16G of swap and stopping firefox and thunderbird. Raspberry Pi OS has just a 100MB swap file as default. Compiling worked.
 * echo sys-kernel/raspberrypi-sources ~arm64 >> /etc/portage/packages.accept_keywords ; emerge -va raspberrypi-sources
 * emerge -va raspberrypi-firmware raspberrypi-image
 * Raspberry Pi4 64 Bit Install
 * https://packages.gentoo.org/packages/sys-kernel/raspberrypi-sources
 * Raspberry Pi 3 64 bit Install
 * emerge -va rpi-eeprom
 * cd /usr/src/linux; make bcm2711_defconfig
 * make menuconfig # I changed:
 * Compiler optimization level to -Os
 * Default CPUfreq governor to ondemand
 * added some crypto algos as modules that are (maybe) supported by the cpu
 * make all
 * added CPU_FLAGS_ARM="edsp neon thumb vfp vfpv3 vfpv4 vfp-d32 crc32 v4 v5 v6 v7 v8 thumb2" to /etc/portage/make.conf . They were reported by cpuid2cpuflags, seeCPU FLAGS X86 for details.

Links

 * Raspberry Pi/Quick Install Guide
 * https://github.com/sakaki-/gentoo-on-rpi-64bit