From patchwork Wed Apr 20 18:08:09 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 564006 Delivered-To: patch@linaro.org Received: by 2002:a05:7000:6886:0:0:0:0 with SMTP id m6csp4421013map; Wed, 20 Apr 2022 11:39:42 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxdPAAe3Vs8MvXKLcOPcIbHkN+Uc+Ypb6cvSYTXAelPyCibz6T+l3wD2y4MAN3CIc9Cegqz X-Received: by 2002:a25:e6d8:0:b0:645:3bd8:ab5f with SMTP id d207-20020a25e6d8000000b006453bd8ab5fmr9448711ybh.560.1650479982459; Wed, 20 Apr 2022 11:39:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1650479982; cv=none; d=google.com; s=arc-20160816; b=jbhYxbBdERiCqEDdSHyGhYbFfB1WywmXB6E3FQef40/udhzlGhG0uoWwdote3fz4zE oRmR00N/0cVbtBsS5rm6XNa5obyq24Ozk+i4sPc4mW6UKjcBu8xhXOgWGGur2ESTaVYP bcQ8MvU4q4kCB09jKrXbw0e+0kzEGgtMBoY8umYuI7JVpIcQE5VJJ6JCcv0jej36+E6o gYwqUOyzsd83RyglXLrfKZKC+MxdWiWW/cRVwiGxq0bCemG5IyDqAy4tddcIHrPRZ6mk mOF6YUS1Vwk8NPS05mdY4WtyHTwsD096IpIEIJntMYK3xRfNrw/bpU1JgwOGAYeOR8wv g26Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=3yti9kIOm/U1VFu1+Eg0kWl9o9QO1lkMwbluZQdTBCw=; b=Sl5E1iXNn37Mg2oUNoMZrgFId17x5ZVKAUzVQzbAfPDqrJ0TpQnaZYHkJJ3BTYooBq W76qyWBAp6wk5Vq+OzZuNQSkfKChntvDKEKN6KZookbTemtAf4Xk5HrKLQhs4bk50VWk pv+5259Gbm9mpGGOYvHIbufv/ZuaFyuydeWRzWy90tY2yn2gyXGkmxvcSxNdm9a6rWri j/Ca6uy4xMeyxfY7sPiH0GDlm4OQnP/dBiePoqU6+ND8pdbCWh2BRvI+5Bo1FAN4vJI9 rmeisFO6G4Cs0eXyNlKRhXe05wDRlWZu+C2diCHPMHrzBWzG0IJBI5OT9btrlyMgDFHL aUhQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b="Jzk/h0F6"; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id k7-20020a256f07000000b00641d11f9e86si628534ybc.501.2022.04.20.11.39.42 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 20 Apr 2022 11:39:42 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b="Jzk/h0F6"; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:57776 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nhFEs-0003GT-02 for patch@linaro.org; Wed, 20 Apr 2022 14:39:42 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:54214) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nhEks-0001uW-SG for qemu-devel@nongnu.org; Wed, 20 Apr 2022 14:08:42 -0400 Received: from mail-ej1-x62c.google.com ([2a00:1450:4864:20::62c]:46077) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nhEkq-0001Yy-Up for qemu-devel@nongnu.org; Wed, 20 Apr 2022 14:08:42 -0400 Received: by mail-ej1-x62c.google.com with SMTP id lc2so5132339ejb.12 for ; Wed, 20 Apr 2022 11:08:40 -0700 (PDT) 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=3yti9kIOm/U1VFu1+Eg0kWl9o9QO1lkMwbluZQdTBCw=; b=Jzk/h0F6ySv7saCCD7TTKk7iHoswGsNZsiTbE4wEkQte64HSEovo+K/vc749QtYZxz XyV/b7lNsGiB5Le1do8nglP3+Y6dCrgnPe8KzxS+5pajI5G8/icbFt5y4hxWVm136MGG qLgpSGVJ4rafd6Paun/AcBxUlfnckNujC+luF+KQGon1xFGFzxTg49A2xfYm7VIScpO4 6iB/UyHzbZ2C9ZAggGAx+Eg9MIriD1xwt/JMRQQeL+Ec/iBKj3ZpoFz+AADXOFCJ1bqj J4s530em3Lep+vFFeMqweP18vkRShVwmy1rj6AcjHLoxenhLuiTJSl0hQVX7gkDslpUB I0IQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=3yti9kIOm/U1VFu1+Eg0kWl9o9QO1lkMwbluZQdTBCw=; b=c01OLvLfayuYGXTUp0QmXBcL8coEzTyaouOLAYgSipnmZefUvbsV3Ysl/T/E3VLjxz e5fhFaVwJ/WxIgGzQQ13Pe0DQ0Ezxm0vwi6DLbZSrH/RtnSaOXj10uC2rUZHXUnQvt6v Ujel8uMkRYtlM7I5HAaBHXi7nRlgr5BMpoEKdl0CZFgiNxaIfhtNw7wKkcvHYis92OAF PlwwUBuvPNwNFgHwmDORKroh2J8YMMdgF0NWq98sKcluuZyw6Y0f1KAxZbKjkSfkjgWa HVWD9cW+8EuN9MK4pbBe6mbfw453Ov74kaWsIKazoEtq/R/biD4j8NaMDwrnsW65Kfmy 4ubw== X-Gm-Message-State: AOAM5301UcjT8f2AXoahaMVhg29Rxq65nfDg33BDPK6c/6PgEMvh52od 9DfSmrpV9xN8LuHLQsdYEsjblw== X-Received: by 2002:a17:906:c14c:b0:6e8:6526:7647 with SMTP id dp12-20020a170906c14c00b006e865267647mr19280925ejc.257.1650478119500; Wed, 20 Apr 2022 11:08:39 -0700 (PDT) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id wc6-20020a170907124600b006e8816ae3a3sm6907037ejb.125.2022.04.20.11.08.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 20 Apr 2022 11:08:36 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 745461FFBA; Wed, 20 Apr 2022 19:08:32 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: peter.maydell@linaro.org, richard.henderson@linaro.org Subject: [PULL 02/25] docs/devel: add some notes on the binfmt-image-debian targets Date: Wed, 20 Apr 2022 19:08:09 +0100 Message-Id: <20220420180832.3812543-3-alex.bennee@linaro.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220420180832.3812543-1-alex.bennee@linaro.org> References: <20220420180832.3812543-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::62c; envelope-from=alex.bennee@linaro.org; helo=mail-ej1-x62c.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Paolo Bonzini , =?utf-8?q?Alex_Benn=C3=A9e?= , qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" We document some of this on the wiki but lets move it into our official developer notes documentation. Signed-off-by: Alex Bennée Cc: Paolo Bonzini Reviewed-by: Richard Henderson Message-Id: <20220419091020.3008144-3-alex.bennee@linaro.org> diff --git a/docs/devel/testing.rst b/docs/devel/testing.rst index 92d40cdd19..5b60a31807 100644 --- a/docs/devel/testing.rst +++ b/docs/devel/testing.rst @@ -637,6 +637,44 @@ The full set of annotations can be found here: https://github.com/llvm/llvm-project/blob/master/compiler-rt/lib/tsan/rtl/tsan_interface_ann.cpp +docker-binfmt-image-debian-% targets +------------------------------------ + +It is possible to combine Debian's bootstrap scripts with a configured +``binfmt_misc`` to bootstrap a number of Debian's distros including +experimental ports not yet supported by a released OS. This can +simplify setting up a rootfs by using docker to contain the foreign +rootfs rather than manually invoking chroot. + +Setting up ``binfmt_misc`` +~~~~~~~~~~~~~~~~~~~~~~~~~~ + +You can use the script ``qemu-binfmt-conf.sh`` to configure a QEMU +user binary to automatically run binaries for the foreign +architecture. While the scripts will try their best to work with +dynamically linked QEMU's a statically linked one will present less +potential complications when copying into the docker image. Modern +kernels support the ``F`` (fix binary) flag which will open the QEMU +executable on setup and avoids the need to find and re-open in the +chroot environment. This is triggered with the ``--persistent`` flag. + +Example invocation +~~~~~~~~~~~~~~~~~~ + +For example to setup the HPPA ports builds of Debian:: + + make docker-binfmt-image-debian-sid-hppa \ + DEB_TYPE=sid DEB_ARCH=hppa \ + DEB_URL=http://ftp.ports.debian.org/debian-ports/ \ + DEB_KEYRING=/usr/share/keyrings/debian-ports-archive-keyring.gpg \ + EXECUTABLE=(pwd)/qemu-hppa V=1 + +The ``DEB_`` variables are substitutions used by +``debian-boostrap.pre`` which is called to do the initial debootstrap +of the rootfs before it is copied into the container. The second stage +is run as part of the build. The final image will be tagged as +``qemu/debian-sid-hppa``. + VM testing ----------