From nobody Mon Feb 9 20:12:41 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 154842517122769.31172126191507; Fri, 25 Jan 2019 06:06:11 -0800 (PST) Received: from localhost ([127.0.0.1]:45223 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gn27W-0007Wf-6a for importer@patchew.org; Fri, 25 Jan 2019 09:06:10 -0500 Received: from eggs.gnu.org ([209.51.188.92]:52197) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gn22A-0003c9-6u for qemu-devel@nongnu.org; Fri, 25 Jan 2019 09:00:39 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gn222-0000gs-4Q for qemu-devel@nongnu.org; Fri, 25 Jan 2019 09:00:37 -0500 Received: from mail-wm1-x333.google.com ([2a00:1450:4864:20::333]:51178) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gn221-0000Zm-PM for qemu-devel@nongnu.org; Fri, 25 Jan 2019 09:00:29 -0500 Received: by mail-wm1-x333.google.com with SMTP id n190so6893197wmd.0 for ; Fri, 25 Jan 2019 06:00:24 -0800 (PST) Received: from zen.linaro.local ([81.128.185.34]) by smtp.gmail.com with ESMTPSA id o64sm58552780wmo.47.2019.01.25.06.00.19 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 25 Jan 2019 06:00:19 -0800 (PST) Received: from zen.linaroharston (localhost [127.0.0.1]) by zen.linaro.local (Postfix) with ESMTP id 1921B3E0670; Fri, 25 Jan 2019 14:00:18 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=wsBjSZZmNHXCqkh57UmQuWi2mMRlT52ALUyhq1If/0w=; b=B8DBtZJT/5oXNAH0AqU9SCuoFMDXaJ4JOnmNQciQRA0mE5rcmJT2nsg+JzFokQstFg bnirXsqV6UZSzjjF4CLq9lkOc3VMQDEMZ/lVF2eHWnH9p/JyKQOb9GKJeb2J7e9uIySu dLHgij/K7BaoTjqjMN2CQ2lq7XebA6S9D9DLk= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=wsBjSZZmNHXCqkh57UmQuWi2mMRlT52ALUyhq1If/0w=; b=qji/PPp+d0TsdmAWYC6V+gjTdju1LlmrAc8rTNKqaBaItC/sTn3HgSCaKgw1MKzwNt kA3fwclN64r7lIJ5/Ug2e+vh73i8hKtCLx7u92bizOGuoyPAGady8atRiqUlW9w6AenL wcRyczQL93seuS/Ded8xgmWKWxBB4ZvunucE0MR9UJ0+2mdbFy9Jip/nOSo975H6PV5T D9haalroQhlGYMcFmRStVcS/xxTwRTTvWxM12dM2YCsP4epCkQLxlwFavoR9T3a9j2Se mGl2GylMvPRJXv56vQFWcHJOijIT/V6D3bMbVDKLsbeFfjSfk8OhWcUqiWEMSf+Gnxc/ 64nw== X-Gm-Message-State: AJcUukeOBSn49cwDKiIM2LyTnH3e2Os493gffKsmwK+XoI31ZmSG95OD fobOE+e7y2tO0pnFDNHDuFkX0Q== X-Google-Smtp-Source: ALg8bN6ITfDlXYuCsVFbDpPKDubq0kw/vfCAfkRbyxlJ4ye3qKoqS89Kr5FQmf6fdXUyCvdG/LCEFA== X-Received: by 2002:a1c:384:: with SMTP id 126mr6948241wmd.26.1548424822969; Fri, 25 Jan 2019 06:00:22 -0800 (PST) From: =?UTF-8?q?Alex=20Benn=C3=A9e?= To: qemu-devel@nongnu.org Date: Fri, 25 Jan 2019 14:00:09 +0000 Message-Id: <20190125140017.6092-7-alex.bennee@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190125140017.6092-1-alex.bennee@linaro.org> References: <20190125140017.6092-1-alex.bennee@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::333 Subject: [Qemu-devel] [PATCH v1 06/14] tests: make docker.py update use configured binfmt path 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: Fam Zheng , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , =?UTF-8?q?Alex=20Benn=C3=A9e?= Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) When copying a QEMU binary into a linux-user docker image we should check what the current configured binfmt_misc path is rather than just assuming "/usr/bin/qemu-bin". Obviously if the user changes the configuration afterwards they will break their images again. Signed-off-by: Alex Benn=C3=A9e --- tests/docker/docker.py | 25 +++++++++++++++---------- 1 file changed, 15 insertions(+), 10 deletions(-) diff --git a/tests/docker/docker.py b/tests/docker/docker.py index 02d8a83847..30f463af9f 100755 --- a/tests/docker/docker.py +++ b/tests/docker/docker.py @@ -123,17 +123,17 @@ def _check_binfmt_misc(executable): =20 if not os.path.exists(binfmt_entry): print ("No binfmt_misc entry for %s" % (binary)) - return False + return None =20 with open(binfmt_entry) as x: entry =3D x.read() =20 - qpath =3D "/usr/bin/%s" % (binary) - if not re.search("interpreter %s\n" % (qpath), entry): - print ("binfmt_misc for %s does not point to %s" % (binary, qpath)) - return False - - return True + m =3D re.search("interpreter (\S+)\n", entry) + interp =3D m.group(1) + if interp and interp !=3D executable: + print("binfmt_misc for %s does not point to %s, using %s" % + (binary, executable, interp)) =20 + return interp =20 def _read_qemu_dockerfile(img_name): # special case for Debian linux-user images @@ -394,9 +394,14 @@ class UpdateCommand(SubCommand): tmp =3D tempfile.NamedTemporaryFile(suffix=3D"dckr.tar.gz") tmp_tar =3D TarFile(fileobj=3Dtmp, mode=3D'w') =20 - # Add the executable to the tarball - bn =3D os.path.basename(args.executable) - ff =3D "/usr/bin/%s" % bn + # Add the executable to the tarball, using the current + # configured binfmt_misc path. + ff =3D _check_binfmt_misc(args.executable) + if not ff: + bn =3D os.path.basename(args.executable) + ff =3D "/usr/bin/%s" % bn + print ("No binfmt_misc configured: copied to %s" % (ff)) + tmp_tar.add(args.executable, arcname=3Dff) =20 # Add any associated libraries --=20 2.17.1