Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Questions about Gentoo (or GenPi64) @ Raspberry Pi 5
View unanswered posts
View posts from last 24 hours

Goto page 1, 2  Next  
Reply to topic    Gentoo Forums Forum Index Gentoo on ARM
View previous topic :: View next topic  
Author Message
Gladdle
Guru
Guru


Joined: 27 Jul 2008
Posts: 313
Location: Cleebronn, Germany

PostPosted: Thu Oct 19, 2023 1:37 pm    Post subject: Questions about Gentoo (or GenPi64) @ Raspberry Pi 5 Reply with quote

Hi there, my Raspberry Pi 4 is broken, the network adapter is (physically) dead. So i want to have the new Raspberry Pi 5 in the next few days, but i have serval questions about installing Gentoo on that. I only want to have a home Server without a monitor, so the HDMI and graphic chip doesn't matter for me! Gentoo is fast as hell and i love this distribution so i want to have it on my home server.

NeddySeagoon wrote:
There is no 32 bit to 64 bit upgrade path. It's a reinstall.
Running a 32 bit userland on top of a 64 bit kernel works.
ARM does not have multilib, so if you go all 64 bit, 32 bit apps will not run.

I found that post on the forum here, and i need the oracle jre for some reasons, but there is a version for 64bit. And if i don't want to play old games there is no reason to use 32bit, or am i wrong?

Can i use the GenPi64 Project and modifiy the /etc/portage/make.conf makeopts for the new processor, then reinstall the whole system? Or shall i wait until a RasPi5 Version is releaised? What about the M.2 Adapter, have i make a new kernel with that driver or maybe that could be a problem?
Or maybe anyone got some useful informations for me for this project?
Sorry for my bad english, it's not my native language but i hope you all understand what i mean.
Back to top
View user's profile Send private message
pingtoo
l33t
l33t


Joined: 10 Sep 2021
Posts: 926
Location: Richmond Hill, Canada

PostPosted: Thu Oct 19, 2023 8:29 pm    Post subject: Reply with quote

Gladdle,

If you are looking a ready made Gentoo for RPI5 you will be disappointed. I have not found such thing yet.

However if you take apart of the entire OS into smaller chunk you may be easier to get to you ideal setting.

So my recommendation,
  1. Use Raspberry Pi OS kernel and its DTB.
  2. Load current Gentoo stage3 for ARM64
  3. Optional setup a cross build system on a more powerful machine for optimised stage3


Kernel is really just Linux mainline + Rasperry Pi patches for hardware, if you want Gentoo's patches it can come later once you have known working environment.

Rootfs, get current ARM64 stage3, it is targeted for generic ARMv8-a. Once you have a working Gentoo (either on RPI5 or crossdev) you can create new targeted to ARMv8,2+dotprod

GenPi64 is kind of outdated binary, if you load it you most likely want to bring it up to date which is for sure recompile everything. (And most likely several iterations)

GenPi64 kernel may not work for RPI5, because it will not have right driver for RP1 (the southern chip)[/list]
Back to top
View user's profile Send private message
flysideways
Guru
Guru


Joined: 29 Jan 2005
Posts: 437

PostPosted: Wed Oct 25, 2023 4:40 pm    Post subject: Reply with quote

I'm in no hurry at the moment, there are 8gb Pi 4's available again. I have two on the way for a couple of PiHut Aluminum Armour cases that I bought a long time ago, still in the boxes needing Pi's.

I have no desire for an active cooling solution. I'd be happy with an updated Aluminum Armour case with all of the features of the Pi 4 version.

I am interested to see what NVME solutions come about.
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 54262
Location: 56N 3W

PostPosted: Wed Oct 25, 2023 6:58 pm    Post subject: Reply with quote

Gladdle,

In anticipation of getting a Pi5 by the end of the month, I wrote Raspberry PI Install Guide
I've tested most of it (once) on a Pi4 I had to reinstall after its SSD had to be repurposed.

The main aim was to get a system up without needing to chroot. It does that,
It was also supposed to be Pi model independent. The only thing to change for one Pi model to another is the stage3 that you require.

The Pi5 should run Pi4 code but a few optimisations will be missing. They are only a rebuild away.

Sakakis original GenPi64 is dead. The one you linked should be OK but it won't be Pi5 optimised yet.
Hence, use the Gentoo stage3 on top of the foundation binary kernel and GPU code.

