Hi mjt, > Thank you very much for this excellent bug report!
thank you for your very quick reply! :D On Sun, 15 May 2022 10:43:43 +0300 Michael Tokarev <m...@tls.msk.ru> wrote: > 15.05.2022 09:43, Michael Tokarev wrote: > > Meanwhile can you please try moving qemu bits away from /usr/lib/binfmt.d/ > > (this particular architecture should be enough), and see if that helps? I > > don't know what's needed for binfmt-support to re-register its fmt though, > > - a reboot should help but there is definitely a shorter way. > > Hm. It looks like there's an error in systemd binfmt registration, which > effectively does not work at all - the files in /usr/lib/binfmt.d/ should > have .conf extension. So there was no changes in qemu binfmt handling > between qemu -2 and -3, iirc. Except that now, for a new install, this > registration will not be done at all! > > Which makes the following even more important: > > > Speaking of mmdebstrap: why does it try to "fall back"? Did it try this > > before, or is it intentional? The thing is that today, qemu-user-static > > is transparent (or should be anyway), there's no need to run it explicitly, > > it is done the binfmt-misc way so *bootstrap should not notice the arch > > it is installing is foreign. It is okay if mmdebstrap does that since > > historic times when this transparency didn't work, and it is not okay > > if it expects such transparency now but it doesn't work. I'm not sure what you mean with "fall back". Maybe you mean that mmdebstrap reads /proc/sys/fs/binfmt_misc/qemu-$arch and then looks for an F in the "flags" field. If it finds that, then it will not copy qemu-user-static into the chroot (as was the old way to make this work). As you also pointed out, today this is automatic. This brings me to a slightly related question: is it possible to disable this transparent qemu-user-static support of running foreign architecture binaries without the qemu-user-static inside the chroot? While this is probably very useful in 99% of the cases, it is very annoying when I try to cross build a source package and then I get a false positive when the build (wrongly) tries to execute a foreign architecture binary and succeeds. Thus, on my machine I'm constantly uninstalling and then re-installing qemu-user whenever I want to do cross builds. Is there some config option I can set to enable or disable transparent binfmt-misc emulation by qemu? > If you rename qemu-foo into qemu-foo.conf in /usr/lib/binfmt.d/ and restart > systemd-binfmt.service, it should work. I think. I cannot confirm that this works (I tried with 1:7.0+dfsg-6). I am now using 1:7.0+dfsg-7 which calls them *.conf and the problem persists. Maybe you want to re-open this bug? Or should I open a new one? Then I also want to respond to some of the things you said in #debian-devel: > 10:11 < mjt> but now I wonder if - after switching from binfmt-support to > systemd-binfmt (and fixing > this qemu-user-static bug), -- if the whole thing will work when > installed in a chroot > 10:13 < mjt> qemu-user should not register its binfmts when installed in > chroot. binfmt-support didn't > care about this, but I've no idea about systemd - maybe that one > cares enough to actually > fix this > 10:15 < mjt> in other words: it worked in this context by accident not by1 > design What do I have to change to make it work again? > 10:39 < mjt> josch: so, in this your test, do you explicitly install > binfmt-support together with > qemu-user-static, or do you rely on qemu-user-static > dependencies? > 10:40 < mjt> josch: if the latter, can you verify if additionally installing > binfmt-support fixes this? > 10:42 < mjt> josch: I *guess* you'll have to add binfmt-support for now, > because even when this my bug > is fixed, you still can't rely on systemd properly registering > binfmts in a chroot Yes, I am explicitly installing binfmt-support. You can see this in the --depends argument I'm passing to debbisect in my initial report. Same in my mmdebstrap test cases where I observed this bug first. The binfmt-support package is explicitly installed there as well: https://sources.debian.org/src/mmdebstrap/0.8.6-2/make_mirror.sh/#L499 Thanks! cheers, josch
signature.asc
Description: signature