Currently, we have a bug where we can't clear a boot device UUID, as we
only update config->boot_device if we're in AUTOBOOT_ONE state. This
means that the config UI can't be used to change out of "autoboot from a
single device" mode.
This sets the autoboot device unconditionally, allowing it to be
cleared.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
const struct system_info *sysinfo = screen->cui->sysinfo;
enum net_conf_type net_conf_type;
struct interface_config *iface;
const struct system_info *sysinfo = screen->cui->sysinfo;
enum net_conf_type net_conf_type;
struct interface_config *iface;
+ char *str, *end, *uuid;
int rc, idx;
config = config_copy(screen, screen->cui->config);
int rc, idx;
config = config_copy(screen, screen->cui->config);
config->autoboot_enabled = screen->autoboot_type != AUTOBOOT_DISABLED;
config->autoboot_enabled = screen->autoboot_type != AUTOBOOT_DISABLED;
if (screen->autoboot_type == AUTOBOOT_ONE) {
if (screen->autoboot_type == AUTOBOOT_ONE) {
- char mac[20], *uuid = NULL;
/* if idx is -1 here, we have an unknown UUID selected.
* Otherwise, it's a blockdev index (idx <= n_blockdevs) or an
/* if idx is -1 here, we have an unknown UUID selected.
* Otherwise, it's a blockdev index (idx <= n_blockdevs) or an
} else if (idx != -1) {
uuid = sysinfo->blockdevs[idx]->uuid;
}
} else if (idx != -1) {
uuid = sysinfo->blockdevs[idx]->uuid;
}
-
- if (uuid) {
- talloc_free(config->boot_device);
- config->boot_device = talloc_strdup(config, uuid);
- }
+ talloc_free(config->boot_device);
+ config->boot_device = uuid ? talloc_strdup(config, uuid) : NULL;
+
str = widget_textbox_get_value(screen->widgets.timeout_f);
if (str) {
unsigned long x;
str = widget_textbox_get_value(screen->widgets.timeout_f);
if (str) {
unsigned long x;