summaryrefslogtreecommitdiffstats
path: root/discover
diff options
context:
space:
mode:
authorSamuel Mendoza-Jonas <sam@mendozajonas.com>2017-01-25 14:45:37 +1100
committerSamuel Mendoza-Jonas <sam@mendozajonas.com>2017-03-15 16:30:13 +1100
commitd0602ed25e3bff8298c19bece8cd8b3f80d86624 (patch)
tree10ecded0c7aa51f31662a811866c943082cb8e6a /discover
parent63271b068064caea5f148f6bd6728adabef5cf87 (diff)
downloadtalos-petitboot-d0602ed25e3bff8298c19bece8cd8b3f80d86624.tar.gz
talos-petitboot-d0602ed25e3bff8298c19bece8cd8b3f80d86624.zip
discover: Track both configured and current autoboot settings
If autoboot is enabled but later disabled or cancelled by, for example, an IPMI override then the nc-config screen will set the autoboot widget as disabled. If the user then makes and saves a change in nc-config, autoboot will also be saved as disabled. This accidental change is particularly awkward if the user is attempting to remove an IPMI override. Instead only ever change the autoboot setting if the user explicitly changes it. Use a new helper function 'config_autoboot_active()' to determine the current autoboot status where needed. Signed-off-by: Samuel Mendoza-Jonas <sam@mendozajonas.com>
Diffstat (limited to 'discover')
-rw-r--r--discover/device-handler.c2
-rw-r--r--discover/platform-powerpc.c15
2 files changed, 2 insertions, 15 deletions
diff --git a/discover/device-handler.c b/discover/device-handler.c
index 3cf7edf..5b7afd0 100644
--- a/discover/device-handler.c
+++ b/discover/device-handler.c
@@ -321,7 +321,7 @@ struct device_handler *device_handler_init(struct discover_server *server,
handler->server = server;
handler->waitset = waitset;
handler->dry_run = dry_run;
- handler->autoboot_enabled = config_get()->autoboot_enabled;
+ handler->autoboot_enabled = config_autoboot_active(config_get());
list_init(&handler->unresolved_boot_options);
diff --git a/discover/platform-powerpc.c b/discover/platform-powerpc.c
index e5c83a0..b5ad682 100644
--- a/discover/platform-powerpc.c
+++ b/discover/platform-powerpc.c
@@ -755,21 +755,8 @@ static void set_ipmi_bootdev(struct config *config, enum ipmi_bootdev bootdev,
config->ipmi_bootdev = bootdev;
config->ipmi_bootdev_persistent = persistent;
- switch (bootdev) {
- case IPMI_BOOTDEV_NONE:
- case IPMI_BOOTDEV_DISK:
- case IPMI_BOOTDEV_NETWORK:
- case IPMI_BOOTDEV_CDROM:
- default:
- break;
- case IPMI_BOOTDEV_SETUP:
- config->autoboot_enabled = false;
- break;
- case IPMI_BOOTDEV_SAFE:
- config->autoboot_enabled = false;
+ if (bootdev == IPMI_BOOTDEV_SAFE)
config->safe_mode = true;
- break;
- }
}
static int read_bootdev_sysparam(const char *name, uint8_t *val)
OpenPOWER on IntegriCloud