On Dienstag, 13. September 2022, 18:06:42 CEST Kela wrote:
Hello, we have a on-prem OBS running openSUSE 15.3 Leap. We have been building x86_64 applications successfully. We are now trying to cross-build aarch64 application on it. I was first trying to use osc build command to build it. osc build command failed with error "/bin/sh file doesn't exist" error. I checked AARCH64 rootfs does have /bin/sh file in it and chroot is when the failure happens. I looked at the binfmt module registration for aarch64 and it seems the interpreter(/usr/bin/qemu-aarch64-binfmt) is getting registered with P flag, so I modified the flag to PF. It helped however I still saw the same error, strace on manually running chroot command revealed that it is now not finding /bin/qemu-aarch64 file so I copied this to AARCH64 rootfs and finally able proceed with osc build command(using the modified aarch64 rootfs). Can someone please let me know if there is something I can do so I don't have to manually copy these files to AARCH64 rootfs? Thanks in advance!
another mail flagged es spam for me, maybe because of the formating...
In short, when you want to use qemu-*-binfmt you are using a user land
emulation. Means you project need to have the setup to run a native host
kernel, but emulating by default all user land.
This is faster then the system emulation which you get when you run
osc build --vm-type=qemu REPO TARGET_ARCH
or via the former mentioned qemu:TARGET_ARCH for obsworker.
In case of just the user land emulation you would need to prepare this
inside of your distribution configuration.
To make things even more complicate, there is also a third option where
you could skip emulation complete and do a real cross build.
That would be the fastest and most reliant one, but it would require
even more effort to prepare your package sources most likely. And you
would need an unreleased OBS ....
--
Adrian Schroeter