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;
"petitboot,bootdevs",
"petitboot,language",
"petitboot,debug?",
+ "petitboot,write?",
+ "petitboot,snapshots?",
NULL,
};
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)
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);
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);