[RFC 3/3] ui/ncurses: Add system config checkbox to enable kexec_file load
Eric Richter
erichte at linux.vnet.ibm.com
Sat Sep 10 05:26:12 AEST 2016
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 <erichte at linux.vnet.ibm.com>
---
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 10d7eb6..192bffb 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 42
+#define N_FIELDS 44
extern struct help_text config_help_text;
@@ -81,6 +81,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;
@@ -249,6 +252,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;
@@ -475,6 +480,16 @@ static void config_screen_layout_widgets(struct config_screen *screen)
y += 2;
}
+
+ 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);
@@ -890,6 +905,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,
+ false);
+
if (config->ipmi_bootdev) {
char *label = talloc_asprintf(screen,
_("%s IPMI boot option: %s"),
--
2.7.4
More information about the Petitboot
mailing list