]> git.ozlabs.org Git - petitboot/blobdiff - discover/device-handler.c
discover/device-handler: Disable safe mode warning on reinit
[petitboot] / discover / device-handler.c
index ce3fc465ec03fadef829052eda8fe1ad8644ed7a..4e1b3ca77fc0f447bfd0febfdf66db22c7121ed6 100644 (file)
@@ -18,6 +18,7 @@
 #include <process/process.h>
 #include <url/url.h>
 #include <i18n/i18n.h>
 #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>
 
 #include <sys/sysmacros.h>
 #include <sys/types.h>
@@ -393,6 +394,7 @@ void device_handler_reinit(struct device_handler *handler)
 {
        struct discover_boot_option *opt, *tmp;
        struct ramdisk_device *ramdisk;
 {
        struct discover_boot_option *opt, *tmp;
        struct ramdisk_device *ramdisk;
+       struct config *config;
        unsigned int i;
 
        device_handler_cancel_default(handler);
        unsigned int i;
 
        device_handler_cancel_default(handler);
@@ -440,6 +442,14 @@ void device_handler_reinit(struct device_handler *handler)
 
        set_env_variables(config_get());
 
 
        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);
 }
 
        device_handler_reinit_sources(handler);
 }