From nobody Mon Feb 9 22:38:01 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 (209.51.188.17 [209.51.188.17]) by mx.zohomail.com with SMTPS id 1549565873927631.2210210506049; Thu, 7 Feb 2019 10:57:53 -0800 (PST) Received: from localhost ([127.0.0.1]:45381 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1grorr-0007Yj-Qr for importer@patchew.org; Thu, 07 Feb 2019 13:57:47 -0500 Received: from eggs.gnu.org ([209.51.188.92]:41009) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1groYj-0000Ie-VI for qemu-devel@nongnu.org; Thu, 07 Feb 2019 13:38:04 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1groYe-0007Sz-P7 for qemu-devel@nongnu.org; Thu, 07 Feb 2019 13:38:00 -0500 Received: from mail-wr1-x42d.google.com ([2a00:1450:4864:20::42d]:34112) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1groYe-0007Ll-9n for qemu-devel@nongnu.org; Thu, 07 Feb 2019 13:37:56 -0500 Received: by mail-wr1-x42d.google.com with SMTP id z15so991437wrn.1 for ; Thu, 07 Feb 2019 10:37:53 -0800 (PST) Received: from zen.linaroharston ([81.128.185.34]) by smtp.gmail.com with ESMTPSA id g123sm144421wmd.1.2019.02.07.10.37.46 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 07 Feb 2019 10:37:48 -0800 (PST) Received: from zen.linaroharston. (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id F23FD1FF88; Thu, 7 Feb 2019 18:37:44 +0000 (UTC) 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=S0Y0SJaJ+3uJySRmld2klURjfuxOZh/cv8KZYQZ3LY4=; b=TDxNaFUlOQB7IKeUJHn3Jh52UKCZ3CnSlPNwN7PueVV2pJC305dcPYAv7wN3KroXw8 Z2C/Zz67kaS7hEmkQ39s27RsduyQcYG4hf4nVJUvc+Pkl7hGDWLB24GdsjakbZe1i+Mn 8ncqkm9iUvNXktUP7gX3h7qlytV4F9uAOwt43mR0zQAcIuhxVCokV6wwq5cgmEXQUvRe T5+8wgIFetb4Pg0ryUyhkn2bVx7Pvl6UvOA1JKoNJpQStu8UkyvQ9Br3NfvNErt2q/PK z88sT6tPgOqMrXfjpD1EtNdyKcu2OSLar7tvhn6JIeACThzNoDRMxxWrP/pTemvDrvM+ CEWQ== 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=S0Y0SJaJ+3uJySRmld2klURjfuxOZh/cv8KZYQZ3LY4=; b=PlDnGK+29TG/ENuDA5bAOtLYEoTf1kQUd9tBJ24lK8jUDMG5q9RmEKL1iFKhoEv7Qj vBaM+mp0xXCvfJnx2cC2t1ogVzUT6KD4eQ1kJslEdNwGqmCKbCjjacSbUkh3tFmp6WUc 74JyClUoEQ60SGq0FQ3/unTwgI3EaDm4fvnFm/t708A6tSmv3WSh+PGfykDg5e3UXHrH Cy2gj4cf4T9SsTZQw3fJtalOXQ7bj4z4u4FhTgLYTC0VCNvtqLQuV3xfCrRKUfQkMaOb RDTgd0ShEh7ylNws9ek7At0oNXCQowKOm2L0wN+OcQ+pJqWyiN+gqKOjvzACLG+lfDfn oFZA== X-Gm-Message-State: AHQUAua9bAdPTATVEu9j50IDSId1PqTMq68++AFo6O9Nh8ld/3IuExVw /TtUN8WMKa4c/lZGPmAPpJv7nw== X-Google-Smtp-Source: AHgI3IbDXItuNm2O56NvwRvu39kxAfDOh0aCgaZZMpLFYK1EVYcE5sQJMw+yeNj4K4z3Squ7SeU4Uw== X-Received: by 2002:adf:9067:: with SMTP id h94mr10600283wrh.129.1549564672250; Thu, 07 Feb 2019 10:37:52 -0800 (PST) From: =?UTF-8?q?Alex=20Benn=C3=A9e?= To: qemu-devel@nongnu.org Date: Thu, 7 Feb 2019 18:37:36 +0000 Message-Id: <20190207183744.5054-9-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190207183744.5054-1-alex.bennee@linaro.org> References: <20190207183744.5054-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::42d Subject: [Qemu-devel] [PATCH v2 08/16] 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: qemu-arm@nongnu.org, =?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.20.1