Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Qemu aarch64 Issue
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo
View previous topic :: View next topic  
Author Message
Jon Wilder
Tux's lil' helper
Tux's lil' helper


Joined: 04 Apr 2011
Posts: 114
Location: Greenville SC

PostPosted: Fri Sep 20, 2024 3:25 am    Post subject: Qemu aarch64 Issue Reply with quote

Hi all.

I'm running a script which takes a Raspberry Pi OS image and installs some other software to it. I'm using a Gentoo x86_64 machine to do this via Qemu. The Qemu multiarch Git repo has qemu-arch images available, and by using one to chroot into the Pi OS image, we are able to build/install software into the Pi OS image.

The image we download from the Qemu Git repo is qemu-aarch64-static

For some reason, the Gentoo version of Qemu does not like the *-static suffix in the image name. If I try to use it as named, it complains with "cannot execute: required file not found". However, if I rename the downloaded file to qemu-aarch64, it works as expected.

Here is the build info on app-emulation/qemu -

Code:
=================================================================
                        Package Settings
=================================================================

app-emulation/qemu-8.2.3::gentoo was built with the following:
USE="aio alsa bzip2 curl fdt filecaps gnutls gtk jpeg ncurses nls opengl oss pam pin-upstream-blobs pipewire png pulseaudio sdl seccomp slirp static-user udev usb vhost-net vnc xattr -accessibility -bpf -capstone -debug -doc -fuse -glusterfs -infiniband -io-uring -iscsi -jack -jemalloc -keyutils -lzo -multipath -nfs -numa -plugins -python -rbd -sasl -sdl-image (-selinux) -smartcard -snappy -spice -ssh -systemtap -test -usbredir -vde -virgl -virtfs -vte -xen -zstd" ABI_X86="(64)" PYTHON_TARGETS="python3_10 python3_11 python3_12" QEMU_SOFTMMU_TARGETS="aarch64 x86_64 -alpha -arm -avr -cris -hppa -i386 -loongarch64 -m68k -microblaze -microblazeel -mips -mips64 -mips64el -mipsel -nios2 -or1k -ppc -ppc64 -riscv32 -riscv64 -rx -s390x -sh4 -sh4eb -sparc -sparc64 -tricore -xtensa -xtensaeb" QEMU_USER_TARGETS="aarch64 -aarch64_be -alpha -arm -armeb -cris -hexagon -hppa -i386 -loongarch64 -m68k -microblaze -microblazeel -mips -mips64 -mips64el -mipsel -mipsn32 -mipsn32el -nios2 -or1k -ppc -ppc64 -ppc64le -riscv32 -riscv64 -s390x -sh4 -sh4eb -sparc -sparc32plus -sparc64 -x86_64 -xtensa -xtensaeb"

>>> Attempting to run pkg_info() for 'app-emulation/qemu-8.2.3'
Using:
 
  sys-firmware/edk2-ovmf-bin-202202
  sys-firmware/seabios-bin-1.16.0
  sys-firmware/ipxe-1.21.1
  sys-firmware/sgabios-0.1_pre10


Anyone have any insight on this issue? Thanks in advance.
Back to top
View user's profile Send private message
pingtoo
Veteran
Veteran


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

PostPosted: Fri Sep 20, 2024 3:17 pm    Post subject: Reply with quote

Jon Wilder,

Assume you are trying to understand the difference in term of Gentoo vs Qemu multiarch Git. You are not looking howto make it work. (You know rename can make it work)

strictly speaking, this is not qemu related. this is Linux binfmt_misc specific configuration.

The "qemu-<arch>-static" naming is Debian (possible other binary flavors) name. the "-static" portion refer to the binary was built with static linkage, therefor no additional library require.
In Gentoo the USE flag "static-user" will achieve same static link for QEMU_USER_TARGETS. Except Gentoo package does not name the user target with "-static" suffix.

You can find more information in Gentoo wiki:Compiling_with_QEMU_user_chroot.
Back to top
View user's profile Send private message
Jon Wilder
Tux's lil' helper
Tux's lil' helper


Joined: 04 Apr 2011
Posts: 114
Location: Greenville SC

PostPosted: Sat Sep 21, 2024 4:15 am    Post subject: Reply with quote

pingtoo wrote:
Jon Wilder,

Assume you are trying to understand the difference in term of Gentoo vs Qemu multiarch Git. You are not looking howto make it work. (You know rename can make it work)

strictly speaking, this is not qemu related. this is Linux binfmt_misc specific configuration.

The "qemu-<arch>-static" naming is Debian (possible other binary flavors) name. the "-static" portion refer to the binary was built with static linkage, therefor no additional library require.
In Gentoo the USE flag "static-user" will achieve same static link for QEMU_USER_TARGETS. Except Gentoo package does not name the user target with "-static" suffix.

You can find more information in Gentoo wiki:Compiling_with_QEMU_user_chroot.


Thanks for that!

I was able to register a new binfmt_misc handler that now uses the downloaded binary image from Qemu-multiarch Git repo.

This is the stock one.
Code:

nabled
interpreter /usr/bin/qemu-aarch64
flags: OC
offset 0
magic 7f454c460201010000000000000000000200b700
mask ffffffffffffff00fffffffffffffffffeffffff


This is the new one I registered.
Code:

enabled
interpreter /usr/bin/qemu-aarch64-static
flags:
offset 0
magic 7f454c460201010000000000000000000200b700
mask fffffffffffffffcfffffffffffffffffeffffff
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo All times are GMT
Page 1 of 1

 
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