I want passive cooiling, PoE and NVMe.
With single lane PCIe 2, NVMe isn't going to be any better than SATA, speed wise.
The selling point is that it fits inside the case.

I'm intending adding Pi5 code to my binhost once i can test it.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.


Last edited by NeddySeagoon on Fri Oct 27, 2023 7:11 pm; edited 1 time in total
Back to top
View user's profile Send private message
flysideways
Guru
Guru


Joined: 29 Jan 2005
Posts: 437

PostPosted: Fri Oct 27, 2023 7:04 pm    Post subject: Reply with quote

@Neddy, I went to go look at your latest contribution, the link has a bit of extra text.

Code:
https://wiki.gentoo.org/wiki/User:NeddySeagoon/Raspberry_PI_Install_Guide[/url


I'm guessing you meant https://wiki.gentoo.org/wiki/User:NeddySeagoon/Raspberry_PI_Install_Guide

Off to go read it now.

Thanks!
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 54262
Location: 56N 3W

PostPosted: Fri Oct 27, 2023 7:12 pm    Post subject: Reply with quote

flysideways,

Thanks. I've fixed and tested the link now.

Feedback welcome.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
flysideways
Guru
Guru


Joined: 29 Jan 2005
Posts: 437

PostPosted: Fri Oct 27, 2023 7:48 pm    Post subject: Reply with quote

Very good read and quite the time saver compared to how I got started with Gentoo on my Pi's.
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 54262
Location: 56N 3W

PostPosted: Sat Oct 28, 2023 12:05 pm    Post subject: Reply with quote

Team,

I've tried to clear up some /dev/sda and /dev/mmcblk0 confusion pointed out by my first user feedback. Thank you.
The page is updated.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
antonellocaroli
Guru
Guru


Joined: 11 Aug 2016
Posts: 510

PostPosted: Sun Oct 29, 2023 5:44 am    Post subject: Reply with quote

@NeddySeagoon I currently use for rpi4 as CFLAGS
Code:
march=armv8-a+crc+simd -mtune=cortex-a72 -ftree-vectorize -O3 -pipe -fomit-frame-pointer


what changes with rpi5?
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 54262
Location: 56N 3W

PostPosted: Mon Oct 30, 2023 3:14 pm    Post subject: Reply with quote

antonellocaroli,

The Pi5 is armv8.2+crypto. Its a cortex-a76 CPU.

I don't have a Pi5 yet. Digging around and asking on IRC, I've discovered
make.conf:
# Pi 5 is armv8.2-a+crypto
#           armv8-a : Armv8-A : +fp, +simd
#           armv8.1-a : Armv8.1-A : armv8-a, +crc, +lse, +rdma
#           armv8.2-a : Armv8.2-A : armv8.1-a

#  thats armv8-a+fp+simd+crc+lse+rdma+crypto
#  Feature   crypto  implies  aes,  sha2,  and  simd,  which  implies  fp.
# which expands to ...including implied features ...
# armv8-a+fp+simd+crc+lse+rdma+crypto+aes+sha2+simd

# From a real Pi 5 :)
# Features        : fp asimd evtstrm aes pmull sha1 sha2 crc32 atomics fphp asimdhp cpuid asimdrdm lrcpc dcpop asimdd

# What does the Hawk support?

#COMMON_FLAGS="-O2 -pipe"
COMMON_FLAGS="-mcpu=cortex-a76+crypto -O2 -pipe"


That's from my RPi5 KVM build system.

The Pi4 KVM build system uses
Code:
COMMON_FLAGS="-mcpu=cortex-a72+crc -mtune=cortex-a72 -ftree-vectorize -O2 -pipe -fomit-frame-pointer -flto"

Its got a lot more RAM than a Pi, so I don't mind -flto.
The Pi cache is tiny, so -O2 rather than -O3.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
antonellocaroli
Guru
Guru


Joined: 11 Aug 2016
Posts: 510

PostPosted: Fri Nov 10, 2023 2:56 am    Post subject: Reply with quote

@NeddySeagoon

I got the Rpi5 and it's already running, for CFLAGS I set it up like this:

Code:
CFLAGS="-march=armv8.2-a+crc+crypto -mcpu=cortex-a76+crc+crypto -mtune=cortex-a76 -ftree-vectorize -O2 -pipe -fomit-frame-pointer"


should be OK?

