On 7/10/19 7:28 PM, Andreas Schwab wrote: >> Both the patch from Laurent and these two patches from Alex and you seem >> cause >> issues with the shell environment so that chrooting into the build root no >> longer >> works. > > Make sure you have the P flag and the interpreter pointing to the > *-binfmt wrapper.
Laurent helped me debugging and the problem is that Debian has its own binfmt-support packages which competes with systemd-binfmt with the former not setting the preserve flag. It works when writing the configuration into /proc manually: root@nofan:~/qemu> echo -1 > /proc/sys/fs/binfmt_misc/qemu-m68k root@nofan:~/qemu> cat /etc/binfmt.d/qemu-m68k.conf > /proc/sys/fs/binfmt_misc/register root@nofan:~/qemu> chroot /local_scratch/sid-m68k-sbuild/ (sid-m68k-sbuild)root@nofan:/# sh -c 'echo $0' sh (sid-m68k-sbuild)root@nofan:/# Adrian -- .''`. John Paul Adrian Glaubitz : :' : Debian Developer - glaub...@debian.org `. `' Freie Universitaet Berlin - glaub...@physik.fu-berlin.de `- GPG: 62FF 8A75 84E0 2956 9546 0006 7426 3B37 F5B5 F913