From patchwork Wed Jun 27 20:53:14 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Vivier X-Patchwork-Id: 935717 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=vivier.eu Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 41GFYC4FKjz9s19 for ; Thu, 28 Jun 2018 06:55:27 +1000 (AEST) Received: from localhost ([::1]:33168 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fYHTJ-0004vp-8l for incoming@patchwork.ozlabs.org; Wed, 27 Jun 2018 16:55:25 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:57034) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fYHRn-0004HV-22 for qemu-devel@nongnu.org; Wed, 27 Jun 2018 16:53:52 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fYHRj-0003dU-PG for qemu-devel@nongnu.org; Wed, 27 Jun 2018 16:53:51 -0400 Received: from mout.kundenserver.de ([212.227.126.187]:57436) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fYHRj-0003aW-FZ for qemu-devel@nongnu.org; Wed, 27 Jun 2018 16:53:47 -0400 Received: from localhost.localdomain ([78.238.229.36]) by mrelayeu.kundenserver.de (mreue007 [212.227.15.167]) with ESMTPSA (Nemesis) id 0MUgUR-1fg9We3bG7-00RIPi; Wed, 27 Jun 2018 22:53:36 +0200 From: Laurent Vivier To: qemu-devel@nongnu.org Date: Wed, 27 Jun 2018 22:53:14 +0200 Message-Id: <20180627205317.10343-1-laurent@vivier.eu> X-Mailer: git-send-email 2.14.4 X-Provags-ID: V03:K1:tgU7031i463mQzmY7oZYflYZbdkixuUC5yjslyBZQXE5vw75McA 3VOG+uT0ZMCb/O+thCAkDXfqNRx+NX8jnNrhz9NE3Scf+meoVwst5ResCbeLMPrd2bLo5lI 8G+FdO555Fg8DlPzuIhZ8goaKggTP70NeJWp04W1o37JKDv5RJIIAcFer4i2GoA4Lygzmqs oXdGOja4ROAG1sXCh/t1w== X-UI-Out-Filterresults: notjunk:1; V01:K0:W58GxDzjKPs=:zVLhpn9XFnWoX1de8mlQP3 pCRPJqk2m5cQhLcwESY/rDhm/2+hdDehkoOcYtkdV4fRTyT9uuNCwU5iQwRhkFVjqBT2wkce2 JwvA6qyvSHiqs08nUZEz/fKdVYqKt5XqHUIRltCmQwcBBCp4LVm8VNHrl0wClagLwEY9yClXr HWFdq9B1KJXiwuvWo87q7SPR2HOeX+Kly4livj/RYepYAkwe2WlJnzRJ4oQBYzJQNJCjeDrgc Jkgsjs6R/OOxyX29GpBJ5g9P6sEn7cavR3JdAoNJHY+JGBX1D26JDqn3sqx/oKkuaTaXny/GW XOq4/K2ce6iznuwH8w4NSFkP6SrFGzjIVUZ3Kr1owgSITQPPVcp2b0381QpD/MeR5WHBCK86g ehPABgBaf2+LYsnNXYOhc97eb4udMSj9QZvwUy651Vf0BpfSp//ZvpFBgbsOB3vuLRLCHfKXn q2Un7mcxya0wJITcKpofsv0GQ71LvepUegp08N+itXQ4e7rdRRHJojwmf4+l4GFUBB5FdTPM4 KrpI4UEgqfYXz1rD2yl5/DXiRxe1TxD7xPTlbEVqcdnQpXXA1qtmw3oiq+0AQKsRESfiHUvJ7 eDR3Bkb05QDxspJg8+OJQNwnP4ONwLADo/ktZFRTDGmkUsucjfzzKMuiw6o2xw6fiGrkWmDrb iph0+Lm0SLo/u28l+jaChGo5aKAsA0hs6XxE9k9WuH5mCjmhZBXWIb9Py/fgRz4N8j3A= X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 212.227.126.187 Subject: [Qemu-devel] [PATCH 0/3] linux-user: manage binfmt F flag X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Riku Voipio , Laurent Vivier Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" The binfmt F flag ("Fix binaries") allows to load the interpreter binary at configuration time and all future users are cloned from this memory copy. This avoids to have to copy the interpreter to the filesystem of the target we want to use. This series introduces this new flag in qemu-binfmt-conf.sh and another new parameter to provide a suffix to the default qemu-CPU name to be able to use static version of qemu linux-user provided by distros: qemu-binfmt-conf.sh --qemu-path /usr/bin --qemu-suffix -static \ --systemd m68k --credential yes --persistent yes configures binfmt to use /usr/bin/qemu-m68k-static from the root filesystem to interpret m68k binaries in unmodified chroots or containers/dockers. With systemd, the interpreter is loaded when you restart the systemd-binfmt service: systemctl restart systemd-binfmt.service With that, you can execute directly a debootstrap without the --foreign parameter. debootstrap --arch=m68k --variant=minbase \ --no-check-gpg etch-m68k chroot-m68k \ http://archive.debian.org/debian chroot chroot-m68k localhost:/# ls bin dev home lib mnt proc sbin sys usr boot etc initrd media opt root srv tmp var Laurent Vivier (3): qemu-binfmt-conf.sh: cleanup --credential qemu-binfmt-conf.sh: add persistent (F) flags qemu-binfmt-conf.sh: allow to provide a suffix to the interpreter name scripts/qemu-binfmt-conf.sh | 64 +++++++++++++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 23 deletions(-)