Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/805221/?format=api
{ "id": 805221, "url": "http://patchwork.ozlabs.org/api/patches/805221/?format=api", "web_url": "http://patchwork.ozlabs.org/project/petitboot/patch/20170824032706.24130-1-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": "<20170824032706.24130-1-sam@mendozajonas.com>", "list_archive_url": null, "date": "2017-08-24T03:27:06", "name": "ui/ncurses: Don't modify config when clearing IPMI override", "commit_ref": null, "pull_url": null, "state": "accepted", "archived": false, "hash": "3852755b2bab699a8381699d57455268cee66420", "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/20170824032706.24130-1-sam@mendozajonas.com/mbox/", "series": [], "comments": "http://patchwork.ozlabs.org/api/patches/805221/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/805221/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 ADH-AES256-GCM-SHA384 (256/256 bits))\n\t(No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3xd8qc14Ntz9t3H\n\tfor <incoming@patchwork.ozlabs.org>;\n\tThu, 24 Aug 2017 13:27:24 +1000 (AEST)", "from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3])\n\tby lists.ozlabs.org (Postfix) with ESMTP id 3xd8qb73LpzDrKD\n\tfor <incoming@patchwork.ozlabs.org>;\n\tThu, 24 Aug 2017 13:27:23 +1000 (AEST)", "from out2-smtp.messagingengine.com (out2-smtp.messagingengine.com\n\t[66.111.4.26])\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 3xd8qS5CdnzDrJv\n\tfor <petitboot@lists.ozlabs.org>;\n\tThu, 24 Aug 2017 13:27:16 +1000 (AEST)", "from compute2.internal (compute2.nyi.internal [10.202.2.42])\n\tby mailout.nyi.internal (Postfix) with ESMTP id 44071219CB;\n\tWed, 23 Aug 2017 23:27:14 -0400 (EDT)", "from frontend1 ([10.202.2.160])\n\tby compute2.internal (MEProxy); Wed, 23 Aug 2017 23:27:14 -0400", "from v4.ozlabs.ibm.com (unknown [122.99.82.10])\n\tby mail.messagingengine.com (Postfix) with ESMTPA id 11D267F9A8;\n\tWed, 23 Aug 2017 23:27:12 -0400 (EDT)" ], "Authentication-Results": [ "ozlabs.org;\n\tdkim=fail reason=\"signature verification failed\" (2048-bit key;\n\tunprotected) header.d=mendozajonas.com header.i=@mendozajonas.com\n\theader.b=\"VTHrhEdi\"; \n\tdkim=fail reason=\"signature verification failed\" (2048-bit key;\n\tunprotected) header.d=messagingengine.com\n\theader.i=@messagingengine.com header.b=\"ewzjvy7Q\"; \n\tdkim-atps=neutral", "lists.ozlabs.org;\n\tdkim=fail reason=\"signature verification failed\" (2048-bit key;\n\tunprotected) header.d=mendozajonas.com header.i=@mendozajonas.com\n\theader.b=\"VTHrhEdi\"; \n\tdkim=fail reason=\"signature verification failed\" (2048-bit key;\n\tunprotected) header.d=messagingengine.com\n\theader.i=@messagingengine.com header.b=\"ewzjvy7Q\"; \n\tdkim-atps=neutral", "lists.ozlabs.org; dkim=pass (2048-bit key;\n\tunprotected) header.d=mendozajonas.com header.i=@mendozajonas.com\n\theader.b=\"VTHrhEdi\"; dkim=pass (2048-bit key;\n\tunprotected) header.d=messagingengine.com\n\theader.i=@messagingengine.com\n\theader.b=\"ewzjvy7Q\"; dkim-atps=neutral" ], "DKIM-Signature": [ "v=1; a=rsa-sha256; c=relaxed/relaxed; d=\n\tmendozajonas.com; h=cc:date:from:message-id:subject:to\n\t:x-me-sender:x-me-sender:x-sasl-enc:x-sasl-enc; s=fm1; bh=73ZGTt\n\tWDPb34+Qdec3Pr3PUdMJk84ABNXzIVJbe/dkc=; b=VTHrhEdiixlOtfVj4NZw15\n\t9exsEemapKHa6ksqQ74Bongj/dV7+Qhk3R09S1issOv9Uv7BtOsr56stxHUmAwBE\n\t2uejjXS0613Pe8OO0lLl6nGaDlML87XdGDszK9YgAf3liWvKPH7fuaTI01aZlhEb\n\twRkRTLUihn5yW1eELhtdAduXzdL/kr8BIMnI8jf2mlDBVhqCDhhTsAMTfXArWx/M\n\tonqFMd0QO4DAu8gz91qN3C/25UwXH/tJNLLhUSZRWAuAVdZKTKTFMTEQ2gKjZUQk\n\tXrsC6lv6MhU6yA9Sv56uGx2RnMu9m80jNkUCtYpuCHFEkAvQsyOe9W1CEl4GfOiA\n\t==", "v=1; a=rsa-sha256; c=relaxed/relaxed; d=\n\tmessagingengine.com; h=cc:date:from:message-id:subject:to\n\t:x-me-sender:x-me-sender:x-sasl-enc:x-sasl-enc; s=fm1; bh=73ZGTt\n\tWDPb34+Qdec3Pr3PUdMJk84ABNXzIVJbe/dkc=; b=ewzjvy7QmLB07rX0myxTwo\n\tz223cUoeBJojRVte/ZjSL+ucijcMSJs1lweZkilzovmXoAmwfnqmRI8qALV24uT9\n\tt3joZZ7UkT3Hz5OpiCVAOhS4XpVfIsY6DlufRhQZQ3fGcRIaU/CrisZGE4H38MB7\n\ttKtNBbG2JWZZkaxFyNdnYFoJEiA2gYHCY+z0EV7r5ov3M3Y2cNVdplQBNM+vIzRD\n\thIupWjcTOYfhcMJQOTmjxX8lHJeZ9L6XEbWjul8qNKBoFwWylPlxw73ysyEZbPoX\n\t3gN3OFMu/OHHUX8wYV5DNLU8XkI9DXIWYEezA2xvnTCv3vWAgS3mIqb1yVmO5KvQ\n\t==" ], "X-ME-Sender": "<xms:kkeeWebkeUpSwQ9d5G0Er3cHpJiGjvbx7TQFU_MmGIYFwA3UJnVQPQ>", "X-Sasl-enc": "gvLcLi5mFzoXX6zneQ66p3xSBOB9E0ApuBmzszQCWYlk 1503545233", "From": "Samuel Mendoza-Jonas <sam@mendozajonas.com>", "To": "petitboot@lists.ozlabs.org", "Subject": "[PATCH] ui/ncurses: Don't modify config when clearing IPMI override", "Date": "Thu, 24 Aug 2017 13:27:06 +1000", "Message-Id": "<20170824032706.24130-1-sam@mendozajonas.com>", "X-Mailer": "git-send-email 2.14.0", "X-BeenThere": "petitboot@lists.ozlabs.org", "X-Mailman-Version": "2.1.23", "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>", "Cc": "Samuel Mendoza-Jonas <sam@mendozajonas.com>", "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": "When safe mode is active the config displayed in nc-config is only a\nsubset of the actual config since device init has not yet occurred.\nHowever when the \"clear override\" checkbox is ticked and the config\nsaved, the form will set the config as it is displayed, resulting in\ndevice-specific config (eg. boot order and network settings) being\ncleared. If the user only ticked the \"clear override\" checkbox this most\nlikely isn't what they intended.\n\nInstead change the checkbox to a button which when pressed clears the\noverride and exits safe mode if active, without modifying the rest of\nthe configuration.\n\nSigned-off-by: Samuel Mendoza-Jonas <sam@mendozajonas.com>\n---\n ui/ncurses/nc-config.c | 35 ++++++++++++++++++++++++++---------\n 1 file changed, 26 insertions(+), 9 deletions(-)", "diff": "diff --git a/ui/ncurses/nc-config.c b/ui/ncurses/nc-config.c\nindex 8349629..337d8a4 100644\n--- a/ui/ncurses/nc-config.c\n+++ b/ui/ncurses/nc-config.c\n@@ -84,7 +84,7 @@ struct config_screen {\n \n \t\tstruct nc_widget_label\t\t*ipmi_type_l;\n \t\tstruct nc_widget_label\t\t*ipmi_clear_l;\n-\t\tstruct nc_widget_checkbox\t*ipmi_clear_cb;\n+\t\tstruct nc_widget_button\t\t*ipmi_clear_b;\n \n \t\tstruct nc_widget_label\t\t*network_l;\n \t\tstruct nc_widget_select\t\t*network_f;\n@@ -256,11 +256,6 @@ static int screen_process_form(struct config_screen *screen)\n \t\t\tconfig->autoboot_timeout_sec = x;\n \t}\n \n-\tif (screen->ipmi_override)\n-\t\tif (widget_checkbox_get_value(screen->widgets.ipmi_clear_cb))\n-\t\t\tconfig->ipmi_bootdev = IPMI_BOOTDEV_INVALID;\n-\n-\n \tnet_conf_type = widget_select_get_value(screen->widgets.network_f);\n \n \t/* if we don't have any network interfaces, prevent per-interface\n@@ -398,6 +393,26 @@ static void cancel_click(void *arg)\n \tscreen->exit = true;\n }\n \n+static void ipmi_clear_click(void *arg)\n+{\n+\tstruct config_screen *screen = arg;\n+\tstruct config *config;\n+\tint rc;\n+\n+\tconfig = config_copy(screen, screen->cui->config);\n+\tconfig->ipmi_bootdev = IPMI_BOOTDEV_INVALID;\n+\tconfig->safe_mode = false;\n+\n+\trc = cui_send_config(screen->cui, config);\n+\ttalloc_free(config);\n+\n+\tif (rc)\n+\t\tpb_log(\"cui_send_config failed!\\n\");\n+\telse\n+\t\tpb_debug(\"config sent!\\n\");\n+\tscreen->exit = true;\n+}\n+\n static int layout_pair(struct config_screen *screen, int y,\n \t\tstruct nc_widget_label *label,\n \t\tstruct nc_widget *field)\n@@ -497,7 +512,7 @@ static void config_screen_layout_widgets(struct config_screen *screen)\n \t\ty += 1;\n \n \t\twl = widget_label_base(screen->widgets.ipmi_clear_l);\n-\t\twf = widget_checkbox_base(screen->widgets.ipmi_clear_cb);\n+\t\twf = widget_button_base(screen->widgets.ipmi_clear_b);\n \t\twidget_set_visible(wl, true);\n \t\twidget_set_visible(wf, true);\n \t\twidget_move(wl, y, screen->label_x);\n@@ -937,8 +952,10 @@ static void config_screen_setup_widgets(struct config_screen *screen,\n \t\t\t\t\t\t\tlabel);\n \t\tscreen->widgets.ipmi_clear_l = widget_new_label(set, 0, 0,\n \t\t\t\t\t\t\t_(\"Clear option:\"));\n-\t\tscreen->widgets.ipmi_clear_cb = widget_new_checkbox(set, 0, 0,\n-\t\t\t\t\t\t\tfalse);\n+\t\tscreen->widgets.ipmi_clear_b = widget_new_button(set, 0, 0,\n+\t\t\t\tstrncols(_(\"Clear IPMI override now\")) + 10,\n+\t\t\t\t_(\"Clear IPMI override now\"),\n+\t\t\t\tipmi_clear_click, screen);\n \t\tscreen->ipmi_override = true;\n \t}\n \n", "prefixes": [] }