summaryrefslogtreecommitdiff
path: root/src/partition
diff options
context:
space:
mode:
authorDaan De Meyer <daan.j.demeyer@gmail.com>2023-05-07 21:39:10 +0200
committerDaan De Meyer <daan.j.demeyer@gmail.com>2023-05-12 07:51:50 +0200
commit2bc161dddb9d355d81ca1d2126c94b9c18b9e3cf (patch)
treeae5db93def62ca474231fe3ef661b6d8d1b77c97 /src/partition
parentaaa27e2e21c04339914f26b7125789087eb51166 (diff)
downloadsystemd-2bc161dddb9d355d81ca1d2126c94b9c18b9e3cf.tar.gz
mkfs-util: Add quiet argument to make_filesystem()
We default to quiet operation everywhere except for repart, where we disable quiet and have the mkfs tools write to stdout. We also make sure --quiet or equivalent is implemented for all mkfs tools.
Diffstat (limited to 'src/partition')
-rw-r--r--src/partition/makefs.c10
-rw-r--r--src/partition/repart.c7
2 files changed, 13 insertions, 4 deletions
diff --git a/src/partition/makefs.c b/src/partition/makefs.c
index b37a3b9008..53439a4bbc 100644
--- a/src/partition/makefs.c
+++ b/src/partition/makefs.c
@@ -70,7 +70,15 @@ static int run(int argc, char *argv[]) {
if (r < 0)
return log_error_errno(r, "Failed to extract file name from '%s': %m", device);
- return make_filesystem(device, fstype, label, NULL, uuid, true, 0, NULL);
+ return make_filesystem(device,
+ fstype,
+ label,
+ /* root = */ NULL,
+ uuid,
+ /* discard = */ true,
+ /* quiet = */ true,
+ /* sector_size = */ 0,
+ /* extra_mkfs_options = */ NULL);
}
DEFINE_MAIN_FUNCTION(run);
diff --git a/src/partition/repart.c b/src/partition/repart.c
index 44b0e461f2..8766225d6f 100644
--- a/src/partition/repart.c
+++ b/src/partition/repart.c
@@ -4270,7 +4270,8 @@ static int context_mkfs(Context *context) {
p->format);
r = make_filesystem(partition_target_path(t), p->format, strempty(p->new_label), root,
- p->fs_uuid, arg_discard, context->sector_size, extra_mkfs_options);
+ p->fs_uuid, arg_discard, /* quiet = */ false, context->sector_size,
+ extra_mkfs_options);
if (r < 0)
return r;
@@ -5604,7 +5605,7 @@ static int context_minimize(Context *context) {
p->format);
r = make_filesystem(d ? d->node : temp, p->format, strempty(p->new_label), root, fs_uuid,
- arg_discard, context->sector_size, extra_mkfs_options);
+ arg_discard, /* quiet = */ false, context->sector_size, extra_mkfs_options);
if (r < 0)
return r;
@@ -5669,7 +5670,7 @@ static int context_minimize(Context *context) {
return log_error_errno(r, "Failed to make loopback device of %s: %m", temp);
r = make_filesystem(d ? d->node : temp, p->format, strempty(p->new_label), root, p->fs_uuid,
- arg_discard, context->sector_size, extra_mkfs_options);
+ arg_discard, /* quiet = */ false, context->sector_size, extra_mkfs_options);
if (r < 0)
return r;