get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 631980,
    "url": "http://patchwork.ozlabs.org/api/patches/631980/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/petitboot/patch/20160608062812.14480-4-sam@mendozajonas.com/",
    "project": {
        "id": 53,
        "url": "http://patchwork.ozlabs.org/api/projects/53/?format=api",
        "name": "Petitboot development",
        "link_name": "petitboot",
        "list_id": "petitboot.lists.ozlabs.org",
        "list_email": "petitboot@lists.ozlabs.org",
        "web_url": "",
        "scm_url": "",
        "webscm_url": "",
        "list_archive_url": "",
        "list_archive_url_format": "",
        "commit_url_format": ""
    },
    "msgid": "<20160608062812.14480-4-sam@mendozajonas.com>",
    "list_archive_url": null,
    "date": "2016-06-08T06:28:09",
    "name": "[3/6] discover/boot: Set boot_tty variable before kexec",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": false,
    "hash": "0e5deca03653f3a33dec41475954ba28481282b6",
    "submitter": {
        "id": 68013,
        "url": "http://patchwork.ozlabs.org/api/people/68013/?format=api",
        "name": "Sam Mendoza-Jonas",
        "email": "sam@mendozajonas.com"
    },
    "delegate": null,
    "mbox": "http://patchwork.ozlabs.org/project/petitboot/patch/20160608062812.14480-4-sam@mendozajonas.com/mbox/",
    "series": [],
    "comments": "http://patchwork.ozlabs.org/api/patches/631980/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/631980/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "<petitboot-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org>",
        "X-Original-To": [
            "incoming@patchwork.ozlabs.org",
            "petitboot@lists.ozlabs.org"
        ],
        "Delivered-To": [
            "patchwork-incoming@bilbo.ozlabs.org",
            "petitboot@lists.ozlabs.org"
        ],
        "Received": [
            "from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3])\n\t(using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3rPdmh1mgZz9ssM\n\tfor <incoming@patchwork.ozlabs.org>;\n\tWed,  8 Jun 2016 16:28:36 +1000 (AEST)",
            "from ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3])\n\tby lists.ozlabs.org (Postfix) with ESMTP id 3rPdmh0c9GzDq68\n\tfor <incoming@patchwork.ozlabs.org>;\n\tWed,  8 Jun 2016 16:28:36 +1000 (AEST)",
            "from mendozajonas.com (mendozajonas.com [188.166.185.233])\n\t(using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby lists.ozlabs.org (Postfix) with ESMTPS id 3rPdmY35qtzDq66\n\tfor <petitboot@lists.ozlabs.org>;\n\tWed,  8 Jun 2016 16:28:29 +1000 (AEST)",
            "from skellige.ozlabs.ibm.com (unknown [122.99.82.10])\n\t(using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128\n\tbits)) (Client did not present a certificate)\n\t(Authenticated sender: sam@mendozajonas.com)\n\tby mendozajonas.com (Postfix) with ESMTPSA id 524E6143F74\n\tfor <petitboot@lists.ozlabs.org>;\n\tWed,  8 Jun 2016 14:28:26 +0800 (SGT)"
        ],
        "Authentication-Results": [
            "ozlabs.org;\n\tdkim=fail reason=\"signature verification failed\" (1024-bit key;\n\tunprotected) header.d=mendozajonas.com header.i=@mendozajonas.com\n\theader.b=EwKv9dNa; dkim-atps=neutral",
            "lists.ozlabs.org;\n\tdkim=fail reason=\"signature verification failed\" (1024-bit key;\n\tunprotected) header.d=mendozajonas.com header.i=@mendozajonas.com\n\theader.b=EwKv9dNa; dkim-atps=neutral",
            "lists.ozlabs.org; dkim=pass (1024-bit key;\n\tunprotected) header.d=mendozajonas.com header.i=@mendozajonas.com\n\theader.b=EwKv9dNa; dkim-atps=neutral"
        ],
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=mendozajonas.com;\n\ts=mail; t=1465367306;\n\tbh=peZcci6u3cnRRdSnsyk+//YTk493ckskx3o/r1LWUGw=;\n\th=From:To:Subject:Date:In-Reply-To:References:From;\n\tb=EwKv9dNaWQXALOEUAOoSNShZmkSFdme/njxrDu2U0suBKbI+eOFBwDqvOc0oNaCT2\n\tnrmq4P5K3WElOeTHYISORhOm91Lcjx+PKoi9bkhjeZ3ap1DZwtaGnnK2/fiwy7Pif1\n\tq3NwxQhuxgViB/vlQqSCD5gGT12fI2v2TPSCYMEA=",
        "From": "Samuel Mendoza-Jonas <sam@mendozajonas.com>",
        "To": "petitboot@lists.ozlabs.org",
        "Subject": "[PATCH 3/6] discover/boot: Set boot_tty variable before kexec",
        "Date": "Wed,  8 Jun 2016 16:28:09 +1000",
        "Message-Id": "<20160608062812.14480-4-sam@mendozajonas.com>",
        "X-Mailer": "git-send-email 2.8.3",
        "In-Reply-To": "<20160608062812.14480-1-sam@mendozajonas.com>",
        "References": "<20160608062812.14480-1-sam@mendozajonas.com>",
        "X-BeenThere": "petitboot@lists.ozlabs.org",
        "X-Mailman-Version": "2.1.22",
        "Precedence": "list",
        "List-Id": "Petitboot bootloader development <petitboot.lists.ozlabs.org>",
        "List-Unsubscribe": "<https://lists.ozlabs.org/options/petitboot>,\n\t<mailto:petitboot-request@lists.ozlabs.org?subject=unsubscribe>",
        "List-Archive": "<http://lists.ozlabs.org/pipermail/petitboot/>",
        "List-Post": "<mailto:petitboot@lists.ozlabs.org>",
        "List-Help": "<mailto:petitboot-request@lists.ozlabs.org?subject=help>",
        "List-Subscribe": "<https://lists.ozlabs.org/listinfo/petitboot>,\n\t<mailto:petitboot-request@lists.ozlabs.org?subject=subscribe>",
        "MIME-Version": "1.0",
        "Content-Type": "text/plain; charset=\"utf-8\"",
        "Content-Transfer-Encoding": "base64",
        "Errors-To": "petitboot-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org",
        "Sender": "\"Petitboot\"\n\t<petitboot-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org>"
    },
    "content": "If boot_tty is set or a boot command is sent manually from a certain\nconsole, set the boot_tty environment variable to be used by a boot hook\nbefore kexec.\n\nSigned-off-by: Samuel Mendoza-Jonas <sam@mendozajonas.com>\n---\n discover/boot.c | 13 +++++++++++++\n 1 file changed, 13 insertions(+)",
    "diff": "diff --git a/discover/boot.c b/discover/boot.c\nindex 0d3491f..ba6ce25 100644\n--- a/discover/boot.c\n+++ b/discover/boot.c\n@@ -24,6 +24,7 @@\n #include \"boot.h\"\n #include \"paths.h\"\n #include \"resource.h\"\n+#include \"platform.h\"\n \n static const char *boot_hook_dir = PKG_SYSCONF_DIR \"/boot.d\";\n enum {\n@@ -39,6 +40,7 @@ struct boot_task {\n \tconst char *local_initrd;\n \tconst char *local_dtb;\n \tconst char *args;\n+\tconst char *boot_tty;\n \tboot_status_fn status_fn;\n \tvoid *status_arg;\n \tbool dry_run;\n@@ -206,6 +208,7 @@ static void boot_hook_setenv(struct boot_task *task)\n \tunsetenv(\"boot_initrd\");\n \tunsetenv(\"boot_dtb\");\n \tunsetenv(\"boot_args\");\n+\tunsetenv(\"boot_tty\");\n \n \tsetenv(\"boot_image\", task->local_image, 1);\n \tif (task->local_initrd)\n@@ -214,6 +217,8 @@ static void boot_hook_setenv(struct boot_task *task)\n \t\tsetenv(\"boot_dtb\", task->local_dtb, 1);\n \tif (task->args)\n \t\tsetenv(\"boot_args\", task->args, 1);\n+\tif (task->boot_tty)\n+\t\tsetenv(\"boot_tty\", task->boot_tty, 1);\n }\n \n static int hook_filter(const struct dirent *dirent)\n@@ -430,6 +435,7 @@ struct boot_task *boot(void *ctx, struct discover_boot_option *opt,\n \t\tboot_status_fn status_fn, void *status_arg)\n {\n \tstruct pb_url *image = NULL, *initrd = NULL, *dtb = NULL;\n+\tconst struct config *config;\n \tstruct boot_task *boot_task;\n \tconst char *boot_desc;\n \tint rc;\n@@ -481,6 +487,13 @@ struct boot_task *boot(void *ctx, struct discover_boot_option *opt,\n \t\tboot_task->args = NULL;\n \t}\n \n+\tif (cmd && cmd->tty)\n+\t\tboot_task->boot_tty = talloc_strdup(boot_task, cmd->tty);\n+\telse {\n+\t\tconfig = config_get();\n+\t\tboot_task->boot_tty = config ? config->boot_tty : NULL;\n+\t}\n+\n \t/* start async loads for boot resources */\n \trc = start_url_load(boot_task, \"kernel image\", image, &boot_task->image)\n \t  || start_url_load(boot_task, \"initrd\", initrd, &boot_task->initrd)\n",
    "prefixes": [
        "3/6"
    ]
}