get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

GET /api/1.2/patches/2234452/?format=api
HTTP 200 OK
Allow: GET, PUT, PATCH, HEAD, OPTIONS
Content-Type: application/json
Vary: Accept

{
    "id": 2234452,
    "url": "http://patchwork.ozlabs.org/api/1.2/patches/2234452/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/uboot/patch/71ddfdd634aec7fc931f43f3b6c587774aa718a0.1778171184.git.daniel@makrotopia.org/",
    "project": {
        "id": 18,
        "url": "http://patchwork.ozlabs.org/api/1.2/projects/18/?format=api",
        "name": "U-Boot",
        "link_name": "uboot",
        "list_id": "u-boot.lists.denx.de",
        "list_email": "u-boot@lists.denx.de",
        "web_url": null,
        "scm_url": null,
        "webscm_url": null,
        "list_archive_url": "",
        "list_archive_url_format": "",
        "commit_url_format": ""
    },
    "msgid": "<71ddfdd634aec7fc931f43f3b6c587774aa718a0.1778171184.git.daniel@makrotopia.org>",
    "list_archive_url": null,
    "date": "2026-05-07T16:43:38",
    "name": "[v3,7/7] test: py: add mkimage dm-verity round-trip test",
    "commit_ref": null,
    "pull_url": null,
    "state": "new",
    "archived": false,
    "hash": "610dde459bd15b236ebdc5da46e4350792261219",
    "submitter": {
        "id": 64091,
        "url": "http://patchwork.ozlabs.org/api/1.2/people/64091/?format=api",
        "name": "Daniel Golle",
        "email": "daniel@makrotopia.org"
    },
    "delegate": {
        "id": 3651,
        "url": "http://patchwork.ozlabs.org/api/1.2/users/3651/?format=api",
        "username": "trini",
        "first_name": "Tom",
        "last_name": "Rini",
        "email": "trini@ti.com"
    },
    "mbox": "http://patchwork.ozlabs.org/project/uboot/patch/71ddfdd634aec7fc931f43f3b6c587774aa718a0.1778171184.git.daniel@makrotopia.org/mbox/",
    "series": [
        {
            "id": 503219,
            "url": "http://patchwork.ozlabs.org/api/1.2/series/503219/?format=api",
            "web_url": "http://patchwork.ozlabs.org/project/uboot/list/?series=503219",
            "date": "2026-05-07T16:40:15",
            "name": "fit: dm-verity support",
            "version": 3,
            "mbox": "http://patchwork.ozlabs.org/series/503219/mbox/"
        }
    ],
    "comments": "http://patchwork.ozlabs.org/api/patches/2234452/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/2234452/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "<u-boot-bounces@lists.denx.de>",
        "X-Original-To": "incoming@patchwork.ozlabs.org",
        "Delivered-To": "patchwork-incoming@legolas.ozlabs.org",
        "Authentication-Results": [
            "legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de\n (client-ip=85.214.62.61; helo=phobos.denx.de;\n envelope-from=u-boot-bounces@lists.denx.de; receiver=patchwork.ozlabs.org)",
            "phobos.denx.de;\n dmarc=none (p=none dis=none) header.from=makrotopia.org",
            "phobos.denx.de;\n spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de",
            "phobos.denx.de; dmarc=none (p=none dis=none)\n header.from=makrotopia.org",
            "phobos.denx.de;\n spf=pass smtp.mailfrom=daniel@makrotopia.org"
        ],
        "Received": [
            "from phobos.denx.de (phobos.denx.de [85.214.62.61])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange x25519)\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4gBJ511X6Lz1yCg\n\tfor <incoming@patchwork.ozlabs.org>; Fri, 08 May 2026 02:44:53 +1000 (AEST)",
            "from h2850616.stratoserver.net (localhost [IPv6:::1])\n\tby phobos.denx.de (Postfix) with ESMTP id 4732B84BED;\n\tThu,  7 May 2026 18:43:59 +0200 (CEST)",
            "by phobos.denx.de (Postfix, from userid 109)\n id 43B5B84BC7; Thu,  7 May 2026 18:43:58 +0200 (CEST)",
            "from pidgin.makrotopia.org (pidgin.makrotopia.org\n [IPv6:2a07:2ec0:3002::65])\n (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits))\n (No client certificate requested)\n by phobos.denx.de (Postfix) with ESMTPS id 5F99E84BEA\n for <u-boot@lists.denx.de>; Thu,  7 May 2026 18:43:56 +0200 (CEST)",
            "from local\n by pidgin.makrotopia.org with esmtpsa (TLS1.3:TLS_AES_256_GCM_SHA384:256)\n (Exim 4.99) (envelope-from <daniel@makrotopia.org>)\n id 1wL1p7-000000006jG-3CAs; Thu, 07 May 2026 16:43:41 +0000"
        ],
        "X-Spam-Checker-Version": "SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de",
        "X-Spam-Level": "",
        "X-Spam-Status": "No, score=-1.9 required=5.0 tests=BAYES_00,\n RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS autolearn=ham\n autolearn_force=no version=3.4.2",
        "Date": "Thu, 7 May 2026 17:43:38 +0100",
        "From": "Daniel Golle <daniel@makrotopia.org>",
        "To": "Tom Rini <trini@konsulko.com>, Simon Glass <sjg@chromium.org>,\n Quentin Schulz <quentin.schulz@cherry.de>,\n Kory Maincent <kory.maincent@bootlin.com>,\n Mattijs Korpershoek <mkorpershoek@kernel.org>,\n Anshul Dalal <anshuld@ti.com>, Martin Schwan <m.schwan@phytec.de>,\n Daniel Golle <daniel@makrotopia.org>,\n Ilias Apalodimas <ilias.apalodimas@linaro.org>,\n Sughosh Ganu <sughosh.ganu@arm.com>, Benjamin ROBIN <dev@benjarobin.fr>,\n Ludwig Nussel <ludwig.nussel@siemens.com>,\n Marek Vasut <marek.vasut+renesas@mailbox.org>,\n James Hilliard <james.hilliard1@gmail.com>,\n Kunihiko Hayashi <hayashi.kunihiko@socionext.com>,\n Frank Wunderlich <frank-w@public-files.de>,\n Mayuresh Chitale <mchitale@ventanamicro.com>,\n Neil Armstrong <neil.armstrong@linaro.org>,\n Wolfgang Wallner <wolfgang.wallner@at.abb.com>,\n Shiji Yang <yangshiji66@outlook.com>,\n Aristo Chen <jj251510319013@gmail.com>, Rasmus Villemoes <ravi@prevas.dk>,\n Francois Berder <fberder@outlook.fr>, u-boot@lists.denx.de",
        "Subject": "[PATCH v3 7/7] test: py: add mkimage dm-verity round-trip test",
        "Message-ID": "\n <71ddfdd634aec7fc931f43f3b6c587774aa718a0.1778171184.git.daniel@makrotopia.org>",
        "References": "<cover.1778171184.git.daniel@makrotopia.org>",
        "MIME-Version": "1.0",
        "Content-Type": "text/plain; charset=us-ascii",
        "Content-Disposition": "inline",
        "In-Reply-To": "<cover.1778171184.git.daniel@makrotopia.org>",
        "X-BeenThere": "u-boot@lists.denx.de",
        "X-Mailman-Version": "2.1.39",
        "Precedence": "list",
        "List-Id": "U-Boot discussion <u-boot.lists.denx.de>",
        "List-Unsubscribe": "<https://lists.denx.de/options/u-boot>,\n <mailto:u-boot-request@lists.denx.de?subject=unsubscribe>",
        "List-Archive": "<https://lists.denx.de/pipermail/u-boot/>",
        "List-Post": "<mailto:u-boot@lists.denx.de>",
        "List-Help": "<mailto:u-boot-request@lists.denx.de?subject=help>",
        "List-Subscribe": "<https://lists.denx.de/listinfo/u-boot>,\n <mailto:u-boot-request@lists.denx.de?subject=subscribe>",
        "Errors-To": "u-boot-bounces@lists.denx.de",
        "Sender": "\"U-Boot\" <u-boot-bounces@lists.denx.de>",
        "X-Virus-Scanned": "clamav-milter 0.103.8 at phobos.denx.de",
        "X-Virus-Status": "Clean"
    },
    "content": "Add test/py/tests/test_fit_verity.py with two tests.\n\nBoth tests are skipped if veritysetup is not installed on the host.\n\nSigned-off-by: Daniel Golle <daniel@makrotopia.org>\n---\nv3: drop unused 'struct' import and the home-rolled have_veritysetup()\n    helper; use @pytest.mark.requiredtool('veritysetup') instead\nv2: new patch\n\n test/py/tests/test_fit_verity.py | 145 +++++++++++++++++++++++++++++++\n 1 file changed, 145 insertions(+)\n create mode 100644 test/py/tests/test_fit_verity.py",
    "diff": "diff --git a/test/py/tests/test_fit_verity.py b/test/py/tests/test_fit_verity.py\nnew file mode 100644\nindex 00000000000..b18c569d318\n--- /dev/null\n+++ b/test/py/tests/test_fit_verity.py\n@@ -0,0 +1,145 @@\n+# SPDX-License-Identifier: GPL-2.0+\n+#\n+# Copyright 2026 Daniel Golle <daniel@makrotopia.org>\n+\n+\"\"\"\n+Test mkimage dm-verity Merkle-tree generation\n+\n+Build a minimal .its with a dm-verity subnode (user-provided properties only),\n+run mkimage -E, and verify that the computed properties (digest, salt,\n+num-data-blocks, hash-start-block) are written into the resulting FIT.\n+\n+This test does not run the sandbox.  It only exercises the host tool 'mkimage'.\n+Requires 'veritysetup' from the cryptsetup package on the build host.\n+\"\"\"\n+\n+import os\n+import pytest\n+import utils\n+\n+ITS_TEMPLATE = \"\"\"\\\n+/dts-v1/;\n+\n+/ {\n+    description = \"dm-verity test\";\n+    #address-cells = <1>;\n+\n+    images {\n+        rootfs {\n+            description = \"test filesystem\";\n+            data = /incbin/(\"./rootfs.bin\");\n+            type = \"filesystem\";\n+            arch = \"sandbox\";\n+            compression = \"none\";\n+\n+            dm-verity {\n+                algo = \"sha256\";\n+                data-block-size = <4096>;\n+                hash-block-size = <4096>;\n+            };\n+        };\n+    };\n+\n+    configurations {\n+        default = \"conf-1\";\n+        conf-1 {\n+            description = \"test config\";\n+            loadables = \"rootfs\";\n+        };\n+    };\n+};\n+\"\"\"\n+\n+@pytest.mark.requiredtool('dtc')\n+@pytest.mark.requiredtool('fdtget')\n+@pytest.mark.requiredtool('veritysetup')\n+def test_mkimage_verity(ubman):\n+    \"\"\"Test that mkimage computes dm-verity properties correctly.\"\"\"\n+\n+    mkimage = ubman.config.build_dir + '/tools/mkimage'\n+    tempdir = os.path.join(ubman.config.result_dir, 'verity')\n+    os.makedirs(tempdir, exist_ok=True)\n+\n+    rootfs_file = os.path.join(tempdir, 'rootfs.bin')\n+    its_file = os.path.join(tempdir, 'image.its')\n+    fit_file = os.path.join(tempdir, 'image.itb')\n+\n+    # Create a dummy filesystem image: 64 x 4096-byte blocks of 0xa5\n+    block_size = 4096\n+    num_blocks = 64\n+    with open(rootfs_file, 'wb') as f:\n+        f.write(bytes([0xa5]) * block_size * num_blocks)\n+\n+    with open(its_file, 'w') as f:\n+        f.write(ITS_TEMPLATE)\n+\n+    # Build the FIT with external data (required for dm-verity)\n+    dtc_args = f'-I dts -O dtb -i {tempdir}'\n+    utils.run_and_log(ubman,\n+                      [mkimage, '-E', '-D', dtc_args, '-f', its_file, fit_file])\n+\n+    # Helper to read FIT properties via fdtget\n+    def fdt_get(node, prop):\n+        val = utils.run_and_log(\n+            ubman, f'fdtget {fit_file} {node} {prop}')\n+        return val.strip()\n+\n+    def fdt_get_hex(node, prop):\n+        \"\"\"Read a byte-array property as hex string.\"\"\"\n+        val = utils.run_and_log(\n+            ubman, f'fdtget -tbx {fit_file} {node} {prop}')\n+        return ''.join(b.zfill(2) for b in val.strip().split())\n+\n+    verity_path = '/images/rootfs/dm-verity'\n+\n+    # Verify mkimage filled in the computed properties\n+    algo = fdt_get(verity_path, 'algo')\n+    assert algo == 'sha256', f'algo mismatch: {algo}'\n+\n+    dbs = int(fdt_get(verity_path, 'data-block-size'))\n+    assert dbs == block_size, f'data-block-size mismatch: {dbs}'\n+\n+    hbs = int(fdt_get(verity_path, 'hash-block-size'))\n+    assert hbs == block_size, f'hash-block-size mismatch: {hbs}'\n+\n+    nblk = int(fdt_get(verity_path, 'num-data-blocks'))\n+    assert nblk == num_blocks, f'num-data-blocks mismatch: {nblk} != {num_blocks}'\n+\n+    hblk = int(fdt_get(verity_path, 'hash-start-block'))\n+    # With --no-superblock, hash-start-block == num-data-blocks\n+    assert hblk == num_blocks, f'hash-start-block mismatch: {hblk} != {num_blocks}'\n+\n+    # digest and salt should be non-empty hex strings (sha256 = 32 bytes = 64 hex chars)\n+    digest = fdt_get_hex(verity_path, 'digest')\n+    assert len(digest) == 64, f'digest length mismatch: {len(digest)} (expected 64)'\n+    # Should not be all zeros\n+    assert digest != '0' * 64, 'digest is all zeros'\n+\n+    salt = fdt_get_hex(verity_path, 'salt')\n+    assert len(salt) == 64, f'salt length mismatch: {len(salt)} (expected 64)'\n+\n+\n+@pytest.mark.requiredtool('dtc')\n+@pytest.mark.requiredtool('veritysetup')\n+def test_mkimage_verity_requires_external(ubman):\n+    \"\"\"Test that mkimage rejects dm-verity without -E flag.\"\"\"\n+\n+    mkimage = ubman.config.build_dir + '/tools/mkimage'\n+    tempdir = os.path.join(ubman.config.result_dir, 'verity_no_ext')\n+    os.makedirs(tempdir, exist_ok=True)\n+\n+    rootfs_file = os.path.join(tempdir, 'rootfs.bin')\n+    its_file = os.path.join(tempdir, 'image.its')\n+    fit_file = os.path.join(tempdir, 'image.itb')\n+\n+    with open(rootfs_file, 'wb') as f:\n+        f.write(bytes([0xa5]) * 4096 * 8)\n+\n+    with open(its_file, 'w') as f:\n+        f.write(ITS_TEMPLATE)\n+\n+    # Without -E, mkimage should fail for dm-verity images\n+    dtc_args = f'-I dts -O dtb -i {tempdir}'\n+    with pytest.raises(Exception):\n+        utils.run_and_log(ubman,\n+                          [mkimage, '-D', dtc_args, '-f', its_file, fit_file])\n",
    "prefixes": [
        "v3",
        "7/7"
    ]
}