]> git.ozlabs.org Git - petitboot/blobdiff - discover/platform-powerpc.c
discover/ipmi: Increase IPMI timeout to a reasonable value
[petitboot] / discover / platform-powerpc.c
index b4f2a771f64ce6b8016025860ded536a901ded1f..23e63c1be152bdbf7e1b4bc0cd3e0e69c4f20eda 100644 (file)
@@ -22,7 +22,7 @@
 static const char *partition = "common";
 static const char *sysparams_dir = "/sys/firmware/opal/sysparams/";
 static const char *devtree_dir = "/proc/device-tree/";
-static const int ipmi_timeout = 500; /* milliseconds */
+static const int ipmi_timeout = 5000; /* milliseconds. */
 
 struct param {
        char                    *name;
@@ -53,6 +53,8 @@ static const char *known_params[] = {
        "petitboot,bootdevs",
        "petitboot,language",
        "petitboot,debug?",
+       "petitboot,write?",
+       "petitboot,snapshots?",
        NULL,
 };
 
@@ -548,6 +550,14 @@ static void populate_config(struct platform_powerpc *platform,
                val = get_param(platform, "petitboot,debug?");
                config->debug = val && !strcmp(val, "true");
        }
+
+       val = get_param(platform, "petitboot,write?");
+       if (val)
+               config->allow_writes = !strcmp(val, "true");
+
+       val = get_param(platform, "petitboot,snapshots?");
+       if (val)
+               config->disable_snapshots = !strcmp(val, "false");
 }
 
 static char *iface_config_str(void *ctx, struct interface_config *config)
@@ -664,7 +674,7 @@ static void update_bootdev_config(struct platform_powerpc *platform,
                                                opt->uuid, delim);
                                break;
                        }
-                       tmp = val = talloc_asprintf_append(val, boot_str);
+                       tmp = val = talloc_asprintf_append(val, "%s", boot_str);
        }
 
        update_string_config(platform, "petitboot,bootdevs", val);
@@ -707,6 +717,12 @@ static int update_config(struct platform_powerpc *platform,
        val = config->lang ?: "";
        update_string_config(platform, "petitboot,language", val);
 
+       if (config->allow_writes == defaults->allow_writes)
+               val = "";
+       else
+               val = config->allow_writes ? "true" : "false";
+       update_string_config(platform, "petitboot,write?", val);
+
        update_network_config(platform, config);
 
        update_bootdev_config(platform, config);