]> git.ozlabs.org Git - petitboot/commitdiff
discover: Hookup --no-autoboot to config
authorGeoff Levand <geoff@infradead.org>
Tue, 23 Jul 2013 20:30:19 +0000 (13:30 -0700)
committerGeoff Levand <geoff@infradead.org>
Tue, 23 Jul 2013 20:49:23 +0000 (13:49 -0700)
Add new routine config_set_autoboot(), and use it to set
the --no-autoboot option.

Signed-off-by: Geoff Levand <geoff@infradead.org>
discover/pb-discover.c
lib/pb-config/pb-config.c
lib/pb-config/pb-config.h

index 007e66f2dcd671ae83058b257d9b4a72a43e785a..8ab284974d3863bf101d9e90b5ba1e03c79cc64d 100644 (file)
@@ -157,6 +157,9 @@ int main(int argc, char *argv[])
 
        config_init(NULL);
 
 
        config_init(NULL);
 
+       if (opts.no_autoboot == opt_yes)
+               config_set_autoboot(false);
+
        waitset = waitset_create(NULL);
 
        server = discover_server_init(waitset);
        waitset = waitset_create(NULL);
 
        server = discover_server_init(waitset);
index 9f7d240999018c1b7f09a0bbe653c997e5ee735c..6398a690e4966fef69740728170f25fa7f2b2a61 100644 (file)
@@ -23,8 +23,8 @@ static void dump_config(struct config *config)
 
        pb_log("configuration:\n");
 
 
        pb_log("configuration:\n");
 
-       pb_log(" autoboot enabled: %s\n",
-                       config->autoboot_enabled ? "yes" : "no");
+       pb_log(" autoboot: %s\n",
+                       config->autoboot_enabled ? "enabled" : "disabled");
 
        if (config->n_network_configs > 0)
                pb_log(" network configuration:\n");
 
        if (config->n_network_configs > 0)
                pb_log(" network configuration:\n");
@@ -74,6 +74,14 @@ const struct config *config_get(void)
        return config;
 }
 
        return config;
 }
 
+void config_set_autoboot(bool autoboot_enabled)
+{
+       config->autoboot_enabled = autoboot_enabled;
+
+       pb_log("set autoboot: %s\n",
+                       config->autoboot_enabled ? "enabled" : "disabled");
+}
+
 int config_fini(void)
 {
        talloc_free(config);
 int config_fini(void)
 {
        talloc_free(config);
index cfcf025fee046f9d8d3d142b0ee1cf5de88a91b0..c377087414dbc30c788a6d4ac88fc475e7ba8961 100644 (file)
@@ -33,6 +33,7 @@ struct config {
 
 int config_init(void *ctx);
 const struct config *config_get(void);
 
 int config_init(void *ctx);
 const struct config *config_get(void);
+void config_set_autoboot(bool autoboot_enabled);
 int config_fini(void);
 
 #endif /* CONFIGURATION_H */
 int config_fini(void);
 
 #endif /* CONFIGURATION_H */