Using qemu to pre-populate crossbuilds

Karl Denninger karl at denninger.net
Sun Mar 3 22:26:35 UTC 2019


I have qemu-user-static loaded, which I use to build poudriere packages
for the Pi2 (since that platform has no pre-builts available for 12-Stable.)

This brings up an interesting question, since qemu can obviously run
(albeit slowly) native Arm code -- can I use it as a means to, for
example, pre-run "pkg" -- or kldxref -- on a built image?

Devmatch, for example, wants a linker hints file, but there's no good
way to build one, since the AMD64 system will refuse to do so as the
kernel modules are of the wrong type.  If the new system is one that
runs read-only on root then once running it can't build one either
without manual intervention.

The obvious ("qemu-arm-static /mnt/usr/sbin/kldxref /mnt/boot/kernel/"),
where "/mnt" is where I have the completed image's root directory
mounted, fails with a complaint:

Unable to load interpreter

I'm probably missing something stupid, since obviously it can execute
arm binaries or the poudriere jail wouldn't work, and it does.

binmiscctl appears to show the correct magic numbers are set to be able
to run these; I assume the problem is with the shared libraries required
since kldxref is dynamically-linked.

Any assistance is appreciated.

-- 
Karl Denninger
karl at denninger.net <mailto:karl at denninger.net>
/The Market Ticker/
/[S/MIME encrypted email preferred]/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 4897 bytes
Desc: S/MIME Cryptographic Signature
URL: <http://lists.freebsd.org/pipermail/freebsd-arm/attachments/20190303/ae592b51/attachment.bin>


More information about the freebsd-arm mailing list