Code:
gcc -### -E - -march=native 2>&1 | sed -r '/cc1/!d;s/(")|(^.* - )|( -mno-[^\ ]+)//g'
-mlittle-endian -mabi=lp64 -mcpu=cortex-a76+crc+crypto -dumpbase -
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 54262
Location: 56N 3W

PostPosted: Fri Nov 10, 2023 5:04 pm    Post subject: Reply with quote

antonellocaroli,

That looks about right. From my understanding of
Code:
man gcc
+crc is redundant but harmless.

What does resolve-march-native produce on a Pi 5?
You need version 3.0.0 or later as version 2.2.0 failed on my arm64 systems.

I still don't have my Pi 5 :(
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
antonellocaroli
Guru
Guru


Joined: 11 Aug 2016
Posts: 510

PostPosted: Fri Nov 10, 2023 5:27 pm    Post subject: Reply with quote

NeddySeagoon wrote:

What does resolve-march-native produce on a Pi 5?


Code:
resolve-march-native
-mcpu=cortex-a76+crc+crypto


Now I was playing around with the kernel configuration, and I saw a different entry in bcm2712_defconfig

Code:
CONFIG_ARM64_16K_PAGES=y"


that when I compile for rpi3 and rpi4 always at 64bit
I had set to
Code:
CONFIG_ARM64_4K_PAGES=y


I don't actually know which setting is better...
Back to top
View user's profile Send private message
pgu
l33t
l33t


Joined: 30 Jul 2009
Posts: 721
Location: Oslo, Norway

PostPosted: Mon Dec 11, 2023 7:49 am    Post subject: Reply with quote

Thank you for the great Pi5 guide.

I gave it a try, but when I get to the first world update stage I ran into problems with gcc and libb2:

Code:

emerge -uDUav --jobs=1 @world
...
>>> Emerging (1 of 14) app-crypt/libb2-0.98.1-r3::gentoo
checking whether the C compiler works... no
configure: error: in `/var/tmp/portage/app-crypt/libb2-0.98.1-r3/work/libb2-73d41c8255a991ed2adea41c108b388d9d14b449-.arm64':
configure: error: C compiler cannot create executables
See `config.log' for more details
...

