summaryrefslogtreecommitdiffstats
path: root/discover/platform-powerpc.c
diff options
context:
space:
mode:
authorSamuel Mendoza-Jonas <sam.mj@au1.ibm.com>2015-05-06 17:03:30 +1000
committerSamuel Mendoza-Jonas <sam.mj@au1.ibm.com>2015-08-06 14:08:33 +1000
commitacc5ace6e58db2f3dceb1f7a27d0fc1fb29c4a27 (patch)
treed5577259029ad08d93de57e0a3560b6271627e8a /discover/platform-powerpc.c
parent79bfd11f662fcf46bd4ae58a0aab993cbe158dbe (diff)
downloadpetitboot-acc5ace6e58db2f3dceb1f7a27d0fc1fb29c4a27.zip
petitboot-acc5ace6e58db2f3dceb1f7a27d0fc1fb29c4a27.tar.gz
Make read-only guarantee user-settable
Create a new Petitboot option 'petitboot,write?' that specifies whether the system is allowed to mount devices read-write. The option can be toggled by the user in the nc-config screen. Signed-off-by: Samuel Mendoza-Jonas <sam.mj@au1.ibm.com>
Diffstat (limited to 'discover/platform-powerpc.c')
-rw-r--r--discover/platform-powerpc.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/discover/platform-powerpc.c b/discover/platform-powerpc.c
index 2b3b043..fc96305 100644
--- a/discover/platform-powerpc.c
+++ b/discover/platform-powerpc.c
@@ -53,6 +53,7 @@ static const char *known_params[] = {
"petitboot,bootdevs",
"petitboot,language",
"petitboot,debug?",
+ "petitboot,write?",
NULL,
};
@@ -548,6 +549,10 @@ 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");
}
static char *iface_config_str(void *ctx, struct interface_config *config)
@@ -707,6 +712,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);
OpenPOWER on IntegriCloud