Bug#1034319: debootstrap of foreign arch fails w/o recommended binfmt-support

2023-04-18 Thread Michael Tokarev

On Wed, 12 Apr 2023 17:58:38 -0400 Joey Hess  wrote:

Package: qemu-user-static
Version: 1:7.2+dfsg-5
Severity: normal

I got a new arm64 host at Hetzner, and needed an amd64 chroot in it.
Of course that's easy, since debootstrap --arch just works for foreign
arches with qemu-user-static installed.


I assume this is bullseye system, right?

..

If systemd by itself is supposed to somehow handle what binfmt-support
does, it did not work in my case. I had to install binfmt-support
and rerun /var/lib/dpkg/info/qemu-user-static.postinst to fix the
problem.


Did you try to restart systemd-binfmt service, or rebooting?

IIRC, systemd added triggers for /usr/lib/binfmt.d/ in a version
after bullseye one.

systemd (251.2-1) unstable; urgency=medium

  * Add dpkg file trigger for systemd-binfmt to update binfmt registrations

This stuff works just fine on bookworm or with systemd from
bullseye-backports. This is why I haven't bothered adding my
own triggers.

I guess this can be closed as fixed in version 251.2-1 :)

Thanks,

/mjt



Bug#1034319: debootstrap of foreign arch fails w/o recommended binfmt-support

2023-04-12 Thread Joey Hess
Package: qemu-user-static
Version: 1:7.2+dfsg-5
Severity: normal

I got a new arm64 host at Hetzner, and needed an amd64 chroot in it.
Of course that's easy, since debootstrap --arch just works for foreign
arches with qemu-user-static installed.

root@sparrow:/tmp>apt-get install debootstrap qemu-user-static
root@sparrow:/tmp>debootstrap --arch amd64 sid sid
...
W: Failure trying to run: chroot "/tmp/sid" /bin/true
W: See /tmp/sid/debootstrap/debootstrap.log for details
root@sparrow:/tmp>tail -1 /tmp/sid/debootstrap/debootstrap.log
chroot: failed to run command '/bin/true': Exec format error

Oops, so it doesn't just work. Some digging in the postinst revealed
I needed binfmt-support installed, and it was not installed. I think
because qemu-user-static Recommends: systemd | binfmt-support
and of course I have systemd installed.

If systemd by itself is supposed to somehow handle what binfmt-support
does, it did not work in my case. I had to install binfmt-support
and rerun /var/lib/dpkg/info/qemu-user-static.postinst to fix the
problem.

-- 
see shy jo


signature.asc
Description: PGP signature