localhost ~ # grep -i error /var/tmp/portage/app-crypt/libb2-0.98.1-r3/work/libb2-73d41c8255a991ed2adea41c108b388d9d14b449-.arm64/config.log
Configured with: /var/tmp/portage/sys-devel/gcc-13.2.1_p20230826/work/gcc-13-20230826/configure --host=aarch64-unknown-linux-gnu --build=aarch64-unknown-linux-gnu --prefix=/usr --bindir=/usr/aarch64-unknown-linux-gnu/gcc-bin/13 --includedir=/usr/lib/gcc/aarch64-unknown-linux-gnu/13/include --datadir=/usr/share/gcc-data/aarch64-unknown-linux-gnu/13 --mandir=/usr/share/gcc-data/aarch64-unknown-linux-gnu/13/man --infodir=/usr/share/gcc-data/aarch64-unknown-linux-gnu/13/info --with-gxx-include-dir=/usr/lib/gcc/aarch64-unknown-linux-gnu/13/include/g++-v13 --disable-silent-rules --disable-dependency-tracking --with-python-dir=/share/gcc-data/aarch64-unknown-linux-gnu/13/python --enable-languages=c,c++,fortran --enable-obsolete --enable-secureplt --disable-werror --with-system-zlib --enable-nls --without-included-gettext --disable-libunwind-exceptions --enable-checking=release --with-bugurl=https://bugs.gentoo.org/ --with-pkgversion='Gentoo 13.2.1_p20230826 p7' --with-gcc-major-version-only --enable-libstdcxx-time --enable-lto --disable-libstdcxx-pch --enable-shared --enable-threads=posix --enable-__cxa_atexit --enable-clocale=gnu --disable-multilib --disable-fixed-point --enable-libgomp --disable-libssp --disable-libada --disable-cet --disable-systemtap --disable-valgrind-annotations --disable-vtable-verify --disable-libvtv --without-zstd --without-isl --enable-default-pie --enable-default-ssp
aarch64-unknown-linux-gnu-gcc: error: unrecognized command-line option '-V'
aarch64-unknown-linux-gnu-gcc: fatal error: no input files
aarch64-unknown-linux-gnu-gcc: error: unrecognized command-line option '-qversion'; did you mean '--version'?
aarch64-unknown-linux-gnu-gcc: fatal error: no input files
aarch64-unknown-linux-gnu-gcc: error: unrecognized command-line option '-version'
aarch64-unknown-linux-gnu-gcc: fatal error: no input files
collect2: error: ld returned 1 exit status
configure:3874: error: in `/var/tmp/portage/app-crypt/libb2-0.98.1-r3/work/libb2-73d41c8255a991ed2adea41c108b388d9d14b449-.arm64':
configure:3876: error: C compiler cannot create executables
gl_cv_compiler_check_decl_option=-Werror=implicit-function-declaration
localhost ~ # eselect gcc list
 [1] aarch64-unknown-linux-gnu-13 *


I'm using the stage3 (stage3-arm64-openrc-20231119T204701Z) provided make.conf. I've only added "mcpu=cortex-a76+crc+crypto -mtune=cortex-a76" to COMMON_FLAGS and provided a mirror:

Code:

localhost ~ # cat /etc/portage/make.conf
# These settings were set by the catalyst build script that automatically
# built this stage.
# Please consult /usr/share/portage/config/make.conf.example for a more
# detailed example.
COMMON_FLAGS="mcpu=cortex-a76+crc+crypto -mtune=cortex-a76 -O2 -pipe"
CFLAGS="${COMMON_FLAGS}"
CXXFLAGS="${COMMON_FLAGS}"
FCFLAGS="${COMMON_FLAGS}"
FFLAGS="${COMMON_FLAGS}"

# WARNING: Changing your CHOST is not something that should be done lightly.
# Please consult https://wiki.gentoo.org/wiki/Changing_the_CHOST_variable before changing.
CHOST="aarch64-unknown-linux-gnu"

# NOTE: This stage was built with the bindist Use flag enabled

# This sets the language of build output to English.
# Please keep this setting intact when reporting bugs.
LC_MESSAGES=C.utf8

GENTOO_MIRRORS="https://ftp.snt.utwente.nl/pub/os/linux/gentoo"


Did anybody else run into this issue?
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 54262
Location: 56N 3W

PostPosted: Mon Dec 11, 2023 8:48 am    Post subject: Reply with quote

Is that a letter 'O' or numeral '0' in -O2?
It must be the letter uppercase O for optimise.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
pgu
l33t
l33t


Joined: 30 Jul 2009
Posts: 721
Location: Oslo, Norway

PostPosted: Mon Dec 11, 2023 11:11 am    Post subject: Reply with quote

It's an upper case letter "O" ascii 0x4f:

Code:

localhost ~ # tail -1 /proc/cpuinfo
Model           : Raspberry Pi 5 Model B Rev 1.0
localhost ~ # grep ^COMMON_FLAGS /etc/portage/make.conf  | cut -d" " -f3
-O2
localhost ~ # grep ^COMMON_FLAGS /etc/portage/make.conf  | cut -d" " -f3 | od -t x1
0000000 2d 4f 32 0a
0000004
Back to top
View user's profile Send private message
pgu
l33t
l33t


Joined: 30 Jul 2009
Posts: 721
Location: Oslo, Norway

PostPosted: Mon Dec 11, 2023 11:23 am    Post subject: Reply with quote

The problem is a missing initial dash to the mcpu option.

Code:

localhost ~ # grep ^COMMON_FLAGS /etc/portage/make.conf
COMMON_FLAGS="-mcpu=cortex-a76+crc+crypto -mtune=cortex-a76 -O2 -pipe"


EDIT: After fixing my typo I was able to complete the @world update.


Last edited by pgu on Tue Dec 12, 2023 11:14 am; edited 1 time in total
Back to top
View user's profile Send private message
gentoo_ram
Guru
Guru


Joined: 25 Oct 2007
Posts: 474
Location: San Diego, California USA

PostPosted: Mon Dec 11, 2023 10:42 pm    Post subject: Reply with quote

I have Gentoo running on my Pi4b/8gb now. When I eventually get a Pi5, can I just move my SDCard over to the new hardware and boot with my kernel8.img? From what I've read online and see in the bcm2712_defconfig in the raspberry pi kernel sources the only difference in the kernel config is enabling 16k pages. I'm currently running kernel 6.6.0-v8+.

Apparently the Pi5 will still boot without that change. I'm just not sure about the device tree. I guess I'll find out eventually if I can ever get the hardware. Looking forward to trying NVME, too.
Back to top
View user's profile Send private message
pgu
l33t
l33t


Joined: 30 Jul 2009
Posts: 721
Location: Oslo, Norway

PostPosted: Thu Dec 14, 2023 7:44 am    Post subject: Reply with quote

gentoo_ram wrote:
I'm just not sure about the device tree. I guess I'll find out eventually if I can ever get the hardware. Looking forward to trying NVME, too.


If you followed the guide at https://wiki.gentoo.org/wiki/Raspberry_PI_Install_Guide during your Pi4 install you should be able to do a "git pull" to get the latest firmware which also includes "bcm2712-rpi-5-b.dtb".
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 54262
Location: 56N 3W

PostPosted: Thu Dec 14, 2023 11:56 am    Post subject: Reply with quote

gentoo_ram,

You will need a kernel that supports the RPI1 I/O chip as that's new to the Pi5.
If you install all the Pi Foundation firmware into /boot and /lib/firmware, the automatics will almost just work.

The Pi4 userland is good on a Pi5.You won't have the advantage of the new Pi5 instructions.

One thing that wont work is swap, as all the Pis to date use a 4k page size and the Pi5 uses 16k by default.
Its an easy fix. Either remake swap or use the option to swapon that changes the page size. That destroys anything in swap, like a resume image.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
gentoo_ram
Guru
Guru


Joined: 25 Oct 2007
Posts: 474
Location: San Diego, California USA

PostPosted: Fri Dec 15, 2023 9:18 pm    Post subject: Reply with quote

pgu wrote:
gentoo_ram wrote:
I'm just not sure about the device tree. I guess I'll find out eventually if I can ever get the hardware. Looking forward to trying NVME, too.


If you followed the guide at https://wiki.gentoo.org/wiki/Raspberry_PI_Install_Guide during your Pi4 install you should be able to do a "git pull" to get the latest firmware which also includes "bcm2712-rpi-5-b.dtb".


I just compiled the 6.6.6 Raspberry Pi kernel and that dtb was created so I copied it over. I'm hoping my existing install will "just work" if I get the new firmware.
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 54262
Location: 56N 3W

PostPosted: Sun Dec 17, 2023 1:35 pm    Post subject: Reply with quote

gentoo_ram,

Tell us all about it.
A home made kernel is on my todo list, along with root in LVM.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
carfentanyl
n00b
n00b


Joined: 28 Dec 2023
Posts: 8

PostPosted: Thu Dec 28, 2023 1:58 pm    Post subject: RPi 5 Gentoo build Reply with quote

Thanks for the really interesting discussion above,

I have been running Gentoo on a Pi4 and CM4 for many years with ZFS built into the kernel, it runs as my home file server.

Unfortunately I can't get things to run well with the RPi 5, after about 5 minutes use it appears that access to external storage is lost and I slowly reach a point where the machine is unresponsive.

I have rebuilt the kernel with the bcm2712_defconfig and copied across lib/firmware/brcm files and /etc/alternatives from a Raspberry Pi OS volume.

Seems odd that it all works for a while and then freezes.

I have not reclocked.

I can still plug the drive into my Asahi Linux M1 chroot and update the gentoo system without a problem and it runs fine on a RPi4 - all very odd!

Any help welcome, also happy to discuss ZFS is anyone is interested on a Gentoo root filesystem using ZFS.
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 54262
Location: 56N 3W

PostPosted: Thu Dec 28, 2023 2:38 pm    Post subject: Reply with quote

carfentanyl,

Welcome to Gentoo.

Check your cooling and power supply.
What PSU do you have?

What is/are the external drives and how are they connected and powered?
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
carfentanyl
n00b
n00b


Joined: 28 Dec 2023
Posts: 8

PostPosted: Thu Dec 28, 2023 2:56 pm    Post subject: Reply with quote

Thanks Neddy appreciate that, I'm officially obsessed with Gentoo.

Hopefully we can solve some of these issues with the RPi5

I agree it sounds very like a PS issue. I have the new RPi5 power supply. I have directly connected the drive (a USB3 adapter for SSDs) to the RPi5 and still run into the same issue. I have a powered USB 3 hub that used to have 3 USB SSDs connected to it with the RPi4 (boot drive and a ZFS mirror of 2 SSDs) without issue, but I realise the RPi5 is much more power hungry.

The new RPi 5 runs at 3.1GHz off the USB hub with no problems at all when I am using Raspberry Pi OS.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Gentoo on ARM All times are GMT
Goto page 1, 2  Next
Page 1 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum