From patchwork Thu Mar 30 18:56:24 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric Richter X-Patchwork-Id: 745385 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3vvDR64Xvbz9s5g for ; Fri, 31 Mar 2017 05:57:54 +1100 (AEDT) Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 3vvDR63bwgzDqHC for ; Fri, 31 Mar 2017 05:57:54 +1100 (AEDT) X-Original-To: petitboot@lists.ozlabs.org Delivered-To: petitboot@lists.ozlabs.org Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 3vvDQw2G9jzDq8M for ; Fri, 31 Mar 2017 05:57:44 +1100 (AEDT) Received: from pps.filterd (m0098409.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.20/8.16.0.20) with SMTP id v2UIrdJF001831 for ; Thu, 30 Mar 2017 14:57:36 -0400 Received: from e23smtp03.au.ibm.com (e23smtp03.au.ibm.com [202.81.31.145]) by mx0a-001b2d01.pphosted.com with ESMTP id 29gfnajk3q-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Thu, 30 Mar 2017 14:57:36 -0400 Received: from localhost by e23smtp03.au.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Fri, 31 Mar 2017 04:57:33 +1000 Received: from d23relay09.au.ibm.com (202.81.31.228) by e23smtp03.au.ibm.com (202.81.31.209) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Fri, 31 Mar 2017 04:57:32 +1000 Received: from d23av01.au.ibm.com (d23av01.au.ibm.com [9.190.234.96]) by d23relay09.au.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id v2UIvNU638273036 for ; Fri, 31 Mar 2017 05:57:31 +1100 Received: from d23av01.au.ibm.com (localhost [127.0.0.1]) by d23av01.au.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id v2UIux9E030863 for ; Fri, 31 Mar 2017 05:56:59 +1100 Received: from machine.austin.ibm.com ([9.53.92.247]) by d23av01.au.ibm.com (8.14.4/8.14.4/NCO v10.0 AVin) with ESMTP id v2UIusQd030755; Fri, 31 Mar 2017 05:56:58 +1100 From: Eric Richter To: petitboot@lists.ozlabs.org Subject: [PATCH v2 3/3] ui/ncurses: Add system config checkbox to enable kexec_file load Date: Thu, 30 Mar 2017 13:56:24 -0500 X-Mailer: git-send-email 2.7.4 In-Reply-To: <1490900184-26327-1-git-send-email-erichte@linux.vnet.ibm.com> References: <1490900184-26327-1-git-send-email-erichte@linux.vnet.ibm.com> X-TM-AS-MML: disable x-cbid: 17033018-0008-0000-0000-0000011C080E X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 17033018-0009-0000-0000-000009476A33 Message-Id: <1490900184-26327-4-git-send-email-erichte@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:, , definitions=2017-03-30_14:, , signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 suspectscore=1 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1702020001 definitions=main-1703300161 X-BeenThere: petitboot@lists.ozlabs.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Petitboot bootloader development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: petitboot-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "Petitboot" This patch adds an option to the system configuration menu that if checked, enables the use of kexec_file_load. Signed-off-by: Eric Richter --- ui/ncurses/nc-config.c | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/ui/ncurses/nc-config.c b/ui/ncurses/nc-config.c index 8349629..945083d 100644 --- a/ui/ncurses/nc-config.c +++ b/ui/ncurses/nc-config.c @@ -33,7 +33,7 @@ #include "nc-config.h" #include "nc-widgets.h" -#define N_FIELDS 48 +#define N_FIELDS 50 extern struct help_text config_help_text; @@ -82,6 +82,9 @@ struct config_screen { struct nc_widget_label *timeout_l; struct nc_widget_label *timeout_help_l; + struct nc_widget_label *kexec_file_l; + struct nc_widget_checkbox *kexec_file_cb; + struct nc_widget_label *ipmi_type_l; struct nc_widget_label *ipmi_clear_l; struct nc_widget_checkbox *ipmi_clear_cb; @@ -256,6 +259,8 @@ static int screen_process_form(struct config_screen *screen) config->autoboot_timeout_sec = x; } + config->kexec_file = widget_checkbox_get_value(screen->widgets.kexec_file_cb); + if (screen->ipmi_override) if (widget_checkbox_get_value(screen->widgets.ipmi_clear_cb)) config->ipmi_bootdev = IPMI_BOOTDEV_INVALID; @@ -490,6 +495,16 @@ static void config_screen_layout_widgets(struct config_screen *screen) } else y += 1; + + wl = widget_label_base(screen->widgets.kexec_file_l); + widget_set_visible(wl, true); + widget_move(wl, y, screen->label_x); + + wf = widget_checkbox_base(screen->widgets.kexec_file_cb); + widget_set_visible(wf, true); + widget_move(wf, y, screen->field_x); + y += 1; + if (screen->ipmi_override) { wl = widget_label_base(screen->widgets.ipmi_type_l); widget_set_visible(wl, true); @@ -927,6 +942,11 @@ static void config_screen_setup_widgets(struct config_screen *screen, widget_textbox_set_fixed_size(screen->widgets.timeout_f); widget_textbox_set_validator_integer(screen->widgets.timeout_f, 0, 999); + screen->widgets.kexec_file_l = widget_new_label(set, 0, 0, + _("Secure kexec:")); + screen->widgets.kexec_file_cb = widget_new_checkbox(set, 0, 0, + config->kexec_file); + if (config->ipmi_bootdev) { label = talloc_asprintf(screen, _("%s IPMI boot option: %s"),