User:Jens3/Installing Gentoo on a Raspberry Pi 400

Second try

 * Downloaded [gentoo-on-rpi-64bit 1.6.0 full]( https://github.com/sakaki-/gentoo-on-rpi-64bit/releases/download/v1.6.0/genpi64.img.xz ) [asc](https://github.com/sakaki-/gentoo-on-rpi-64bit/releases/download/v1.6.0/genpi64.img.xz.asc)
 * 1) xzcat genpi64.img.xz > /dev/sdX && sync

The Rpi 400 doesn't boot the image but shuts down immediately. I copied bcm2711-rpi-400.dtb to the boot dir, but it didn't change anything. I copied from a /boot First try below /boot/start* /boot/fixup* to the /boot and gentoo started, but got stuck at "switching off virutalization kvm". After rebooting the system started.

I copied the dir /lib/firmware/brcm and rebooted.

emerge --sync ; emerge -uvaDN @world gives several problems.

I tried to upgrade the packages one by one, until I realized, with help from #gentoo-arm, that the /etc/portage/repos.conf/gentoo.conf uses isshoni.org as source, which doesn't get any updates any more.

First try
Somewhere at installing X I got stuck and this will not be 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.
 * emerge -va wpa_supplicant # broadcom-sta is the "wl" driver for (older?) broadcom chips.
 * Partitioning the 1TB SSD (Raspberry Pi 3 64 bit Install)
 * Partition size id Type mount
 * sda1 256M c W95 FAT32 (LBA) /boot
 * sda2 other 5 extended -
 * sda5 8G 82 swap swap
 * sda6 100G 83 Linux /
 * sda7 823G 83 Linux /data

/boot/cmdline.txt
This file will not exist until its created. Create it with the following content.
 * emerge xorg-x11

Links

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