From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([209.51.188.92]:42280) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h18RH-0000yL-Gv for qemu-devel@nongnu.org; Tue, 05 Mar 2019 06:40:52 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1h18RG-0006H3-Dk for qemu-devel@nongnu.org; Tue, 05 Mar 2019 06:40:51 -0500 Received: from indium.canonical.com ([91.189.90.7]:59038) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1h18RG-0006B6-6N for qemu-devel@nongnu.org; Tue, 05 Mar 2019 06:40:50 -0500 Received: from loganberry.canonical.com ([91.189.90.37]) by indium.canonical.com with esmtp (Exim 4.86_2 #2 (Debian)) id 1h18RE-0000aA-CB for ; Tue, 05 Mar 2019 11:40:48 +0000 Received: from loganberry.canonical.com (localhost [127.0.0.1]) by loganberry.canonical.com (Postfix) with ESMTP id 551C12E8070 for ; Tue, 5 Mar 2019 11:40:48 +0000 (UTC) MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Date: Tue, 05 Mar 2019 11:30:34 -0000 From: Luyou Peng <1818483@bugs.launchpad.net> Reply-To: Bug 1818483 <1818483@bugs.launchpad.net> Sender: bounces@canonical.com References: <155168800961.29550.2360664198558693792.malonedeb@chaenomeles.canonical.com> Message-Id: <155178543508.32254.15607485178241220659.malone@wampee.canonical.com> Errors-To: bounces@canonical.com Subject: [Qemu-devel] [Bug 1818483] Re: qemu user mode does not support binfmt_misc config with flags=P List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org I modified binfmt_misc.c to let it send one more args if the corresponding = binfmt_misc flags include "P", also I modified main.c in qemu as attached p= atch_qemu_main.patch to check if the input args include such string. Then q= emu user could support both scenarios. Is this modification feasible? ** Patch added: "patch_qemu_main.patch" https://bugs.launchpad.net/qemu/+bug/1818483/+attachment/5243644/+files/= patch_qemu_main.patch ** Summary changed: - qemu user mode does not support binfmt_misc config with flags=3DP + qemu user mode does not support binfmt_misc config with flags include "P" -- = You received this bug notification because you are a member of qemu- devel-ml, which is subscribed to QEMU. https://bugs.launchpad.net/bugs/1818483 Title: qemu user mode does not support binfmt_misc config with flags include "P" Status in QEMU: New Bug description: Hi Sir: During our test in chroot environment with qemu-user-static, we got some = test cases failed because of program output warning with unexpected full pa= th name. For example in test module "Devscripts" the test item for broken tarball expected the warning info: but the output was: the cause is the config file of binfmt_misc was set not to send argv0, fo= r example: type command "tar" after chroot: =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D lpeng@lpeng-VirtualBox:~/projects_lpeng/qemu/mips_2/sid$ sudo chroot . [sudo] password for lpeng: = root@lpeng-VirtualBox:/# tar /bin/tar: You must specify one of the '-Acdtrux', '--delete' or '--test-l= abel' options Try '/bin/tar --help' or '/bin/tar --usage' for more information. root@lpeng-VirtualBox:/# = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D by adding output log in main()@qemu/Linux-user/main.c we found the original input command was changed, and qemu do not know tha= t, we got the input args: argv_0----/usr/bin/qemu-mips64el-static--- argv_1----/bin/tar--- argv_2----NULL--- Next step we modified the flags=3DP in the corresponding config under fol= der /proc/sys/fs/binfmt_misc, then binfmt_misc sent argv[0] to qemu. But chroot could not start bash because in current qemu dose not consider= about this unexpected one more"argv[0]" = After modified qemu code temporary to handle the new argv list we got the= input args, and from argv[2] is the original input command argv_0----/usr/bin/qemu-mips64el-static--- argv_1----/bin/tar--- argv_2----tar--- We need the original input from command line, so is it possible that let = binfmt_misc to pass one more additional args or env to qemu as a token of t= he binfmt_misc flag, then qemu can judge how to parse the input args by it? looking forward your suggestions. Thanks luyou To manage notifications about this bug go to: https://bugs.launchpad.net/qemu/+bug/1818483/+subscriptions