View previous topic :: View next topic |
Author |
Message |
Nigh n00b
Joined: 27 Aug 2024 Posts: 2
|
Posted: Wed Aug 28, 2024 12:06 pm Post subject: qemu binhost for aarch64 |
|
|
Hello.
I am currently trying to setup a binhost for a raspberry pi 4b and to understand more about emulation. My host computer is a x86_64 laptop with profile default/linux/amd64/23.0
As i understand there is different approches to this
- crossdev
- qemu user chroot
- qemu VM
for me crossdev did not work at all, always telling me i had a split-usr profile even though i did select a merge-usr profile (PORTAGE_CONFIGROOT=/usr/aarch64-unknown-linux-gnu eselect profile set 15). I also tried different profiles (musl/llvm, musl/gcc, glibc/gcc). any llvm attempt resulted in portage telling me my compiler did not support openmp (even though clang-runtime had the openmp use flag. gcc always failed but way later. I did not look much more into it as there are other options. but i could post some relevant error logs if needed.
So i went and set up a qemu user chroot following this very good wiki article https://wiki.gentoo.org/wiki/Embedded_Handbook/General/Compiling_with_QEMU_user_chroot everything works and i can chroot without problems. The issue is that portage inside the chroot is atrociously slow even when calculating dependencies and merge checks. Is anyone experiencing the same issue?
So i went and tried to create my own VM with qemu with the following command
Code: |
qemu-system-aarch64 \
-bios /usr/share/qemu/edk2-aarch64-code.fd \
-smp 4 \
-m 4G \
-cdrom install-arm64-minimal-20240825T234900Z.iso \
-boot d \
-hda disk.qcow2 -M virt
|
running this command drop me inside a black tty with this writtent "qemu 9.0.2 monitor - type help for more information". So i guess boot was not successful at all. What am i missing? As i understand arm64 gentoo minimal install cd is EFI but qemu still need the -bios argument. I did some online research and here on the forums and some people pass a linux kernel as an argument also. Would it then be a good idea to take the gentoo-kernel-bin and pass it to qemu?
this is the output of emerge --info app-emulation/qemu
https://bpa.st/NZRQ
As this is my first post tell me if there is any key information missing for troubleshooting.
Thank you for your time. |
|
Back to top |
|
|
Nigh n00b
Joined: 27 Aug 2024 Posts: 2
|
Posted: Thu Aug 29, 2024 8:39 pm Post subject: |
|
|
I went and after a few tries finally understood why crossdev would not work,, the crossdev repo was not setup properly, 'eselect repository crossdev create' was the only command needed to setup the repository.
Now everything works really well so i am not going to use qemu aarch64 emulation. |
|
Back to top |
|
|
gentoo_ram Guru
Joined: 25 Oct 2007 Posts: 502 Location: San Diego, California USA
|
Posted: Tue Sep 03, 2024 3:49 am Post subject: |
|
|
Yeah, I used the crossdev approach to installing on a RPi 4b. Built enough packages to give myself a bare-bones aarch64 binary environment and then set up /etc based on files I had from other working Gentoo installs.
But you have more support now. I suggest reading https://wiki.gentoo.org/wiki/Raspberry_Pi_Install_Guide It'll help you with the process. I'm running Gentoo on an RPi 4 being used as a stratum 0 time server, and I just switched my primary home server from x86 to RPi 5. I don't have any x86 Gentoo machines anymore. |
|
Back to top |
|
|
Ionen Developer
Joined: 06 Dec 2018 Posts: 2851
|
Posted: Tue Sep 03, 2024 3:53 am Post subject: |
|
|
May be good to note that Gentoo already has official aarch64 binpkgs for common packages which can likely solve most of the bigger ocmpile issues assuming a stable profile and default USE. Not that I've tried to use these on a rpi myself.
https://wiki.gentoo.org/wiki/Gentoo_Binary_Host_Quickstart
https://distfiles.gentoo.org/releases/arm64/binpackages/23.0/arm64/
(these also exist for some musl, llvm, and hardened variants, see the parent directory)
Albeit if want to really customize and get a binpkg for any packages, will still need your own setup. Using crossdev is pretty flaky though. |
|
Back to top |
|
|
|