device: 0.948 other: 0.947 assembly: 0.933 semantic: 0.925 instruction: 0.920 boot: 0.909 graphic: 0.904 socket: 0.903 network: 0.890 vnc: 0.880 mistranslation: 0.874 KVM: 0.859 qemu-user: $0 incorrectly always reports absolute path We just ran into an issue with the Perl package on Debian/m68k when being built with qemu-user [1]. The problem can be boiled down to qemu-user always reporting absolute paths for the shell variable $0 no matter on how the command was invoked. A simple reproducer is this: On normal system (no emulation): root@nofan:~> sh -c 'echo $0' sh root@nofan:~> On qemu-user: (sid-m68k-sbuild)root@nofan:/# sh -c 'echo $0' /bin/sh (sid-m68k-sbuild)root@nofan:/# > [1] https://lists.debian.org/debian-68k/2019/07/msg00007.html Tentative patch On 7/9/19 1:54 PM, Laurent Vivier wrote: > ** Patch added: "Enable binfmt-misc preserve-arg[0] flag" > https://bugs.launchpad.net/qemu/+bug/1835839/+attachment/5275869/+files/0001-linux-user-manage-binfmt-misc-preserve-arg-0-flags.patch Thanks! I just tried the patch and ran the setup script with: ./scripts/qemu-binfmt-conf.sh --debian --qemu-path=/usr/bin --qemu-suffix=-static --preserve-arg0 yes and: root@nofan:~/qemu> systemctl restart binfmt-support.service root@nofan:~/qemu> But still don't get the correct path: (sid-m68k-sbuild)root@nofan:/# sh -c 'echo $0' /bin/sh (sid-m68k-sbuild)root@nofan:/# Do I need to do anything else? -- .''`. John Paul Adrian Glaubitz : :' : Debian Developer -