View previous topic :: View next topic |
Author |
Message |
Jon Wilder Tux's lil' helper
Joined: 04 Apr 2011 Posts: 114 Location: Greenville SC
|
Posted: Fri Sep 20, 2024 3:25 am Post subject: Qemu aarch64 Issue |
|
|
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 |
|
|
pingtoo Veteran
Joined: 10 Sep 2021 Posts: 1238 Location: Richmond Hill, Canada
|
Posted: Fri Sep 20, 2024 3:17 pm Post subject: |
|
|
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 |
|
|
Jon Wilder Tux's lil' helper
Joined: 04 Apr 2011 Posts: 114 Location: Greenville SC
|
Posted: Sat Sep 21, 2024 4:15 am Post subject: |
|
|
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 |
|
|
|
|
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
|
|