From patchwork Thu Mar 23 16:46:19 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric Richter X-Patchwork-Id: 742776 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [103.22.144.68]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3vpst83hbhz9s3w for ; Fri, 24 Mar 2017 03:47:44 +1100 (AEDT) Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 3vpst80NtFzDqYB for ; Fri, 24 Mar 2017 03:47:44 +1100 (AEDT) X-Original-To: petitboot@lists.ozlabs.org Delivered-To: petitboot@lists.ozlabs.org Received: from mx0a-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) (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 3vpsrv0rn1zDq95 for ; Fri, 24 Mar 2017 03:46:38 +1100 (AEDT) Received: from pps.filterd (m0098419.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.20/8.16.0.20) with SMTP id v2NGhlix003223 for ; Thu, 23 Mar 2017 12:46:36 -0400 Received: from e28smtp06.in.ibm.com (e28smtp06.in.ibm.com [125.16.236.6]) by mx0b-001b2d01.pphosted.com with ESMTP id 29c0uhkh49-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Thu, 23 Mar 2017 12:46:35 -0400 Received: from localhost by e28smtp06.in.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Thu, 23 Mar 2017 22:16:33 +0530 Received: from d28relay09.in.ibm.com (9.184.220.160) by e28smtp06.in.ibm.com (192.168.1.136) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Thu, 23 Mar 2017 22:16:31 +0530 Received: from d28av01.in.ibm.com (d28av01.in.ibm.com [9.184.220.63]) by d28relay09.in.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id v2NGkTf819923066 for ; Thu, 23 Mar 2017 22:16:29 +0530 Received: from d28av01.in.ibm.com (localhost [127.0.0.1]) by d28av01.in.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id v2NGkSlg012566 for ; Thu, 23 Mar 2017 22:16:29 +0530 Received: from machine.austin.ibm.com ([9.53.92.218]) by d28av01.in.ibm.com (8.14.4/8.14.4/NCO v10.0 AVin) with ESMTP id v2NGkMxS012433; Thu, 23 Mar 2017 22:16:28 +0530 From: Eric Richter To: petitboot@lists.ozlabs.org Subject: [PATCH 3/4] ui/ncurses: Add system config checkbox to enable kexec_file load Date: Thu, 23 Mar 2017 11:46:19 -0500 X-Mailer: git-send-email 2.7.4 In-Reply-To: <1490287580-21725-1-git-send-email-erichte@linux.vnet.ibm.com> References: <1490287580-21725-1-git-send-email-erichte@linux.vnet.ibm.com> X-TM-AS-MML: disable x-cbid: 17032316-0020-0000-0000-000000D872C5 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 17032316-0021-0000-0000-000002977792 Message-Id: <1490287580-21725-4-git-send-email-erichte@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:, , definitions=2017-03-23_15:, , 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-1703230147 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 | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/ui/ncurses/nc-config.c b/ui/ncurses/nc-config.c index 8349629..1e9524b 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; @@ -68,6 +68,7 @@ struct config_screen { bool autoboot_enabled; bool ipmi_override; bool net_override; + bool kexec_method; struct { struct nc_widget_label *autoboot_l; @@ -82,6 +83,9 @@ struct config_screen { struct nc_widget_label *timeout_l; struct nc_widget_label *timeout_help_l; + struct nc_widget_label *kexec_method_l; + struct nc_widget_checkbox *kexec_method_cb; + struct nc_widget_label *ipmi_type_l; struct nc_widget_label *ipmi_clear_l; struct nc_widget_checkbox *ipmi_clear_cb; @@ -256,6 +260,8 @@ static int screen_process_form(struct config_screen *screen) config->autoboot_timeout_sec = x; } + config->kexec_method = widget_checkbox_get_value(screen->widgets.kexec_method_cb); + if (screen->ipmi_override) if (widget_checkbox_get_value(screen->widgets.ipmi_clear_cb)) config->ipmi_bootdev = IPMI_BOOTDEV_INVALID; @@ -490,6 +496,16 @@ static void config_screen_layout_widgets(struct config_screen *screen) } else y += 1; + + wl = widget_label_base(screen->widgets.kexec_method_l); + widget_set_visible(wl, true); + widget_move(wl, y, screen->label_x); + + wf = widget_checkbox_base(screen->widgets.kexec_method_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 +943,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_method_l = widget_new_label(set, 0, 0, + _("Use file_load:")); + screen->widgets.kexec_method_cb = widget_new_checkbox(set, 0, 0, + screen->kexec_method); + if (config->ipmi_bootdev) { label = talloc_asprintf(screen, _("%s IPMI boot option: %s"), @@ -1170,6 +1191,7 @@ static void config_screen_draw(struct config_screen *screen, config_screen_setup_empty(screen); } else { screen->net_conf_type = find_net_conf_type(config); + screen->kexec_method = config->kexec_method; config_screen_setup_widgets(screen, config, sysinfo); config_screen_layout_widgets(screen); }