Show a patch.

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

{
    "id": 11514,
    "url": "https://patchwork.libcamera.org/api/patches/11514/?format=api",
    "web_url": "https://patchwork.libcamera.org/patch/11514/",
    "project": {
        "id": 1,
        "url": "https://patchwork.libcamera.org/api/projects/1/?format=api",
        "name": "libcamera",
        "link_name": "libcamera",
        "list_id": "libcamera_core",
        "list_email": "libcamera-devel@lists.libcamera.org",
        "web_url": "",
        "scm_url": "",
        "webscm_url": ""
    },
    "msgid": "<20210308131813.17517-1-laurent.pinchart@ideasonboard.com>",
    "date": "2021-03-08T13:18:13",
    "name": "[libcamera-devel,v2] utils: Add kernel headers update script",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": false,
    "hash": "117a1ceb67b6edc2e82de258d8d4ed424efb5440",
    "submitter": {
        "id": 2,
        "url": "https://patchwork.libcamera.org/api/people/2/?format=api",
        "name": "Laurent Pinchart",
        "email": "laurent.pinchart@ideasonboard.com"
    },
    "delegate": null,
    "mbox": "https://patchwork.libcamera.org/patch/11514/mbox/",
    "series": [
        {
            "id": 1768,
            "url": "https://patchwork.libcamera.org/api/series/1768/?format=api",
            "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=1768",
            "date": "2021-03-08T13:18:13",
            "name": "[libcamera-devel,v2] utils: Add kernel headers update script",
            "version": 2,
            "mbox": "https://patchwork.libcamera.org/series/1768/mbox/"
        }
    ],
    "comments": "https://patchwork.libcamera.org/api/patches/11514/comments/",
    "check": "pending",
    "checks": "https://patchwork.libcamera.org/api/patches/11514/checks/",
    "tags": {},
    "headers": {
        "Return-Path": "<libcamera-devel-bounces@lists.libcamera.org>",
        "X-Original-To": "parsemail@patchwork.libcamera.org",
        "Delivered-To": "parsemail@patchwork.libcamera.org",
        "Received": [
            "from lancelot.ideasonboard.com (lancelot.ideasonboard.com\n\t[92.243.16.209])\n\tby patchwork.libcamera.org (Postfix) with ESMTPS id 48A36BD80C\n\tfor <parsemail@patchwork.libcamera.org>;\n\tMon,  8 Mar 2021 13:18:49 +0000 (UTC)",
            "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id B76E760520;\n\tMon,  8 Mar 2021 14:18:48 +0100 (CET)",
            "from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 611E4602E6\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon,  8 Mar 2021 14:18:47 +0100 (CET)",
            "from pendragon.lan (62-78-145-57.bb.dnainternet.fi [62.78.145.57])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id B9AB7AC1;\n\tMon,  8 Mar 2021 14:18:46 +0100 (CET)"
        ],
        "Authentication-Results": "lancelot.ideasonboard.com;\n\tdkim=fail reason=\"signature verification failed\" (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"qkQvhATt\"; dkim-atps=neutral",
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1615209527;\n\tbh=wS2sufyAzr3e6kvdr0q3SYhMtXTus4oZyzdCAxIn1aM=;\n\th=From:To:Cc:Subject:Date:From;\n\tb=qkQvhATtDlHSrTAKYl+FxTnoIziKBnE0nKxvtoW9Nm2yGTwsegZeMV8BkZE2Lzobg\n\tKZ+5aQuXoC49KkqM18Km7fPxylVtCLLPK0nJHIsbHqli+5hDgJSoQJsFq+GVqyR37r\n\tjgJML1X5GOoDveL42lbEi8C2SGgCzykh5PWzR29E=",
        "From": "Laurent Pinchart <laurent.pinchart@ideasonboard.com>",
        "To": "libcamera-devel@lists.libcamera.org",
        "Date": "Mon,  8 Mar 2021 15:18:13 +0200",
        "Message-Id": "<20210308131813.17517-1-laurent.pinchart@ideasonboard.com>",
        "X-Mailer": "git-send-email 2.28.0",
        "MIME-Version": "1.0",
        "Subject": "[libcamera-devel] [PATCH v2] utils: Add kernel headers update script",
        "X-BeenThere": "libcamera-devel@lists.libcamera.org",
        "X-Mailman-Version": "2.1.29",
        "Precedence": "list",
        "List-Id": "<libcamera-devel.lists.libcamera.org>",
        "List-Unsubscribe": "<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>",
        "List-Archive": "<https://lists.libcamera.org/pipermail/libcamera-devel/>",
        "List-Post": "<mailto:libcamera-devel@lists.libcamera.org>",
        "List-Help": "<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>",
        "List-Subscribe": "<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>",
        "Content-Type": "text/plain; charset=\"us-ascii\"",
        "Content-Transfer-Encoding": "7bit",
        "Errors-To": "libcamera-devel-bounces@lists.libcamera.org",
        "Sender": "\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"
    },
    "content": "Add a script to update the local copy of kernel headers (in\ninclude/linux/) from a Linux kernel git tree. The script handles header\ninstallation, manual processing of the IPU3 header that is still in\nstaging, and update of the README file.\n\nSigned-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\nReviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\n---\nChanges since v1:\n\n- Error out if the kernel tree is dirty\n- Print a message at the end instructing to apply manual changes\n---\n utils/update-kernel-headers.sh | 89 ++++++++++++++++++++++++++++++++++\n 1 file changed, 89 insertions(+)\n create mode 100755 utils/update-kernel-headers.sh",
    "diff": "diff --git a/utils/update-kernel-headers.sh b/utils/update-kernel-headers.sh\nnew file mode 100755\nindex 000000000000..3c3f34c77ad7\n--- /dev/null\n+++ b/utils/update-kernel-headers.sh\n@@ -0,0 +1,89 @@\n+#!/bin/sh\n+\n+# SPDX-License-Identifier: GPL-2.0-or-later\n+# Update the kernel headers copy from a kernel source tree\n+\n+if [ $# != 1 ] ; then\n+\techo \"Usage: $0 <kernel dir>\"\n+\texit 1\n+fi\n+\n+header_dir=\"$(dirname \"$(realpath \"$0\")\")/../include/linux\"\n+kernel_dir=\"$1\"\n+\n+# Bail out if the directory doesn't contain kernel sources\n+line=$(head -3 \"${kernel_dir}/Kbuild\" 2>/dev/null | tail -1)\n+if [ \"$line\" != \"# Kbuild for top-level directory of the kernel\" ] ; then\n+\techo \"Directory ${kernel_dir} doesn't contain a kernel source tree\"\n+\texit 1\n+fi\n+\n+if [ ! -d \"${kernel_dir}/.git\" ] ; then\n+\techo \"Directory ${kernel_dir} doesn't contain a git tree\"\n+\texit 1\n+fi\n+\n+# Check the kernel version, and reject dirty trees\n+version=$(git -C \"${kernel_dir}\" describe --dirty)\n+echo $version\n+if echo \"${version}\" | grep -q dirty ; then\n+\techo \"Kernel tree in ${kernel_dir} is dirty\"\n+\texit 1\n+fi\n+\n+# Install the headers to a temporary directory\n+install_dir=$(mktemp -d)\n+if [ ! -d \"${install_dir}\" ] ; then\n+\techo \"Failed to create temporary directory\"\n+\texit 1\n+fi\n+\n+trap \"rm -rf ${install_dir}\" EXIT\n+\n+set -e\n+make -C \"${kernel_dir}\" O=\"${install_dir}\" headers_install\n+set +e\n+\n+# Copy the headers\n+headers=\"\n+\tdrm/drm_fourcc.h\n+\tlinux/dma-buf.h\n+\tlinux/dma-heap.h\n+\tlinux/media-bus-format.h\n+\tlinux/media.h\n+\tlinux/rkisp1-config.h\n+\tlinux/v4l2-common.h\n+\tlinux/v4l2-controls.h\n+\tlinux/v4l2-mediabus.h\n+\tlinux/v4l2-subdev.h\n+\tlinux/videodev2.h\n+\"\n+\n+for header in $headers ; do\n+\tname=$(basename \"${header}\")\n+\tcp \"${install_dir}/usr/include/${header}\" \"${header_dir}/${name}\"\n+done\n+\n+# The IPU3 header is a special case, as it's stored in staging. Handle it\n+# manually.\n+(cd \"${install_dir}\" ; \"${kernel_dir}scripts/headers_install.sh\" \\\n+\t\"${kernel_dir}/drivers/staging/media/ipu3/include/intel-ipu3.h\" \\\n+\t\"${header_dir}/intel-ipu3.h\")\n+\n+# Update the README file\n+cat <<EOF > \"${header_dir}/README\"\n+# SPDX-License-Identifier: CC0-1.0\n+\n+Files in this directory are imported from ${version} of the Linux kernel. Do not\n+modify them manually.\n+EOF\n+\n+# Cleanup\n+rm -rf \"${install_dir}\"\n+\n+cat <<EOF\n+----------------------------------------------------------------------\n+Kernel headers updated. Please review and up-port local changes before\n+committing.\n+----------------------------------------------------------------------\n+EOF\n",
    "prefixes": [
        "libcamera-devel",
        "v2"
    ]
}