summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSamuel Mendoza-Jonas <sam@mendozajonas.com>2017-08-23 11:05:58 +1000
committerSamuel Mendoza-Jonas <sam@mendozajonas.com>2017-08-29 14:11:24 +1000
commit8edb984cdaf8beac0b61f56da0cdde1c798215c3 (patch)
treeb2c48f2016221a3a8e3aacb217a4843062e24c8c
parent08e12d820c9f0e4199bd648316749f5daa26f4cf (diff)
downloadtalos-petitboot-8edb984cdaf8beac0b61f56da0cdde1c798215c3.tar.gz
talos-petitboot-8edb984cdaf8beac0b61f56da0cdde1c798215c3.zip
discover/device-handler: Disable safe mode warning on reinit
If a user pressed "Rescan Devices" in safe mode the reinit would complete successfully, but the big warning that safe mode is active would remain. On reinit clear the safe_mode flag properly. This has no functional change aside from clearing the UI warning - the IPMI override remains active until cleared or a successful boot occurs. Signed-off-by: Samuel Mendoza-Jonas <sam@mendozajonas.com> (cherry picked from commit b9b5fa357e5921eb752e62f7146339007d9f767f)
-rw-r--r--discover/device-handler.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/discover/device-handler.c b/discover/device-handler.c
index f1a392f..33e3c8c 100644
--- a/discover/device-handler.c
+++ b/discover/device-handler.c
@@ -18,6 +18,7 @@
#include <process/process.h>
#include <url/url.h>
#include <i18n/i18n.h>
+#include <pb-config/pb-config.h>
#include <sys/sysmacros.h>
#include <sys/types.h>
@@ -367,6 +368,7 @@ void device_handler_reinit(struct device_handler *handler)
{
struct discover_boot_option *opt, *tmp;
struct ramdisk_device *ramdisk;
+ struct config *config;
unsigned int i;
device_handler_cancel_default(handler);
@@ -405,6 +407,14 @@ void device_handler_reinit(struct device_handler *handler)
set_env_variables(config_get());
+ /* If the safe mode warning was active disable it now */
+ if (config_get()->safe_mode) {
+ config = config_copy(handler, config_get());
+ config->safe_mode = false;
+ config_set(config);
+ discover_server_notify_config(handler->server, config);
+ }
+
device_handler_reinit_sources(handler);
}
OpenPOWER on IntegriCloud