mirror of
https://github.com/systemd/systemd.git
synced 2024-12-22 17:35:35 +03:00
repart: add simple mechanism to override fstype choices
This is very useful for quickly testing things when building DDIs, in particular in the CI, and trivial to add.
This commit is contained in:
parent
489b0f515b
commit
e59049d7a9
@ -552,3 +552,6 @@ SYSTEMD_HOME_DEBUG_SUFFIX=foo \
|
||||
* `$SYSTEMD_REPART_MKFS_OPTIONS_<FSTYPE>` – configure additional arguments to use for
|
||||
`mkfs` when formatting partition file systems. There's one variable for each
|
||||
of the supported file systems.
|
||||
|
||||
* `$SYSTEMD_REPART_OVERRIDE_FSTYPE` – if set the value will override the file
|
||||
system type specified in Format= lines in partition definition files.
|
||||
|
@ -1378,9 +1378,18 @@ static int config_parse_fstype(
|
||||
void *userdata) {
|
||||
|
||||
char **fstype = ASSERT_PTR(data);
|
||||
const char *e;
|
||||
|
||||
assert(rvalue);
|
||||
|
||||
/* Let's provide an easy way to override the chosen fstype for file system partitions */
|
||||
e = secure_getenv("SYSTEMD_REPART_OVERRIDE_FSTYPE");
|
||||
if (e && !streq(rvalue, e)) {
|
||||
log_syntax(unit, LOG_NOTICE, filename, line, 0,
|
||||
"Overriding defined file system type '%s' with '%s'.", rvalue, e);
|
||||
rvalue = e;
|
||||
}
|
||||
|
||||
if (!filename_is_valid(rvalue))
|
||||
return log_syntax(unit, LOG_ERR, filename, line, 0,
|
||||
"File system type is not valid, refusing: %s", rvalue);
|
||||
|
Loading…
Reference in New Issue
Block a user