bug-guix
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#36117: qemu-binfmt with non-native chroot


From: Ludovic Courtès
Subject: bug#36117: qemu-binfmt with non-native chroot
Date: Fri, 07 Jun 2019 15:00:32 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/26.2 (gnu/linux)

Hi!

Vagrant Cascadian <address@hidden> skribis:

> On Guix there are no flags set, and the binary used is a dynamically
> linked executable:
>
>   $ cat /proc/sys/fs/binfmt_misc/qemu-aarch64
>   enabled
>   interpreter
>   /gnu/store/sw2rrqmjij73wcy3ajd47ypvmzh12yz6-qemu-3.1.0/bin/qemu-aarch64
>   flags:
>   offset 0
>   magic 7f454c460201010000000000000000000200b700
>   mask ffffffffffffff00fffffffffffffffffeffffff
>
>
> So there are (at least) two things needed to make this work on Guix:
>
> * A way to set the flags on qemu-binfmt-service-type.
>
> * A static build of qemu-user targets
>
> * A way to set which qemu to use for qemu-binfmt-service-type.
>
> The *three* things are...
>
>
> With this working correctly foreign-architecture chroots would become
> trivial:
>
>   # on an amd64 host:
>   $ debootstrap --arch=arm64 buster buster-chroot http://deb.debian.org/debian
>   ...
>   $ chroot buster-chroot /bin/bash
>
>
> Enabling qemu-binfmt-service-type to operate in this way would obviate
> the need for the "guix-support?" qemu-binfmt-configuration option, as
> you could simply assemble the build environment without having to
> include all of qemu's dependencies in the container.
>
> It's a pretty magical feature.

True!  Though adding all the dependencies of QEMU in the chroot the way
‘guix-support?’ does it turns out to be pretty magical too ;-), because
we can precisely list those dependencies and include nothing but these
dependencies in the chroot—something that cannot be done on an FHS
system.

As an quick workaround, perhaps you could bind-mount all the entries of:

  guix gc -R $(guix build qemu)

in your Debian chroot?

(Speaking of which… it would be great to have a Debian API in Guix, where
you could write, say:

  (debian-build #~(system (string-append "/bin/uname > "
                                         #$output)))

Food for thought…)

Thanks,
Ludo’.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]